graphiti-core 0.21.0rc7__py3-none-any.whl → 0.21.0rc9__py3-none-any.whl
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/prompts/extract_edges.py +1 -1
- graphiti_core/utils/bulk_utils.py +4 -3
- graphiti_core/utils/maintenance/edge_operations.py +17 -3
- {graphiti_core-0.21.0rc7.dist-info → graphiti_core-0.21.0rc9.dist-info}/METADATA +1 -1
- {graphiti_core-0.21.0rc7.dist-info → graphiti_core-0.21.0rc9.dist-info}/RECORD +7 -7
- {graphiti_core-0.21.0rc7.dist-info → graphiti_core-0.21.0rc9.dist-info}/WHEEL +0 -0
- {graphiti_core-0.21.0rc7.dist-info → graphiti_core-0.21.0rc9.dist-info}/licenses/LICENSE +0 -0
|
@@ -111,7 +111,7 @@ You may use information from the PREVIOUS MESSAGES only to disambiguate referenc
|
|
|
111
111
|
2. Each fact must involve two **distinct** entities.
|
|
112
112
|
3. Use a SCREAMING_SNAKE_CASE string as the `relation_type` (e.g., FOUNDED, WORKS_AT).
|
|
113
113
|
4. Do not emit duplicate or semantically redundant facts.
|
|
114
|
-
5. The `fact_text` should
|
|
114
|
+
5. The `fact_text` should closely paraphrase the original source sentence(s). Do not verbatim quote the original text.
|
|
115
115
|
6. Use `REFERENCE_TIME` to resolve vague or relative temporal expressions (e.g., "last week").
|
|
116
116
|
7. Do **not** hallucinate or infer temporal bounds from unrelated events.
|
|
117
117
|
|
|
@@ -433,14 +433,15 @@ async def dedupe_edges_bulk(
|
|
|
433
433
|
dedupe_tuples: list[tuple[EpisodicNode, EntityEdge, list[EntityEdge]]] = []
|
|
434
434
|
for i, edges_i in enumerate(extracted_edges):
|
|
435
435
|
existing_edges: list[EntityEdge] = []
|
|
436
|
-
for
|
|
437
|
-
if i == j:
|
|
438
|
-
continue
|
|
436
|
+
for edges_j in extracted_edges:
|
|
439
437
|
existing_edges += edges_j
|
|
440
438
|
|
|
441
439
|
for edge in edges_i:
|
|
442
440
|
candidates: list[EntityEdge] = []
|
|
443
441
|
for existing_edge in existing_edges:
|
|
442
|
+
# Skip self-comparison
|
|
443
|
+
if edge.uuid == existing_edge.uuid:
|
|
444
|
+
continue
|
|
444
445
|
# Approximate BM25 by checking for word overlaps (this is faster than creating many in-memory indices)
|
|
445
446
|
# This approach will cast a wider net than BM25, which is ideal for this use case
|
|
446
447
|
if (
|
|
@@ -232,6 +232,22 @@ async def resolve_extracted_edges(
|
|
|
232
232
|
edge_types: dict[str, type[BaseModel]],
|
|
233
233
|
edge_type_map: dict[tuple[str, str], list[str]],
|
|
234
234
|
) -> tuple[list[EntityEdge], list[EntityEdge]]:
|
|
235
|
+
# Fast path: deduplicate exact matches within the extracted edges before parallel processing
|
|
236
|
+
seen: dict[tuple[str, str, str], EntityEdge] = {}
|
|
237
|
+
deduplicated_edges: list[EntityEdge] = []
|
|
238
|
+
|
|
239
|
+
for edge in extracted_edges:
|
|
240
|
+
key = (
|
|
241
|
+
edge.source_node_uuid,
|
|
242
|
+
edge.target_node_uuid,
|
|
243
|
+
_normalize_string_exact(edge.fact),
|
|
244
|
+
)
|
|
245
|
+
if key not in seen:
|
|
246
|
+
seen[key] = edge
|
|
247
|
+
deduplicated_edges.append(edge)
|
|
248
|
+
|
|
249
|
+
extracted_edges = deduplicated_edges
|
|
250
|
+
|
|
235
251
|
driver = clients.driver
|
|
236
252
|
llm_client = clients.llm_client
|
|
237
253
|
embedder = clients.embedder
|
|
@@ -464,9 +480,7 @@ async def resolve_extracted_edge(
|
|
|
464
480
|
start = time()
|
|
465
481
|
|
|
466
482
|
# Prepare context for LLM
|
|
467
|
-
related_edges_context = [
|
|
468
|
-
{'id': edge.uuid, 'fact': edge.fact} for i, edge in enumerate(related_edges)
|
|
469
|
-
]
|
|
483
|
+
related_edges_context = [{'id': i, 'fact': edge.fact} for i, edge in enumerate(related_edges)]
|
|
470
484
|
|
|
471
485
|
invalidation_edge_candidates_context = [
|
|
472
486
|
{'id': i, 'fact': existing_edge.fact} for i, existing_edge in enumerate(existing_edges)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: graphiti-core
|
|
3
|
-
Version: 0.21.
|
|
3
|
+
Version: 0.21.0rc9
|
|
4
4
|
Summary: A temporal graph building library
|
|
5
5
|
Project-URL: Homepage, https://help.getzep.com/graphiti/graphiti/overview
|
|
6
6
|
Project-URL: Repository, https://github.com/getzep/graphiti
|
|
@@ -47,7 +47,7 @@ graphiti_core/prompts/dedupe_edges.py,sha256=WRXQi7JQZdIfKDICWyU7Wbs5WyD_KBblLBS
|
|
|
47
47
|
graphiti_core/prompts/dedupe_nodes.py,sha256=H4sIzpi1gBwPedTMhdY175jnLj5JtnEeb_WNITitPLU,9171
|
|
48
48
|
graphiti_core/prompts/eval.py,sha256=ijwxbE87G678imdhfPvRujepQMq_JZ3XHX4vOAcVnVI,5507
|
|
49
49
|
graphiti_core/prompts/extract_edge_dates.py,sha256=3Drs3CmvP0gJN5BidWSxrNvLet3HPoTybU3BUIAoc0Y,4218
|
|
50
|
-
graphiti_core/prompts/extract_edges.py,sha256=
|
|
50
|
+
graphiti_core/prompts/extract_edges.py,sha256=S115_KnenGJLjmVMzdarXBRj2wJ6y553UfYJgUTTDZI,6920
|
|
51
51
|
graphiti_core/prompts/extract_nodes.py,sha256=GYX97qlSSrR_3QLc48EGCti8tdC1_OKpEdAR0Y2wfVY,11629
|
|
52
52
|
graphiti_core/prompts/invalidate_edges.py,sha256=yfpcs_pyctnoM77ULPZXEtKW0oHr1MeLsJzC5yrE-o4,3547
|
|
53
53
|
graphiti_core/prompts/lib.py,sha256=DCyHePM4_q-CptTpEXGO_dBv9k7xDtclEaB1dGu7EcI,4092
|
|
@@ -64,18 +64,18 @@ graphiti_core/search/search_utils.py,sha256=ak1aBeKNuxS7szydNHwva2ABWSRlQ0S_v8ZO
|
|
|
64
64
|
graphiti_core/telemetry/__init__.py,sha256=5kALLDlU9bb2v19CdN7qVANsJWyfnL9E60J6FFgzm3o,226
|
|
65
65
|
graphiti_core/telemetry/telemetry.py,sha256=47LrzOVBCcZxsYPsnSxWFiztHoxYKKxPwyRX0hnbDGc,3230
|
|
66
66
|
graphiti_core/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
67
|
-
graphiti_core/utils/bulk_utils.py,sha256=
|
|
67
|
+
graphiti_core/utils/bulk_utils.py,sha256=7qjoqRxY9dFrj16iBMPMtkilxUH26dRuX6NaDaqL82E,20346
|
|
68
68
|
graphiti_core/utils/datetime_utils.py,sha256=J-zYSq7-H-2n9hYOXNIun12kM10vNX9mMATGR_egTmY,1806
|
|
69
69
|
graphiti_core/utils/maintenance/__init__.py,sha256=vW4H1KyapTl-OOz578uZABYcpND4wPx3Vt6aAPaXh78,301
|
|
70
70
|
graphiti_core/utils/maintenance/community_operations.py,sha256=XMiokEemn96GlvjkOvbo9hIX04Fea3eVj408NHG5P4o,11042
|
|
71
71
|
graphiti_core/utils/maintenance/dedup_helpers.py,sha256=B7k6KkB6Sii8PZCWNNTvsNiy4BNTNWpoLeGgrPLq6BE,9220
|
|
72
|
-
graphiti_core/utils/maintenance/edge_operations.py,sha256=
|
|
72
|
+
graphiti_core/utils/maintenance/edge_operations.py,sha256=p16cLA2eJeIYS9W0o1i8wYtvUpjt9mGWzRXVemAr7Bk,25305
|
|
73
73
|
graphiti_core/utils/maintenance/graph_data_operations.py,sha256=42icj3S_ELAJ-NK3jVS_rg_243dmnaZOyUitJj_uJ-M,6085
|
|
74
74
|
graphiti_core/utils/maintenance/node_operations.py,sha256=TKpXPtnTVxxan8I1xQyVkGn3zyRdb_Q00cgUpLcloig,16860
|
|
75
75
|
graphiti_core/utils/maintenance/temporal_operations.py,sha256=IIaVtShpVkOYe6haxz3a1x3v54-MzaEXG8VsxFUNeoY,3582
|
|
76
76
|
graphiti_core/utils/maintenance/utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
77
77
|
graphiti_core/utils/ontology_utils/entity_types_utils.py,sha256=4eVgxLWY6Q8k9cRJ5pW59IYF--U4nXZsZIGOVb_yHfQ,1285
|
|
78
|
-
graphiti_core-0.21.
|
|
79
|
-
graphiti_core-0.21.
|
|
80
|
-
graphiti_core-0.21.
|
|
81
|
-
graphiti_core-0.21.
|
|
78
|
+
graphiti_core-0.21.0rc9.dist-info/METADATA,sha256=K8BMq3mCQ5o9NUY3M1ZImcnwLykmMAjYcvJMvp5MN6k,27084
|
|
79
|
+
graphiti_core-0.21.0rc9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
80
|
+
graphiti_core-0.21.0rc9.dist-info/licenses/LICENSE,sha256=KCUwCyDXuVEgmDWkozHyniRyWjnWUWjkuDHfU6o3JlA,11325
|
|
81
|
+
graphiti_core-0.21.0rc9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|