graphiti-core 0.7.7__tar.gz → 0.7.9__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.7.7 → graphiti_core-0.7.9}/PKG-INFO +1 -1
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/prompts/extract_nodes.py +11 -8
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/prompts/summarize_nodes.py +2 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/utils/maintenance/node_operations.py +17 -4
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/pyproject.toml +1 -1
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/LICENSE +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/README.md +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/__init__.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/cross_encoder/__init__.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/cross_encoder/bge_reranker_client.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/cross_encoder/client.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/cross_encoder/openai_reranker_client.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/edges.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/embedder/__init__.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/embedder/client.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/embedder/openai.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/embedder/voyage.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/errors.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/graphiti.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/helpers.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/llm_client/__init__.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/llm_client/anthropic_client.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/llm_client/client.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/llm_client/config.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/llm_client/errors.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/llm_client/groq_client.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/llm_client/openai_client.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/llm_client/openai_generic_client.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/llm_client/utils.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/models/__init__.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/models/edges/__init__.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/models/edges/edge_db_queries.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/models/nodes/__init__.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/models/nodes/node_db_queries.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/nodes.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/prompts/__init__.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/prompts/dedupe_edges.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/prompts/dedupe_nodes.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/prompts/eval.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/prompts/extract_edge_dates.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/prompts/extract_edges.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/prompts/invalidate_edges.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/prompts/lib.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/prompts/models.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/prompts/prompt_helpers.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/py.typed +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/search/__init__.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/search/search.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/search/search_config.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/search/search_config_recipes.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/search/search_filters.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/search/search_utils.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/utils/__init__.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/utils/bulk_utils.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/utils/datetime_utils.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/utils/maintenance/__init__.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/utils/maintenance/community_operations.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/utils/maintenance/edge_operations.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/utils/maintenance/graph_data_operations.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/utils/maintenance/temporal_operations.py +0 -0
- {graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/utils/maintenance/utils.py +0 -0
|
@@ -30,14 +30,17 @@ class MissedEntities(BaseModel):
|
|
|
30
30
|
missed_entities: list[str] = Field(..., description="Names of entities that weren't extracted")
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
class
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
class EntityClassificationTriple(BaseModel):
|
|
34
|
+
uuid: str = Field(description='UUID of the entity')
|
|
35
|
+
name: str = Field(description='Name of the entity')
|
|
36
|
+
entity_type: str | None = Field(
|
|
37
|
+
default=None, description='Type of the entity. Must be one of the provided types or None'
|
|
37
38
|
)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class EntityClassification(BaseModel):
|
|
42
|
+
entity_classifications: list[EntityClassificationTriple] = Field(
|
|
43
|
+
..., description='List of entities classification triples.'
|
|
41
44
|
)
|
|
42
45
|
|
|
43
46
|
|
|
@@ -180,7 +183,7 @@ def classify_nodes(context: dict[str, Any]) -> list[Message]:
|
|
|
180
183
|
{context['entity_types']}
|
|
181
184
|
</ENTITY TYPES>
|
|
182
185
|
|
|
183
|
-
Given the above conversation, extracted entities, and provided entity types, classify the extracted entities.
|
|
186
|
+
Given the above conversation, extracted entities, and provided entity types and their descriptions, classify the extracted entities.
|
|
184
187
|
|
|
185
188
|
Guidelines:
|
|
186
189
|
1. Each entity must have exactly one type
|
|
@@ -85,6 +85,8 @@ def summarize_context(context: dict[str, Any]) -> list[Message]:
|
|
|
85
85
|
provided ENTITY. Summaries must be under 500 words.
|
|
86
86
|
|
|
87
87
|
In addition, extract any values for the provided entity properties based on their descriptions.
|
|
88
|
+
If the value of the entity property cannot be found in the current context, set the value of the property to None.
|
|
89
|
+
Do not hallucinate entity property values if they cannot be found in the current context.
|
|
88
90
|
|
|
89
91
|
<ENTITY>
|
|
90
92
|
{context['node_name']}
|
{graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/utils/maintenance/node_operations.py
RENAMED
|
@@ -25,7 +25,11 @@ from graphiti_core.llm_client import LLMClient
|
|
|
25
25
|
from graphiti_core.nodes import EntityNode, EpisodeType, EpisodicNode
|
|
26
26
|
from graphiti_core.prompts import prompt_library
|
|
27
27
|
from graphiti_core.prompts.dedupe_nodes import NodeDuplicate
|
|
28
|
-
from graphiti_core.prompts.extract_nodes import
|
|
28
|
+
from graphiti_core.prompts.extract_nodes import (
|
|
29
|
+
EntityClassification,
|
|
30
|
+
ExtractedNodes,
|
|
31
|
+
MissedEntities,
|
|
32
|
+
)
|
|
29
33
|
from graphiti_core.prompts.summarize_nodes import Summary
|
|
30
34
|
from graphiti_core.utils.datetime_utils import utc_now
|
|
31
35
|
|
|
@@ -152,7 +156,12 @@ async def extract_nodes(
|
|
|
152
156
|
'episode_content': episode.content,
|
|
153
157
|
'previous_episodes': [ep.content for ep in previous_episodes],
|
|
154
158
|
'extracted_entities': extracted_node_names,
|
|
155
|
-
'entity_types':
|
|
159
|
+
'entity_types': {
|
|
160
|
+
type_name: values.model_json_schema().get('description')
|
|
161
|
+
for type_name, values in entity_types.items()
|
|
162
|
+
}
|
|
163
|
+
if entity_types is not None
|
|
164
|
+
else {},
|
|
156
165
|
}
|
|
157
166
|
|
|
158
167
|
node_classifications: dict[str, str | None] = {}
|
|
@@ -163,9 +172,13 @@ async def extract_nodes(
|
|
|
163
172
|
prompt_library.extract_nodes.classify_nodes(node_classification_context),
|
|
164
173
|
response_model=EntityClassification,
|
|
165
174
|
)
|
|
166
|
-
entities = llm_response.get('entities', [])
|
|
167
175
|
entity_classifications = llm_response.get('entity_classifications', [])
|
|
168
|
-
node_classifications.update(
|
|
176
|
+
node_classifications.update(
|
|
177
|
+
{
|
|
178
|
+
entity_classification.get('name'): entity_classification.get('entity_type')
|
|
179
|
+
for entity_classification in entity_classifications
|
|
180
|
+
}
|
|
181
|
+
)
|
|
169
182
|
# catch classification errors and continue if we can't classify
|
|
170
183
|
except Exception as e:
|
|
171
184
|
logger.exception(e)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/cross_encoder/bge_reranker_client.py
RENAMED
|
File without changes
|
|
File without changes
|
{graphiti_core-0.7.7 → graphiti_core-0.7.9}/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
|
{graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/llm_client/openai_generic_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
|
{graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/utils/maintenance/community_operations.py
RENAMED
|
File without changes
|
{graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/utils/maintenance/edge_operations.py
RENAMED
|
File without changes
|
{graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/utils/maintenance/graph_data_operations.py
RENAMED
|
File without changes
|
{graphiti_core-0.7.7 → graphiti_core-0.7.9}/graphiti_core/utils/maintenance/temporal_operations.py
RENAMED
|
File without changes
|
|
File without changes
|