graphiti-core 0.22.0rc0__py3-none-any.whl → 0.22.0rc1__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.

@@ -23,39 +23,44 @@ from .prompt_helpers import to_prompt_json
23
23
 
24
24
 
25
25
  class ExtractedEntity(BaseModel):
26
- name: str = Field(..., description='Name of the extracted entity')
26
+ name: str = Field(..., description="Name of the extracted entity")
27
27
  entity_type_id: int = Field(
28
- description='ID of the classified entity type. '
29
- 'Must be one of the provided entity_type_id integers.',
28
+ description="ID of the classified entity type. "
29
+ "Must be one of the provided entity_type_id integers.",
30
30
  )
31
31
 
32
32
 
33
33
  class ExtractedEntities(BaseModel):
34
- extracted_entities: list[ExtractedEntity] = Field(..., description='List of extracted entities')
34
+ extracted_entities: list[ExtractedEntity] = Field(
35
+ ..., description="List of extracted entities"
36
+ )
35
37
 
36
38
 
37
39
  class MissedEntities(BaseModel):
38
- missed_entities: list[str] = Field(..., description="Names of entities that weren't extracted")
40
+ missed_entities: list[str] = Field(
41
+ ..., description="Names of entities that weren't extracted"
42
+ )
39
43
 
40
44
 
41
45
  class EntityClassificationTriple(BaseModel):
42
- uuid: str = Field(description='UUID of the entity')
43
- name: str = Field(description='Name of the entity')
46
+ uuid: str = Field(description="UUID of the entity")
47
+ name: str = Field(description="Name of the entity")
44
48
  entity_type: str | None = Field(
45
- default=None, description='Type of the entity. Must be one of the provided types or None'
49
+ default=None,
50
+ description="Type of the entity. Must be one of the provided types or None",
46
51
  )
47
52
 
48
53
 
49
54
  class EntityClassification(BaseModel):
50
55
  entity_classifications: list[EntityClassificationTriple] = Field(
51
- ..., description='List of entities classification triples.'
56
+ ..., description="List of entities classification triples."
52
57
  )
53
58
 
54
59
 
55
60
  class EntitySummary(BaseModel):
56
61
  summary: str = Field(
57
62
  ...,
58
- description='Summary containing the important information about the entity. Under 250 words',
63
+ description="Summary containing the important information about the entity. Under 8 sentences.",
59
64
  )
60
65
 
61
66
 
@@ -123,8 +128,8 @@ reference entities. Only extract distinct entities from the CURRENT MESSAGE. Don
123
128
  {context['custom_prompt']}
124
129
  """
125
130
  return [
126
- Message(role='system', content=sys_prompt),
127
- Message(role='user', content=user_prompt),
131
+ Message(role="system", content=sys_prompt),
132
+ Message(role="user", content=user_prompt),
128
133
  ]
129
134
 
130
135
 
@@ -156,8 +161,8 @@ Guidelines:
156
161
  3. Do NOT extract any properties that contain dates
157
162
  """
158
163
  return [
159
- Message(role='system', content=sys_prompt),
160
- Message(role='user', content=user_prompt),
164
+ Message(role="system", content=sys_prompt),
165
+ Message(role="user", content=user_prompt),
161
166
  ]
162
167
 
163
168
 
@@ -187,8 +192,8 @@ Guidelines:
187
192
  4. Be as explicit as possible in your node names, using full names and avoiding abbreviations.
188
193
  """
189
194
  return [
190
- Message(role='system', content=sys_prompt),
191
- Message(role='user', content=user_prompt),
195
+ Message(role="system", content=sys_prompt),
196
+ Message(role="user", content=user_prompt),
192
197
  ]
193
198
 
194
199
 
@@ -211,8 +216,8 @@ Given the above previous messages, current message, and list of extracted entiti
211
216
  extracted.
212
217
  """
213
218
  return [
214
- Message(role='system', content=sys_prompt),
215
- Message(role='user', content=user_prompt),
219
+ Message(role="system", content=sys_prompt),
220
+ Message(role="user", content=user_prompt),
216
221
  ]
217
222
 
218
223
 
@@ -243,19 +248,19 @@ def classify_nodes(context: dict[str, Any]) -> list[Message]:
243
248
  3. If none of the provided entity types accurately classify an extracted node, the type should be set to None
244
249
  """
245
250
  return [
246
- Message(role='system', content=sys_prompt),
247
- Message(role='user', content=user_prompt),
251
+ Message(role="system", content=sys_prompt),
252
+ Message(role="user", content=user_prompt),
248
253
  ]
249
254
 
250
255
 
251
256
  def extract_attributes(context: dict[str, Any]) -> list[Message]:
252
257
  return [
253
258
  Message(
254
- role='system',
255
- content='You are a helpful assistant that extracts entity properties from the provided text.',
259
+ role="system",
260
+ content="You are a helpful assistant that extracts entity properties from the provided text.",
256
261
  ),
257
262
  Message(
258
- role='user',
263
+ role="user",
259
264
  content=f"""
260
265
 
261
266
  <MESSAGES>
