graphiti-core 0.4.0__tar.gz → 0.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of graphiti-core might be problematic. Click here for more details.
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/PKG-INFO +1 -1
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/edges.py +9 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/nodes.py +23 -1
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/search/search.py +1 -1
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/search/search_utils.py +3 -15
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/pyproject.toml +1 -1
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/LICENSE +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/README.md +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/__init__.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/cross_encoder/__init__.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/cross_encoder/bge_reranker_client.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/cross_encoder/client.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/cross_encoder/openai_reranker_client.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/embedder/__init__.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/embedder/client.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/embedder/openai.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/embedder/voyage.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/errors.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/graphiti.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/helpers.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/llm_client/__init__.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/llm_client/anthropic_client.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/llm_client/client.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/llm_client/config.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/llm_client/errors.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/llm_client/groq_client.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/llm_client/openai_client.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/llm_client/utils.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/models/__init__.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/models/edges/__init__.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/models/edges/edge_db_queries.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/models/nodes/__init__.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/models/nodes/node_db_queries.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/prompts/__init__.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/prompts/dedupe_edges.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/prompts/dedupe_nodes.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/prompts/eval.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/prompts/extract_edge_dates.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/prompts/extract_edges.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/prompts/extract_nodes.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/prompts/invalidate_edges.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/prompts/lib.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/prompts/models.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/prompts/summarize_nodes.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/py.typed +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/search/__init__.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/search/search_config.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/search/search_config_recipes.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/utils/__init__.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/utils/bulk_utils.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/utils/maintenance/__init__.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/utils/maintenance/community_operations.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/utils/maintenance/edge_operations.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/utils/maintenance/graph_data_operations.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/utils/maintenance/node_operations.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/utils/maintenance/temporal_operations.py +0 -0
- {graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/utils/maintenance/utils.py +0 -0
|
@@ -103,6 +103,7 @@ class EpisodicEdge(Edge):
|
|
|
103
103
|
""",
|
|
104
104
|
uuid=uuid,
|
|
105
105
|
database_=DEFAULT_DATABASE,
|
|
106
|
+
routing_='r',
|
|
106
107
|
)
|
|
107
108
|
|
|
108
109
|
edges = [get_episodic_edge_from_record(record) for record in records]
|
|
@@ -126,6 +127,7 @@ class EpisodicEdge(Edge):
|
|
|
126
127
|
""",
|
|
127
128
|
uuids=uuids,
|
|
128
129
|
database_=DEFAULT_DATABASE,
|
|
130
|
+
routing_='r',
|
|
129
131
|
)
|
|
130
132
|
|
|
131
133
|
edges = [get_episodic_edge_from_record(record) for record in records]
|
|
@@ -149,6 +151,7 @@ class EpisodicEdge(Edge):
|
|
|
149
151
|
""",
|
|
150
152
|
group_ids=group_ids,
|
|
151
153
|
database_=DEFAULT_DATABASE,
|
|
154
|
+
routing_='r',
|
|
152
155
|
)
|
|
153
156
|
|
|
154
157
|
edges = [get_episodic_edge_from_record(record) for record in records]
|
|
@@ -230,6 +233,7 @@ class EntityEdge(Edge):
|
|
|
230
233
|
""",
|
|
231
234
|
uuid=uuid,
|
|
232
235
|
database_=DEFAULT_DATABASE,
|
|
236
|
+
routing_='r',
|
|
233
237
|
)
|
|
234
238
|
|
|
235
239
|
edges = [get_entity_edge_from_record(record) for record in records]
|
|
@@ -260,6 +264,7 @@ class EntityEdge(Edge):
|
|
|
260
264
|
""",
|
|
261
265
|
uuids=uuids,
|
|
262
266
|
database_=DEFAULT_DATABASE,
|
|
267
|
+
routing_='r',
|
|
263
268
|
)
|
|
264
269
|
|
|
265
270
|
edges = [get_entity_edge_from_record(record) for record in records]
|
|
@@ -290,6 +295,7 @@ class EntityEdge(Edge):
|
|
|
290
295
|
""",
|
|
291
296
|
group_ids=group_ids,
|
|
292
297
|
database_=DEFAULT_DATABASE,
|
|
298
|
+
routing_='r',
|
|
293
299
|
)
|
|
294
300
|
|
|
295
301
|
edges = [get_entity_edge_from_record(record) for record in records]
|
|
@@ -329,6 +335,7 @@ class CommunityEdge(Edge):
|
|
|
329
335
|
""",
|
|
330
336
|
uuid=uuid,
|
|
331
337
|
database_=DEFAULT_DATABASE,
|
|
338
|
+
routing_='r',
|
|
332
339
|
)
|
|
333
340
|
|
|
334
341
|
edges = [get_community_edge_from_record(record) for record in records]
|
|
@@ -350,6 +357,7 @@ class CommunityEdge(Edge):
|
|
|
350
357
|
""",
|
|
351
358
|
uuids=uuids,
|
|
352
359
|
database_=DEFAULT_DATABASE,
|
|
360
|
+
routing_='r',
|
|
353
361
|
)
|
|
354
362
|
|
|
355
363
|
edges = [get_community_edge_from_record(record) for record in records]
|
|
@@ -371,6 +379,7 @@ class CommunityEdge(Edge):
|
|
|
371
379
|
""",
|
|
372
380
|
group_ids=group_ids,
|
|
373
381
|
database_=DEFAULT_DATABASE,
|
|
382
|
+
routing_='r',
|
|
374
383
|
)
|
|
375
384
|
|
|
376
385
|
edges = [get_community_edge_from_record(record) for record in records]
|
|
@@ -86,7 +86,7 @@ class Node(BaseModel, ABC):
|
|
|
86
86
|
async def delete(self, driver: AsyncDriver):
|
|
87
87
|
result = await driver.execute_query(
|
|
88
88
|
"""
|
|
89
|
-
MATCH (n {uuid: $uuid})
|
|
89
|
+
MATCH (n:Entity|Episodic|Community {uuid: $uuid})
|
|
90
90
|
DETACH DELETE n
|
|
91
91
|
""",
|
|
92
92
|
uuid=self.uuid,
|
|
@@ -105,6 +105,19 @@ class Node(BaseModel, ABC):
|
|
|
105
105
|
return self.uuid == other.uuid
|
|
106
106
|
return False
|
|
107
107
|
|
|
108
|
+
@classmethod
|
|
109
|
+
async def delete_by_group_id(cls, driver: AsyncDriver, group_id: str):
|
|
110
|
+
await driver.execute_query(
|
|
111
|
+
"""
|
|
112
|
+
MATCH (n:Entity|Episodic|Community {group_id: $group_id})
|
|
113
|
+
DETACH DELETE n
|
|
114
|
+
""",
|
|
115
|
+
group_id=group_id,
|
|
116
|
+
database_=DEFAULT_DATABASE,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
return 'SUCCESS'
|
|
120
|
+
|
|
108
121
|
@classmethod
|
|
109
122
|
async def get_by_uuid(cls, driver: AsyncDriver, uuid: str): ...
|
|
110
123
|
|
|
@@ -159,6 +172,7 @@ class EpisodicNode(Node):
|
|
|
159
172
|
""",
|
|
160
173
|
uuid=uuid,
|
|
161
174
|
database_=DEFAULT_DATABASE,
|
|
175
|
+
routing_='r',
|
|
162
176
|
)
|
|
163
177
|
|
|
164
178
|
episodes = [get_episodic_node_from_record(record) for record in records]
|
|
@@ -185,6 +199,7 @@ class EpisodicNode(Node):
|
|
|
185
199
|
""",
|
|
186
200
|
uuids=uuids,
|
|
187
201
|
database_=DEFAULT_DATABASE,
|
|
202
|
+
routing_='r',
|
|
188
203
|
)
|
|
189
204
|
|
|
190
205
|
episodes = [get_episodic_node_from_record(record) for record in records]
|
|
@@ -208,6 +223,7 @@ class EpisodicNode(Node):
|
|
|
208
223
|
""",
|
|
209
224
|
group_ids=group_ids,
|
|
210
225
|
database_=DEFAULT_DATABASE,
|
|
226
|
+
routing_='r',
|
|
211
227
|
)
|
|
212
228
|
|
|
213
229
|
episodes = [get_episodic_node_from_record(record) for record in records]
|
|
@@ -259,6 +275,7 @@ class EntityNode(Node):
|
|
|
259
275
|
""",
|
|
260
276
|
uuid=uuid,
|
|
261
277
|
database_=DEFAULT_DATABASE,
|
|
278
|
+
routing_='r',
|
|
262
279
|
)
|
|
263
280
|
|
|
264
281
|
nodes = [get_entity_node_from_record(record) for record in records]
|
|
@@ -283,6 +300,7 @@ class EntityNode(Node):
|
|
|
283
300
|
""",
|
|
284
301
|
uuids=uuids,
|
|
285
302
|
database_=DEFAULT_DATABASE,
|
|
303
|
+
routing_='r',
|
|
286
304
|
)
|
|
287
305
|
|
|
288
306
|
nodes = [get_entity_node_from_record(record) for record in records]
|
|
@@ -304,6 +322,7 @@ class EntityNode(Node):
|
|
|
304
322
|
""",
|
|
305
323
|
group_ids=group_ids,
|
|
306
324
|
database_=DEFAULT_DATABASE,
|
|
325
|
+
routing_='r',
|
|
307
326
|
)
|
|
308
327
|
|
|
309
328
|
nodes = [get_entity_node_from_record(record) for record in records]
|
|
@@ -355,6 +374,7 @@ class CommunityNode(Node):
|
|
|
355
374
|
""",
|
|
356
375
|
uuid=uuid,
|
|
357
376
|
database_=DEFAULT_DATABASE,
|
|
377
|
+
routing_='r',
|
|
358
378
|
)
|
|
359
379
|
|
|
360
380
|
nodes = [get_community_node_from_record(record) for record in records]
|
|
@@ -379,6 +399,7 @@ class CommunityNode(Node):
|
|
|
379
399
|
""",
|
|
380
400
|
uuids=uuids,
|
|
381
401
|
database_=DEFAULT_DATABASE,
|
|
402
|
+
routing_='r',
|
|
382
403
|
)
|
|
383
404
|
|
|
384
405
|
communities = [get_community_node_from_record(record) for record in records]
|
|
@@ -400,6 +421,7 @@ class CommunityNode(Node):
|
|
|
400
421
|
""",
|
|
401
422
|
group_ids=group_ids,
|
|
402
423
|
database_=DEFAULT_DATABASE,
|
|
424
|
+
routing_='r',
|
|
403
425
|
)
|
|
404
426
|
|
|
405
427
|
communities = [get_community_node_from_record(record) for record in records]
|
|
@@ -143,7 +143,7 @@ async def edge_search(
|
|
|
143
143
|
search_results: list[list[EntityEdge]] = list(
|
|
144
144
|
await asyncio.gather(
|
|
145
145
|
*[
|
|
146
|
-
edge_fulltext_search(driver, query,
|
|
146
|
+
edge_fulltext_search(driver, query, group_ids, 2 * limit),
|
|
147
147
|
edge_similarity_search(
|
|
148
148
|
driver, query_vector, None, None, group_ids, 2 * limit, config.sim_min_score
|
|
149
149
|
),
|
|
@@ -135,8 +135,6 @@ async def get_communities_by_nodes(
|
|
|
135
135
|
async def edge_fulltext_search(
|
|
136
136
|
driver: AsyncDriver,
|
|
137
137
|
query: str,
|
|
138
|
-
source_node_uuid: str | None,
|
|
139
|
-
target_node_uuid: str | None,
|
|
140
138
|
group_ids: list[str] | None = None,
|
|
141
139
|
limit=RELEVANT_SCHEMA_LIMIT,
|
|
142
140
|
) -> list[EntityEdge]:
|
|
@@ -147,10 +145,8 @@ async def edge_fulltext_search(
|
|
|
147
145
|
|
|
148
146
|
cypher_query = Query("""
|
|
149
147
|
CALL db.index.fulltext.queryRelationships("edge_name_and_fact", $query, {limit: $limit})
|
|
150
|
-
YIELD relationship AS
|
|
151
|
-
|
|
152
|
-
WHERE ($source_uuid IS NULL OR n.uuid IN [$source_uuid, $target_uuid])
|
|
153
|
-
AND ($target_uuid IS NULL OR m.uuid IN [$source_uuid, $target_uuid])
|
|
148
|
+
YIELD relationship AS r, score
|
|
149
|
+
WITH r, score, startNode(r) AS n, endNode(r) AS m
|
|
154
150
|
RETURN
|
|
155
151
|
r.uuid AS uuid,
|
|
156
152
|
r.group_id AS group_id,
|
|
@@ -170,8 +166,6 @@ async def edge_fulltext_search(
|
|
|
170
166
|
records, _, _ = await driver.execute_query(
|
|
171
167
|
cypher_query,
|
|
172
168
|
query=fuzzy_query,
|
|
173
|
-
source_uuid=source_node_uuid,
|
|
174
|
-
target_uuid=target_node_uuid,
|
|
175
169
|
group_ids=group_ids,
|
|
176
170
|
limit=limit,
|
|
177
171
|
database_=DEFAULT_DATABASE,
|
|
@@ -600,13 +594,7 @@ async def get_relevant_edges(
|
|
|
600
594
|
)
|
|
601
595
|
for edge in edges
|
|
602
596
|
if edge.fact_embedding is not None
|
|
603
|
-
]
|
|
604
|
-
*[
|
|
605
|
-
edge_fulltext_search(
|
|
606
|
-
driver, edge.fact, source_node_uuid, target_node_uuid, [edge.group_id], limit
|
|
607
|
-
)
|
|
608
|
-
for edge in edges
|
|
609
|
-
],
|
|
597
|
+
]
|
|
610
598
|
)
|
|
611
599
|
|
|
612
600
|
for result in results:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/cross_encoder/bge_reranker_client.py
RENAMED
|
File without changes
|
|
File without changes
|
{graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/cross_encoder/openai_reranker_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/utils/maintenance/community_operations.py
RENAMED
|
File without changes
|
{graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/utils/maintenance/edge_operations.py
RENAMED
|
File without changes
|
{graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/utils/maintenance/graph_data_operations.py
RENAMED
|
File without changes
|
{graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/utils/maintenance/node_operations.py
RENAMED
|
File without changes
|
{graphiti_core-0.4.0 → graphiti_core-0.4.2}/graphiti_core/utils/maintenance/temporal_operations.py
RENAMED
|
File without changes
|
|
File without changes
|