graphiti-core 0.7.5__py3-none-any.whl → 0.7.7__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/dedupe_nodes.py +1 -1
- graphiti_core/search/search_filters.py +1 -1
- graphiti_core/utils/maintenance/node_operations.py +22 -8
- {graphiti_core-0.7.5.dist-info → graphiti_core-0.7.7.dist-info}/METADATA +1 -1
- {graphiti_core-0.7.5.dist-info → graphiti_core-0.7.7.dist-info}/RECORD +7 -7
- {graphiti_core-0.7.5.dist-info → graphiti_core-0.7.7.dist-info}/LICENSE +0 -0
- {graphiti_core-0.7.5.dist-info → graphiti_core-0.7.7.dist-info}/WHEEL +0 -0
|
@@ -64,7 +64,7 @@ def node(context: dict[str, Any]) -> list[Message]:
|
|
|
64
64
|
{json.dumps(context['existing_nodes'], indent=2)}
|
|
65
65
|
</EXISTING NODES>
|
|
66
66
|
|
|
67
|
-
Given the above EXISTING NODES, MESSAGE, and PREVIOUS MESSAGES. Determine if the NEW NODE extracted from the conversation
|
|
67
|
+
Given the above EXISTING NODES and their attributes, MESSAGE, and PREVIOUS MESSAGES. Determine if the NEW NODE extracted from the conversation
|
|
68
68
|
is a duplicate entity of one of the EXISTING NODES.
|
|
69
69
|
|
|
70
70
|
<NEW NODE>
|
|
@@ -55,7 +55,7 @@ def node_search_filter_query_constructor(
|
|
|
55
55
|
filter_params: dict[str, Any] = {}
|
|
56
56
|
|
|
57
57
|
if filters.node_labels is not None:
|
|
58
|
-
node_labels = '
|
|
58
|
+
node_labels = '|'.join(filters.node_labels)
|
|
59
59
|
node_label_filter = ' AND n:' + node_labels
|
|
60
60
|
filter_query += node_label_filter
|
|
61
61
|
|
|
@@ -158,13 +158,17 @@ async def extract_nodes(
|
|
|
158
158
|
node_classifications: dict[str, str | None] = {}
|
|
159
159
|
|
|
160
160
|
if entity_types is not None:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
161
|
+
try:
|
|
162
|
+
llm_response = await llm_client.generate_response(
|
|
163
|
+
prompt_library.extract_nodes.classify_nodes(node_classification_context),
|
|
164
|
+
response_model=EntityClassification,
|
|
165
|
+
)
|
|
166
|
+
entities = llm_response.get('entities', [])
|
|
167
|
+
entity_classifications = llm_response.get('entity_classifications', [])
|
|
168
|
+
node_classifications.update(dict(zip(entities, entity_classifications)))
|
|
169
|
+
# catch classification errors and continue if we can't classify
|
|
170
|
+
except Exception as e:
|
|
171
|
+
logger.exception(e)
|
|
168
172
|
|
|
169
173
|
end = time()
|
|
170
174
|
logger.debug(f'Extracted new nodes: {extracted_node_names} in {(end - start) * 1000} ms')
|
|
@@ -285,7 +289,10 @@ async def resolve_extracted_node(
|
|
|
285
289
|
start = time()
|
|
286
290
|
|
|
287
291
|
# Prepare context for LLM
|
|
288
|
-
existing_nodes_context = [
|
|
292
|
+
existing_nodes_context = [
|
|
293
|
+
{'uuid': node.uuid, 'name': node.name, 'attributes': node.attributes}
|
|
294
|
+
for node in existing_nodes
|
|
295
|
+
]
|
|
289
296
|
|
|
290
297
|
extracted_node_context = {
|
|
291
298
|
'uuid': extracted_node.uuid,
|
|
@@ -362,6 +369,13 @@ async def resolve_extracted_node(
|
|
|
362
369
|
node = existing_node
|
|
363
370
|
node.name = name
|
|
364
371
|
node.summary = summary_response.get('summary', '')
|
|
372
|
+
|
|
373
|
+
new_attributes = existing_node.attributes
|
|
374
|
+
existing_attributes = existing_node.attributes
|
|
375
|
+
for attribute_name, attribute_value in existing_attributes.items():
|
|
376
|
+
if new_attributes.get(attribute_name) is None:
|
|
377
|
+
new_attributes[attribute_name] = attribute_value
|
|
378
|
+
|
|
365
379
|
uuid_map[extracted_node.uuid] = existing_node.uuid
|
|
366
380
|
|
|
367
381
|
end = time()
|
|
@@ -28,7 +28,7 @@ graphiti_core/models/nodes/node_db_queries.py,sha256=f4_UT6XL8UDt4_CO9YIHeI8pvpw
|
|
|
28
28
|
graphiti_core/nodes.py,sha256=0lH8SOpnzTtNIvG4ScnJ3SeQudviCsZwsnM867kY1aI,16998
|
|
29
29
|
graphiti_core/prompts/__init__.py,sha256=EA-x9xUki9l8wnu2l8ek_oNf75-do5tq5hVq7Zbv8Kw,101
|
|
30
30
|
graphiti_core/prompts/dedupe_edges.py,sha256=EuX8ngeItBzrlMBOgeHrpExzxIFHD2aoDyaX1ZniF6I,3556
|
|
31
|
-
graphiti_core/prompts/dedupe_nodes.py,sha256=
|
|
31
|
+
graphiti_core/prompts/dedupe_nodes.py,sha256=1MHYuqi-eXPnTQd_jEcVKfljSC_F_r5SdVRm_dpdOiI,4645
|
|
32
32
|
graphiti_core/prompts/eval.py,sha256=csW494kKBMvWSm2SYLIRuGgNghhwNR3YwGn3veo3g_Y,3691
|
|
33
33
|
graphiti_core/prompts/extract_edge_dates.py,sha256=td2yx2wnX-nLioMa0mtla3WcRyO71_wSjemT79YZGQ0,4096
|
|
34
34
|
graphiti_core/prompts/extract_edges.py,sha256=vyEdW7JAPOT_eLWUi6nRmxbvucyVoyoYX2SxXfknRUg,3467
|
|
@@ -43,7 +43,7 @@ graphiti_core/search/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
|
|
|
43
43
|
graphiti_core/search/search.py,sha256=DX-tcIa0SiKI2HX-b_WdjGE74A8RLWQor4p90dJluUA,12643
|
|
44
44
|
graphiti_core/search/search_config.py,sha256=UZN8jFA4pBlw2O5N1cuhVRBdTwMLR9N3Oyo6sQ4MDVw,3117
|
|
45
45
|
graphiti_core/search/search_config_recipes.py,sha256=yUqiLnn9vFg39M8eVwjVKfBCL_ptGrfDMQ47m_Blb0g,6885
|
|
46
|
-
graphiti_core/search/search_filters.py,sha256=
|
|
46
|
+
graphiti_core/search/search_filters.py,sha256=JkP7NbM4Dor27dne5vAuxbJic12dIJDtWJxNqmVuRec,5884
|
|
47
47
|
graphiti_core/search/search_utils.py,sha256=Bywp7trqP_gEwqH8I-JHuj3Mljw9P2K6_XooXI75jHI,25739
|
|
48
48
|
graphiti_core/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
49
|
graphiti_core/utils/bulk_utils.py,sha256=P4LKO46Yle4tBdNcQ3hDHcSQFaR8UBLfoL-z1M2Wua0,14690
|
|
@@ -52,10 +52,10 @@ graphiti_core/utils/maintenance/__init__.py,sha256=TRY3wWWu5kn3Oahk_KKhltrWnh0NA
|
|
|
52
52
|
graphiti_core/utils/maintenance/community_operations.py,sha256=gIw1M5HGgc2c3TXag5ygPPpAv5WsG-yoC8Lhmfr6FMs,10011
|
|
53
53
|
graphiti_core/utils/maintenance/edge_operations.py,sha256=tNw56vN586JYZMgie6RLRTiHZ680-kWzDIxW8ucL6SU,12780
|
|
54
54
|
graphiti_core/utils/maintenance/graph_data_operations.py,sha256=qds9ALk9PhpQs1CNZTZGpi70mqJ93Y2KhIh9X2r8MUI,6533
|
|
55
|
-
graphiti_core/utils/maintenance/node_operations.py,sha256=
|
|
55
|
+
graphiti_core/utils/maintenance/node_operations.py,sha256=aNnk8EZOPnoyRRkH48m4KIlKLsv7jfz4xdyKVBspoaA,14848
|
|
56
56
|
graphiti_core/utils/maintenance/temporal_operations.py,sha256=RdNtubCyYhOVrvcOIq2WppHls1Q-BEjtsN8r38l-Rtc,3691
|
|
57
57
|
graphiti_core/utils/maintenance/utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
|
-
graphiti_core-0.7.
|
|
59
|
-
graphiti_core-0.7.
|
|
60
|
-
graphiti_core-0.7.
|
|
61
|
-
graphiti_core-0.7.
|
|
58
|
+
graphiti_core-0.7.7.dist-info/LICENSE,sha256=KCUwCyDXuVEgmDWkozHyniRyWjnWUWjkuDHfU6o3JlA,11325
|
|
59
|
+
graphiti_core-0.7.7.dist-info/METADATA,sha256=m9rSGSFLTsfTkSldAP05q9voPu0_8YBksGtrCABKYOY,10541
|
|
60
|
+
graphiti_core-0.7.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
61
|
+
graphiti_core-0.7.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|