@@ -281,11 +286,11 @@ def extract_attributes(context: dict[str, Any]) -> list[Message]:
281
286
  def extract_summary(context: dict[str, Any]) -> list[Message]:
282
287
  return [
283
288
  Message(
284
- role='system',
285
- content='You are a helpful assistant that extracts entity summaries from the provided text.',
289
+ role="system",
290
+ content="You are a helpful assistant that extracts entity summaries from the provided text.",
286
291
  ),
287
292
  Message(
288
- role='user',
293
+ role="user",
289
294
  content=f"""
290
295
 
291
296
  <MESSAGES>
@@ -300,7 +305,7 @@ def extract_summary(context: dict[str, Any]) -> list[Message]:
300
305
  1. Do not hallucinate entity summary information if they cannot be found in the current context.
301
306
  2. Only use the provided MESSAGES and ENTITY to set attribute values.
302
307
  3. The summary attribute represents a summary of the ENTITY, and should be updated with new information about the Entity from the MESSAGES.
303
- Summaries must be no longer than 250 words.
308
+ 4. Keep the summary concise and to the point. SUMMARIES MUST BE LESS THAN 8 SENTENCES.
304
309
 
305
310
  <ENTITY>
306
311
  {context['node']}
@@ -311,11 +316,11 @@ def extract_summary(context: dict[str, Any]) -> list[Message]:
311
316
 
312
317
 
313
318
  versions: Versions = {
314
- 'extract_message': extract_message,
315
- 'extract_json': extract_json,
316
- 'extract_text': extract_text,
317
- 'reflexion': reflexion,
318
- 'extract_summary': extract_summary,
319
- 'classify_nodes': classify_nodes,
320
- 'extract_attributes': extract_attributes,
319
+ "extract_message": extract_message,
320
+ "extract_json": extract_json,
321
+ "extract_text": extract_text,
322
+ "reflexion": reflexion,
323
+ "extract_summary": extract_summary,
324
+ "classify_nodes": classify_nodes,
325
+ "extract_attributes": extract_attributes,
321
326
  }
@@ -25,12 +25,14 @@ from .prompt_helpers import to_prompt_json
25
25
  class Summary(BaseModel):
26
26
  summary: str = Field(
27
27
  ...,
28
- description='Summary containing the important information about the entity. Under 250 words',
28
+ description="Summary containing the important information about the entity. Under 8 sentences",
29
29
  )
30
30
 
31
31
 
32
32
  class SummaryDescription(BaseModel):
33
- description: str = Field(..., description='One sentence description of the provided summary')
33
+ description: str = Field(
34
+ ..., description="One sentence description of the provided summary"
35
+ )
34
36
 
35
37
 
36
38
  class Prompt(Protocol):
@@ -48,15 +50,15 @@ class Versions(TypedDict):
48
50
  def summarize_pair(context: dict[str, Any]) -> list[Message]:
49
51
  return [
50
52
  Message(
51
- role='system',
52
- content='You are a helpful assistant that combines summaries.',
53
+ role="system",
54
+ content="You are a helpful assistant that combines summaries.",
53
55
  ),
54
56
  Message(
55
- role='user',
57
+ role="user",
56
58
  content=f"""
57
59
  Synthesize the information from the following two summaries into a single succinct summary.
58
60
 
59
- Summaries must be under 250 words.
61
+ IMPORTANT: Keep the summary concise and to the point. SUMMARIES MUST BE LESS THAN 8 SENTENCES.
60
62
 
61
63
  Summaries:
62
64
  {to_prompt_json(context['node_summaries'], indent=2)}
@@ -68,11 +70,11 @@ def summarize_pair(context: dict[str, Any]) -> list[Message]:
68
70
  def summarize_context(context: dict[str, Any]) -> list[Message]:
69
71
  return [
70
72
  Message(
71
- role='system',
72
- content='You are a helpful assistant that extracts entity properties from the provided text.',
73
+ role="system",
74
+ content="You are a helpful assistant that generates a summary and attributes from provided text.",
73
75
  ),
74
76
  Message(
75
- role='user',
77
+ role="user",
76
78
  content=f"""
77
79
 
78
80
  <MESSAGES>
@@ -82,7 +84,7 @@ def summarize_context(context: dict[str, Any]) -> list[Message]:
82
84
 
83
85
  Given the above MESSAGES and the following ENTITY name, create a summary for the ENTITY. Your summary must only use
84
86
  information from the provided MESSAGES. Your summary should also only contain information relevant to the
85
- provided ENTITY. Summaries must be under 250 words.
87
+ provided ENTITY.
86
88
 
87
89
  In addition, extract any values for the provided entity properties based on their descriptions.
88
90
  If the value of the entity property cannot be found in the current context, set the value of the property to the Python value None.
@@ -90,6 +92,7 @@ def summarize_context(context: dict[str, Any]) -> list[Message]:
90
92
  Guidelines:
91
93
  1. Do not hallucinate entity property values if they cannot be found in the current context.
92
94
  2. Only use the provided messages, entity, and entity context to set attribute values.
95
+ 3. Keep the summary concise and to the point. SUMMARIES MUST BE LESS THAN 8 SENTENCES.
93
96
 
94
97
  <ENTITY>
95
98
  {context['node_name']}
@@ -110,14 +113,14 @@ def summarize_context(context: dict[str, Any]) -> list[Message]:
110
113
  def summary_description(context: dict[str, Any]) -> list[Message]:
111
114
  return [
112
115
  Message(
113
- role='system',
114
- content='You are a helpful assistant that describes provided contents in a single sentence.',
116
+ role="system",
117
+ content="You are a helpful assistant that describes provided contents in a single sentence.",
115
118
  ),
116
119
  Message(
117
- role='user',
120
+ role="user",
118
121
  content=f"""
119
122
  Create a short one sentence description of the summary that explains what kind of information is summarized.
120
- Summaries must be under 250 words.
123
+ Summaries must be under 8 sentences.
121
124
 
122
125
  Summary:
123
126
  {to_prompt_json(context['summary'], indent=2)}
@@ -127,7 +130,7 @@ def summary_description(context: dict[str, Any]) -> list[Message]:
127
130
 
128
131
 
129
132
  versions: Versions = {
130
- 'summarize_pair': summarize_pair,
131
- 'summarize_context': summarize_context,
132
- 'summary_description': summary_description,
133
+ "summarize_pair": summarize_pair,
134
+ "summarize_context": summarize_context,
135
+ "summary_description": summary_description,
133
136
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graphiti-core
3
- Version: 0.22.0rc0
3
+ Version: 0.22.0rc1
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
@@ -48,12 +48,12 @@ graphiti_core/prompts/dedupe_nodes.py,sha256=YNNo19Cq8koLVoLCafpjYJOy5nmRZ-tEWhv
48
48
  graphiti_core/prompts/eval.py,sha256=GWFkfZoPfY8U7mV8Ngd_5a2S2fHS7KjajChntxv1UEY,5360
49
49
  graphiti_core/prompts/extract_edge_dates.py,sha256=3Drs3CmvP0gJN5BidWSxrNvLet3HPoTybU3BUIAoc0Y,4218
50
50
  graphiti_core/prompts/extract_edges.py,sha256=-yOIvCPwxIAXeqYpNCzouE6i3WfdsexzRXFmcXpQpAg,7113
51
- graphiti_core/prompts/extract_nodes.py,sha256=orbZiCqVL-4RNlckpUaQIq7Yb2JsIwT8e3ZAHRAEiLM,11281
51
+ graphiti_core/prompts/extract_nodes.py,sha256=jMD-XRi4U3kjp9smHtA_kvnMBGWBfpBoKc45IoTIZs0,11360
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
54
54
  graphiti_core/prompts/models.py,sha256=NgxdbPHJpBEcpbXovKyScgpBc73Q-GIW-CBDlBtDjto,894
55
55
  graphiti_core/prompts/prompt_helpers.py,sha256=dpWbB8IYAqAZoU5qBx896jozKiQJTng4dGzWewZ_s4c,814
56
- graphiti_core/prompts/summarize_nodes.py,sha256=p_TNDG66uY71QNDo9hyk4crAfyzyEKlb4_lML3fxeWU,4197
56
+ graphiti_core/prompts/summarize_nodes.py,sha256=7WnjRgYo1Z9bfnUWaUUXbiaLqygGLpemvB5inhhq44Y,4340
57
57
  graphiti_core/search/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
58
  graphiti_core/search/search.py,sha256=2kj7fybSFv6Fnf_cfEUhJhrpfzNtmkPPZ0hV3BQCDqg,18387
59
59
  graphiti_core/search/search_config.py,sha256=v_rUHsu1yo5OuPfEm21lSuXexQs-o8qYwSSemW2QWhU,4165
@@ -75,7 +75,7 @@ graphiti_core/utils/maintenance/node_operations.py,sha256=ARng4x_pCpfA3g4bM0BncO
75
75
  graphiti_core/utils/maintenance/temporal_operations.py,sha256=wq1I4kqeIoswit6sPohug91FEwrGaVnJ06g1vkJjSLY,3442
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.22.0rc0.dist-info/METADATA,sha256=uYwosUYjFpfCidLgBO8OuZ_P2fcrwNkRIkXn33lIwXk,27084
79
- graphiti_core-0.22.0rc0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
80
- graphiti_core-0.22.0rc0.dist-info/licenses/LICENSE,sha256=KCUwCyDXuVEgmDWkozHyniRyWjnWUWjkuDHfU6o3JlA,11325
81
- graphiti_core-0.22.0rc0.dist-info/RECORD,,
78
+ graphiti_core-0.22.0rc1.dist-info/METADATA,sha256=NlIXn-TmrQ-_u-6CI6I7sEC7ioBKvQIKEl0oyqRq4YM,27084
79
+ graphiti_core-0.22.0rc1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
80
+ graphiti_core-0.22.0rc1.dist-info/licenses/LICENSE,sha256=KCUwCyDXuVEgmDWkozHyniRyWjnWUWjkuDHfU6o3JlA,11325
81
+ graphiti_core-0.22.0rc1.dist-info/RECORD,,