graphiti-core 0.7.5__tar.gz → 0.7.7__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.
Files changed (61) hide show
  1. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/PKG-INFO +1 -1
  2. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/prompts/dedupe_nodes.py +1 -1
  3. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/search/search_filters.py +1 -1
  4. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/utils/maintenance/node_operations.py +22 -8
  5. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/pyproject.toml +1 -1
  6. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/LICENSE +0 -0
  7. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/README.md +0 -0
  8. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/__init__.py +0 -0
  9. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/cross_encoder/__init__.py +0 -0
  10. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/cross_encoder/bge_reranker_client.py +0 -0
  11. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/cross_encoder/client.py +0 -0
  12. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/cross_encoder/openai_reranker_client.py +0 -0
  13. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/edges.py +0 -0
  14. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/embedder/__init__.py +0 -0
  15. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/embedder/client.py +0 -0
  16. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/embedder/openai.py +0 -0
  17. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/embedder/voyage.py +0 -0
  18. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/errors.py +0 -0
  19. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/graphiti.py +0 -0
  20. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/helpers.py +0 -0
  21. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/llm_client/__init__.py +0 -0
  22. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/llm_client/anthropic_client.py +0 -0
  23. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/llm_client/client.py +0 -0
  24. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/llm_client/config.py +0 -0
  25. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/llm_client/errors.py +0 -0
  26. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/llm_client/groq_client.py +0 -0
  27. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/llm_client/openai_client.py +0 -0
  28. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/llm_client/openai_generic_client.py +0 -0
  29. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/llm_client/utils.py +0 -0
  30. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/models/__init__.py +0 -0
  31. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/models/edges/__init__.py +0 -0
  32. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/models/edges/edge_db_queries.py +0 -0
  33. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/models/nodes/__init__.py +0 -0
  34. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/models/nodes/node_db_queries.py +0 -0
  35. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/nodes.py +0 -0
  36. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/prompts/__init__.py +0 -0
  37. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/prompts/dedupe_edges.py +0 -0
  38. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/prompts/eval.py +0 -0
  39. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/prompts/extract_edge_dates.py +0 -0
  40. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/prompts/extract_edges.py +0 -0
  41. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/prompts/extract_nodes.py +0 -0
  42. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/prompts/invalidate_edges.py +0 -0
  43. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/prompts/lib.py +0 -0
  44. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/prompts/models.py +0 -0
  45. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/prompts/prompt_helpers.py +0 -0
  46. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/prompts/summarize_nodes.py +0 -0
  47. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/py.typed +0 -0
  48. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/search/__init__.py +0 -0
  49. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/search/search.py +0 -0
  50. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/search/search_config.py +0 -0
  51. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/search/search_config_recipes.py +0 -0
  52. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/search/search_utils.py +0 -0
  53. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/utils/__init__.py +0 -0
  54. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/utils/bulk_utils.py +0 -0
  55. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/utils/datetime_utils.py +0 -0
  56. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/utils/maintenance/__init__.py +0 -0
  57. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/utils/maintenance/community_operations.py +0 -0
  58. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/utils/maintenance/edge_operations.py +0 -0
  59. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/utils/maintenance/graph_data_operations.py +0 -0
  60. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/utils/maintenance/temporal_operations.py +0 -0
  61. {graphiti_core-0.7.5 → graphiti_core-0.7.7}/graphiti_core/utils/maintenance/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: graphiti-core
3
- Version: 0.7.5
3
+ Version: 0.7.7
4
4
  Summary: A temporal graph building library
5
5
  License: Apache-2.0
6
6
  Author: Paul Paliychuk
@@ -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 = ':'.join(filters.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
- llm_response = await llm_client.generate_response(
162
- prompt_library.extract_nodes.classify_nodes(node_classification_context),
163
- response_model=EntityClassification,
164
- )
165
- entities = llm_response.get('entities', [])
166
- entity_classifications = llm_response.get('entity_classifications', [])
167
- node_classifications.update(dict(zip(entities, entity_classifications)))
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 = [{'uuid': node.uuid, 'name': node.name} for node in existing_nodes]
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()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "graphiti-core"
3
- version = "0.7.5"
3
+ version = "0.7.7"
4
4
  description = "A temporal graph building library"
5
5
  authors = [
6
6
  "Paul Paliychuk <paul@getzep.com>",
File without changes
File without changes