graphiti-core 0.17.11__py3-none-any.whl → 0.18.0__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/graphiti.py +1 -1
- graphiti_core/search/search.py +44 -32
- graphiti_core/search/search_config.py +8 -4
- graphiti_core/search/search_utils.py +32 -22
- {graphiti_core-0.17.11.dist-info → graphiti_core-0.18.0.dist-info}/METADATA +1 -1
- {graphiti_core-0.17.11.dist-info → graphiti_core-0.18.0.dist-info}/RECORD +8 -8
- {graphiti_core-0.17.11.dist-info → graphiti_core-0.18.0.dist-info}/WHEEL +0 -0
- {graphiti_core-0.17.11.dist-info → graphiti_core-0.18.0.dist-info}/licenses/LICENSE +0 -0
graphiti_core/graphiti.py
CHANGED
|
@@ -959,7 +959,7 @@ class Graphiti:
|
|
|
959
959
|
|
|
960
960
|
nodes = await get_mentioned_nodes(self.driver, episodes)
|
|
961
961
|
|
|
962
|
-
return SearchResults(edges=edges, nodes=nodes
|
|
962
|
+
return SearchResults(edges=edges, nodes=nodes)
|
|
963
963
|
|
|
964
964
|
async def add_triplet(self, source_node: EntityNode, edge: EntityEdge, target_node: EntityNode):
|
|
965
965
|
if source_node.name_embedding is None:
|
graphiti_core/search/search.py
CHANGED
|
@@ -80,12 +80,7 @@ async def search(
|
|
|
80
80
|
cross_encoder = clients.cross_encoder
|
|
81
81
|
|
|
82
82
|
if query.strip() == '':
|
|
83
|
-
return SearchResults(
|
|
84
|
-
edges=[],
|
|
85
|
-
nodes=[],
|
|
86
|
-
episodes=[],
|
|
87
|
-
communities=[],
|
|
88
|
-
)
|
|
83
|
+
return SearchResults()
|
|
89
84
|
query_vector = (
|
|
90
85
|
query_vector
|
|
91
86
|
if query_vector is not None
|
|
@@ -94,7 +89,12 @@ async def search(
|
|
|
94
89
|
|
|
95
90
|
# if group_ids is empty, set it to None
|
|
96
91
|
group_ids = group_ids if group_ids and group_ids != [''] else None
|
|
97
|
-
|
|
92
|
+
(
|
|
93
|
+
(edges, edge_reranker_scores),
|
|
94
|
+
(nodes, node_reranker_scores),
|
|
95
|
+
(episodes, episode_reranker_scores),
|
|
96
|
+
(communities, community_reranker_scores),
|
|
97
|
+
) = await semaphore_gather(
|
|
98
98
|
edge_search(
|
|
99
99
|
driver,
|
|
100
100
|
cross_encoder,
|
|
@@ -146,9 +146,13 @@ async def search(
|
|
|
146
146
|
|
|
147
147
|
results = SearchResults(
|
|
148
148
|
edges=edges,
|
|
149
|
+
edge_reranker_scores=edge_reranker_scores,
|
|
149
150
|
nodes=nodes,
|
|
151
|
+
node_reranker_scores=node_reranker_scores,
|
|
150
152
|
episodes=episodes,
|
|
153
|
+
episode_reranker_scores=episode_reranker_scores,
|
|
151
154
|
communities=communities,
|
|
155
|
+
community_reranker_scores=community_reranker_scores,
|
|
152
156
|
)
|
|
153
157
|
|
|
154
158
|
latency = (time() - start) * 1000
|
|
@@ -170,9 +174,9 @@ async def edge_search(
|
|
|
170
174
|
bfs_origin_node_uuids: list[str] | None = None,
|
|
171
175
|
limit=DEFAULT_SEARCH_LIMIT,
|
|
172
176
|
reranker_min_score: float = 0,
|
|
173
|
-
) -> list[EntityEdge]:
|
|
177
|
+
) -> tuple[list[EntityEdge], list[float]]:
|
|
174
178
|
if config is None:
|
|
175
|
-
return []
|
|
179
|
+
return [], []
|
|
176
180
|
search_results: list[list[EntityEdge]] = list(
|
|
177
181
|
await semaphore_gather(
|
|
178
182
|
*[
|
|
@@ -215,15 +219,16 @@ async def edge_search(
|
|
|
215
219
|
edge_uuid_map = {edge.uuid: edge for result in search_results for edge in result}
|
|
216
220
|
|
|
217
221
|
reranked_uuids: list[str] = []
|
|
222
|
+
edge_scores: list[float] = []
|
|
218
223
|
if config.reranker == EdgeReranker.rrf or config.reranker == EdgeReranker.episode_mentions:
|
|
219
224
|
search_result_uuids = [[edge.uuid for edge in result] for result in search_results]
|
|
220
225
|
|
|
221
|
-
reranked_uuids = rrf(search_result_uuids, min_score=reranker_min_score)
|
|
226
|
+
reranked_uuids, edge_scores = rrf(search_result_uuids, min_score=reranker_min_score)
|
|
222
227
|
elif config.reranker == EdgeReranker.mmr:
|
|
223
228
|
search_result_uuids_and_vectors = await get_embeddings_for_edges(
|
|
224
229
|
driver, list(edge_uuid_map.values())
|
|
225
230
|
)
|
|
226
|
-
reranked_uuids = maximal_marginal_relevance(
|
|
231
|
+
reranked_uuids, edge_scores = maximal_marginal_relevance(
|
|
227
232
|
query_vector,
|
|
228
233
|
search_result_uuids_and_vectors,
|
|
229
234
|
config.mmr_lambda,
|
|
@@ -235,12 +240,13 @@ async def edge_search(
|
|
|
235
240
|
reranked_uuids = [
|
|
236
241
|
fact_to_uuid_map[fact] for fact, score in reranked_facts if score >= reranker_min_score
|
|
237
242
|
]
|
|
243
|
+
edge_scores = [score for _, score in reranked_facts if score >= reranker_min_score]
|
|
238
244
|
elif config.reranker == EdgeReranker.node_distance:
|
|
239
245
|
if center_node_uuid is None:
|
|
240
246
|
raise SearchRerankerError('No center node provided for Node Distance reranker')
|
|
241
247
|
|
|
242
248
|
# use rrf as a preliminary sort
|
|
243
|
-
sorted_result_uuids = rrf(
|
|
249
|
+
sorted_result_uuids, node_scores = rrf(
|
|
244
250
|
[[edge.uuid for edge in result] for result in search_results],
|
|
245
251
|
min_score=reranker_min_score,
|
|
246
252
|
)
|
|
@@ -253,7 +259,7 @@ async def edge_search(
|
|
|
253
259
|
|
|
254
260
|
source_uuids = [source_node_uuid for source_node_uuid in source_to_edge_uuid_map]
|
|
255
261
|
|
|
256
|
-
reranked_node_uuids = await node_distance_reranker(
|
|
262
|
+
reranked_node_uuids, edge_scores = await node_distance_reranker(
|
|
257
263
|
driver, source_uuids, center_node_uuid, min_score=reranker_min_score
|
|
258
264
|
)
|
|
259
265
|
|
|
@@ -265,7 +271,7 @@ async def edge_search(
|
|
|
265
271
|
if config.reranker == EdgeReranker.episode_mentions:
|
|
266
272
|
reranked_edges.sort(reverse=True, key=lambda edge: len(edge.episodes))
|
|
267
273
|
|
|
268
|
-
return reranked_edges[:limit]
|
|
274
|
+
return reranked_edges[:limit], edge_scores[:limit]
|
|
269
275
|
|
|
270
276
|
|
|
271
277
|
async def node_search(
|
|
@@ -280,9 +286,9 @@ async def node_search(
|
|
|
280
286
|
bfs_origin_node_uuids: list[str] | None = None,
|
|
281
287
|
limit=DEFAULT_SEARCH_LIMIT,
|
|
282
288
|
reranker_min_score: float = 0,
|
|
283
|
-
) -> list[EntityNode]:
|
|
289
|
+
) -> tuple[list[EntityNode], list[float]]:
|
|
284
290
|
if config is None:
|
|
285
|
-
return []
|
|
291
|
+
return [], []
|
|
286
292
|
search_results: list[list[EntityNode]] = list(
|
|
287
293
|
await semaphore_gather(
|
|
288
294
|
*[
|
|
@@ -319,14 +325,15 @@ async def node_search(
|
|
|
319
325
|
node_uuid_map = {node.uuid: node for result in search_results for node in result}
|
|
320
326
|
|
|
321
327
|
reranked_uuids: list[str] = []
|
|
328
|
+
node_scores: list[float] = []
|
|
322
329
|
if config.reranker == NodeReranker.rrf:
|
|
323
|
-
reranked_uuids = rrf(search_result_uuids, min_score=reranker_min_score)
|
|
330
|
+
reranked_uuids, node_scores = rrf(search_result_uuids, min_score=reranker_min_score)
|
|
324
331
|
elif config.reranker == NodeReranker.mmr:
|
|
325
332
|
search_result_uuids_and_vectors = await get_embeddings_for_nodes(
|
|
326
333
|
driver, list(node_uuid_map.values())
|
|
327
334
|
)
|
|
328
335
|
|
|
329
|
-
reranked_uuids = maximal_marginal_relevance(
|
|
336
|
+
reranked_uuids, node_scores = maximal_marginal_relevance(
|
|
330
337
|
query_vector,
|
|
331
338
|
search_result_uuids_and_vectors,
|
|
332
339
|
config.mmr_lambda,
|
|
@@ -341,23 +348,24 @@ async def node_search(
|
|
|
341
348
|
for name, score in reranked_node_names
|
|
342
349
|
if score >= reranker_min_score
|
|
343
350
|
]
|
|
351
|
+
node_scores = [score for _, score in reranked_node_names if score >= reranker_min_score]
|
|
344
352
|
elif config.reranker == NodeReranker.episode_mentions:
|
|
345
|
-
reranked_uuids = await episode_mentions_reranker(
|
|
353
|
+
reranked_uuids, node_scores = await episode_mentions_reranker(
|
|
346
354
|
driver, search_result_uuids, min_score=reranker_min_score
|
|
347
355
|
)
|
|
348
356
|
elif config.reranker == NodeReranker.node_distance:
|
|
349
357
|
if center_node_uuid is None:
|
|
350
358
|
raise SearchRerankerError('No center node provided for Node Distance reranker')
|
|
351
|
-
reranked_uuids = await node_distance_reranker(
|
|
359
|
+
reranked_uuids, node_scores = await node_distance_reranker(
|
|
352
360
|
driver,
|
|
353
|
-
rrf(search_result_uuids, min_score=reranker_min_score),
|
|
361
|
+
rrf(search_result_uuids, min_score=reranker_min_score)[0],
|
|
354
362
|
center_node_uuid,
|
|
355
363
|
min_score=reranker_min_score,
|
|
356
364
|
)
|
|
357
365
|
|
|
358
366
|
reranked_nodes = [node_uuid_map[uuid] for uuid in reranked_uuids]
|
|
359
367
|
|
|
360
|
-
return reranked_nodes[:limit]
|
|
368
|
+
return reranked_nodes[:limit], node_scores[:limit]
|
|
361
369
|
|
|
362
370
|
|
|
363
371
|
async def episode_search(
|
|
@@ -370,9 +378,9 @@ async def episode_search(
|
|
|
370
378
|
search_filter: SearchFilters,
|
|
371
379
|
limit=DEFAULT_SEARCH_LIMIT,
|
|
372
380
|
reranker_min_score: float = 0,
|
|
373
|
-
) -> list[EpisodicNode]:
|
|
381
|
+
) -> tuple[list[EpisodicNode], list[float]]:
|
|
374
382
|
if config is None:
|
|
375
|
-
return []
|
|
383
|
+
return [], []
|
|
376
384
|
search_results: list[list[EpisodicNode]] = list(
|
|
377
385
|
await semaphore_gather(
|
|
378
386
|
*[
|
|
@@ -385,12 +393,13 @@ async def episode_search(
|
|
|
385
393
|
episode_uuid_map = {episode.uuid: episode for result in search_results for episode in result}
|
|
386
394
|
|
|
387
395
|
reranked_uuids: list[str] = []
|
|
396
|
+
episode_scores: list[float] = []
|
|
388
397
|
if config.reranker == EpisodeReranker.rrf:
|
|
389
|
-
reranked_uuids = rrf(search_result_uuids, min_score=reranker_min_score)
|
|
398
|
+
reranked_uuids, episode_scores = rrf(search_result_uuids, min_score=reranker_min_score)
|
|
390
399
|
|
|
391
400
|
elif config.reranker == EpisodeReranker.cross_encoder:
|
|
392
401
|
# use rrf as a preliminary reranker
|
|
393
|
-
rrf_result_uuids = rrf(search_result_uuids, min_score=reranker_min_score)
|
|
402
|
+
rrf_result_uuids, episode_scores = rrf(search_result_uuids, min_score=reranker_min_score)
|
|
394
403
|
rrf_results = [episode_uuid_map[uuid] for uuid in rrf_result_uuids][:limit]
|
|
395
404
|
|
|
396
405
|
content_to_uuid_map = {episode.content: episode.uuid for episode in rrf_results}
|
|
@@ -401,10 +410,11 @@ async def episode_search(
|
|
|
401
410
|
for content, score in reranked_contents
|
|
402
411
|
if score >= reranker_min_score
|
|
403
412
|
]
|
|
413
|
+
episode_scores = [score for _, score in reranked_contents if score >= reranker_min_score]
|
|
404
414
|
|
|
405
415
|
reranked_episodes = [episode_uuid_map[uuid] for uuid in reranked_uuids]
|
|
406
416
|
|
|
407
|
-
return reranked_episodes[:limit]
|
|
417
|
+
return reranked_episodes[:limit], episode_scores[:limit]
|
|
408
418
|
|
|
409
419
|
|
|
410
420
|
async def community_search(
|
|
@@ -416,9 +426,9 @@ async def community_search(
|
|
|
416
426
|
config: CommunitySearchConfig | None,
|
|
417
427
|
limit=DEFAULT_SEARCH_LIMIT,
|
|
418
428
|
reranker_min_score: float = 0,
|
|
419
|
-
) -> list[CommunityNode]:
|
|
429
|
+
) -> tuple[list[CommunityNode], list[float]]:
|
|
420
430
|
if config is None:
|
|
421
|
-
return []
|
|
431
|
+
return [], []
|
|
422
432
|
|
|
423
433
|
search_results: list[list[CommunityNode]] = list(
|
|
424
434
|
await semaphore_gather(
|
|
@@ -437,14 +447,15 @@ async def community_search(
|
|
|
437
447
|
}
|
|
438
448
|
|
|
439
449
|
reranked_uuids: list[str] = []
|
|
450
|
+
community_scores: list[float] = []
|
|
440
451
|
if config.reranker == CommunityReranker.rrf:
|
|
441
|
-
reranked_uuids = rrf(search_result_uuids, min_score=reranker_min_score)
|
|
452
|
+
reranked_uuids, community_scores = rrf(search_result_uuids, min_score=reranker_min_score)
|
|
442
453
|
elif config.reranker == CommunityReranker.mmr:
|
|
443
454
|
search_result_uuids_and_vectors = await get_embeddings_for_communities(
|
|
444
455
|
driver, list(community_uuid_map.values())
|
|
445
456
|
)
|
|
446
457
|
|
|
447
|
-
reranked_uuids = maximal_marginal_relevance(
|
|
458
|
+
reranked_uuids, community_scores = maximal_marginal_relevance(
|
|
448
459
|
query_vector, search_result_uuids_and_vectors, config.mmr_lambda, reranker_min_score
|
|
449
460
|
)
|
|
450
461
|
elif config.reranker == CommunityReranker.cross_encoder:
|
|
@@ -453,7 +464,8 @@ async def community_search(
|
|
|
453
464
|
reranked_uuids = [
|
|
454
465
|
name_to_uuid_map[name] for name, score in reranked_nodes if score >= reranker_min_score
|
|
455
466
|
]
|
|
467
|
+
community_scores = [score for _, score in reranked_nodes if score >= reranker_min_score]
|
|
456
468
|
|
|
457
469
|
reranked_communities = [community_uuid_map[uuid] for uuid in reranked_uuids]
|
|
458
470
|
|
|
459
|
-
return reranked_communities[:limit]
|
|
471
|
+
return reranked_communities[:limit], community_scores[:limit]
|
|
@@ -119,7 +119,11 @@ class SearchConfig(BaseModel):
|
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
class SearchResults(BaseModel):
|
|
122
|
-
edges: list[EntityEdge]
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
edges: list[EntityEdge] = Field(default_factory=list)
|
|
123
|
+
edge_reranker_scores: list[float] = Field(default_factory=list)
|
|
124
|
+
nodes: list[EntityNode] = Field(default_factory=list)
|
|
125
|
+
node_reranker_scores: list[float] = Field(default_factory=list)
|
|
126
|
+
episodes: list[EpisodicNode] = Field(default_factory=list)
|
|
127
|
+
episode_reranker_scores: list[float] = Field(default_factory=list)
|
|
128
|
+
communities: list[CommunityNode] = Field(default_factory=list)
|
|
129
|
+
community_reranker_scores: list[float] = Field(default_factory=list)
|
|
@@ -294,13 +294,13 @@ async def edge_bfs_search(
|
|
|
294
294
|
|
|
295
295
|
query = (
|
|
296
296
|
"""
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
297
|
+
UNWIND $bfs_origin_node_uuids AS origin_uuid
|
|
298
|
+
MATCH path = (origin:Entity|Episodic {uuid: origin_uuid})-[:RELATES_TO|MENTIONS]->{1,3}(n:Entity)
|
|
299
|
+
UNWIND relationships(path) AS rel
|
|
300
|
+
MATCH (n:Entity)-[r:RELATES_TO]-(m:Entity)
|
|
301
|
+
WHERE r.uuid = rel.uuid
|
|
302
|
+
AND r.group_id IN $group_ids
|
|
303
|
+
"""
|
|
304
304
|
+ filter_query
|
|
305
305
|
+ """
|
|
306
306
|
RETURN DISTINCT
|
|
@@ -445,11 +445,11 @@ async def node_bfs_search(
|
|
|
445
445
|
|
|
446
446
|
query = (
|
|
447
447
|
"""
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
448
|
+
UNWIND $bfs_origin_node_uuids AS origin_uuid
|
|
449
|
+
MATCH (origin:Entity|Episodic {uuid: origin_uuid})-[:RELATES_TO|MENTIONS]->{1,3}(n:Entity)
|
|
450
|
+
WHERE n.group_id = origin.group_id
|
|
451
|
+
AND origin.group_id IN $group_ids
|
|
452
|
+
"""
|
|
453
453
|
+ filter_query
|
|
454
454
|
+ ENTITY_NODE_RETURN
|
|
455
455
|
+ """
|
|
@@ -672,7 +672,7 @@ async def hybrid_node_search(
|
|
|
672
672
|
}
|
|
673
673
|
result_uuids = [[node.uuid for node in result] for result in results]
|
|
674
674
|
|
|
675
|
-
ranked_uuids = rrf(result_uuids)
|
|
675
|
+
ranked_uuids, _ = rrf(result_uuids)
|
|
676
676
|
|
|
677
677
|
relevant_nodes: list[EntityNode] = [node_uuid_map[uuid] for uuid in ranked_uuids]
|
|
678
678
|
|
|
@@ -914,7 +914,9 @@ async def get_edge_invalidation_candidates(
|
|
|
914
914
|
|
|
915
915
|
|
|
916
916
|
# takes in a list of rankings of uuids
|
|
917
|
-
def rrf(
|
|
917
|
+
def rrf(
|
|
918
|
+
results: list[list[str]], rank_const=1, min_score: float = 0
|
|
919
|
+
) -> tuple[list[str], list[float]]:
|
|
918
920
|
scores: dict[str, float] = defaultdict(float)
|
|
919
921
|
for result in results:
|
|
920
922
|
for i, uuid in enumerate(result):
|
|
@@ -925,7 +927,9 @@ def rrf(results: list[list[str]], rank_const=1, min_score: float = 0) -> list[st
|
|
|
925
927
|
|
|
926
928
|
sorted_uuids = [term[0] for term in scored_uuids]
|
|
927
929
|
|
|
928
|
-
return [uuid for uuid in sorted_uuids if scores[uuid] >= min_score]
|
|
930
|
+
return [uuid for uuid in sorted_uuids if scores[uuid] >= min_score], [
|
|
931
|
+
scores[uuid] for uuid in sorted_uuids if scores[uuid] >= min_score
|
|
932
|
+
]
|
|
929
933
|
|
|
930
934
|
|
|
931
935
|
async def node_distance_reranker(
|
|
@@ -933,7 +937,7 @@ async def node_distance_reranker(
|
|
|
933
937
|
node_uuids: list[str],
|
|
934
938
|
center_node_uuid: str,
|
|
935
939
|
min_score: float = 0,
|
|
936
|
-
) -> list[str]:
|
|
940
|
+
) -> tuple[list[str], list[float]]:
|
|
937
941
|
# filter out node_uuid center node node uuid
|
|
938
942
|
filtered_uuids = list(filter(lambda node_uuid: node_uuid != center_node_uuid, node_uuids))
|
|
939
943
|
scores: dict[str, float] = {center_node_uuid: 0.0}
|
|
@@ -970,14 +974,16 @@ async def node_distance_reranker(
|
|
|
970
974
|
scores[center_node_uuid] = 0.1
|
|
971
975
|
filtered_uuids = [center_node_uuid] + filtered_uuids
|
|
972
976
|
|
|
973
|
-
return [uuid for uuid in filtered_uuids if (1 / scores[uuid]) >= min_score]
|
|
977
|
+
return [uuid for uuid in filtered_uuids if (1 / scores[uuid]) >= min_score], [
|
|
978
|
+
1 / scores[uuid] for uuid in filtered_uuids if (1 / scores[uuid]) >= min_score
|
|
979
|
+
]
|
|
974
980
|
|
|
975
981
|
|
|
976
982
|
async def episode_mentions_reranker(
|
|
977
983
|
driver: GraphDriver, node_uuids: list[list[str]], min_score: float = 0
|
|
978
|
-
) -> list[str]:
|
|
984
|
+
) -> tuple[list[str], list[float]]:
|
|
979
985
|
# use rrf as a preliminary ranker
|
|
980
|
-
sorted_uuids = rrf(node_uuids)
|
|
986
|
+
sorted_uuids, _ = rrf(node_uuids)
|
|
981
987
|
scores: dict[str, float] = {}
|
|
982
988
|
|
|
983
989
|
# Find the shortest path to center node
|
|
@@ -998,7 +1004,9 @@ async def episode_mentions_reranker(
|
|
|
998
1004
|
# rerank on shortest distance
|
|
999
1005
|
sorted_uuids.sort(key=lambda cur_uuid: scores[cur_uuid])
|
|
1000
1006
|
|
|
1001
|
-
return [uuid for uuid in sorted_uuids if scores[uuid] >= min_score]
|
|
1007
|
+
return [uuid for uuid in sorted_uuids if scores[uuid] >= min_score], [
|
|
1008
|
+
scores[uuid] for uuid in sorted_uuids if scores[uuid] >= min_score
|
|
1009
|
+
]
|
|
1002
1010
|
|
|
1003
1011
|
|
|
1004
1012
|
def maximal_marginal_relevance(
|
|
@@ -1006,7 +1014,7 @@ def maximal_marginal_relevance(
|
|
|
1006
1014
|
candidates: dict[str, list[float]],
|
|
1007
1015
|
mmr_lambda: float = DEFAULT_MMR_LAMBDA,
|
|
1008
1016
|
min_score: float = -2.0,
|
|
1009
|
-
) -> list[str]:
|
|
1017
|
+
) -> tuple[list[str], list[float]]:
|
|
1010
1018
|
start = time()
|
|
1011
1019
|
query_array = np.array(query_vector)
|
|
1012
1020
|
candidate_arrays: dict[str, NDArray] = {}
|
|
@@ -1037,7 +1045,9 @@ def maximal_marginal_relevance(
|
|
|
1037
1045
|
end = time()
|
|
1038
1046
|
logger.debug(f'Completed MMR reranking in {(end - start) * 1000} ms')
|
|
1039
1047
|
|
|
1040
|
-
return [uuid for uuid in uuids if mmr_scores[uuid] >= min_score]
|
|
1048
|
+
return [uuid for uuid in uuids if mmr_scores[uuid] >= min_score], [
|
|
1049
|
+
mmr_scores[uuid] for uuid in uuids if mmr_scores[uuid] >= min_score
|
|
1050
|
+
]
|
|
1041
1051
|
|
|
1042
1052
|
|
|
1043
1053
|
async def get_embeddings_for_nodes(
|
|
@@ -2,7 +2,7 @@ graphiti_core/__init__.py,sha256=e5SWFkRiaUwfprYIeIgVIh7JDedNiloZvd3roU-0aDY,55
|
|
|
2
2
|
graphiti_core/edges.py,sha256=-SSP6rhk8Dl8LwUZ08GHymJTT5pNDtzb3BV-6z1fBYY,16030
|
|
3
3
|
graphiti_core/errors.py,sha256=cH_v9TPgEPeQE6GFOHIg5TvejpUCBddGarMY2Whxbwc,2707
|
|
4
4
|
graphiti_core/graph_queries.py,sha256=KfWDp8xDnPa9bcHskw8NeMpeeHBtZWBCosVdu1Iwv34,7076
|
|
5
|
-
graphiti_core/graphiti.py,sha256=
|
|
5
|
+
graphiti_core/graphiti.py,sha256=fNBDDOtChAG9U0t4nFD1Il882mMlr2TedeTzMuvNfnM,39568
|
|
6
6
|
graphiti_core/graphiti_types.py,sha256=rL-9bvnLobunJfXU4hkD6mAj14pofKp_wq8QsFDZwDU,1035
|
|
7
7
|
graphiti_core/helpers.py,sha256=YoMAEhe_aMPz_Cd_t1dnIffNwDpenINJu4URePglt2s,5247
|
|
8
8
|
graphiti_core/nodes.py,sha256=AcqHvhNWyapQwBSuziMvPJ-HnOr4Pv1-OiYsEodJcAA,18613
|
|
@@ -52,12 +52,12 @@ graphiti_core/prompts/models.py,sha256=NgxdbPHJpBEcpbXovKyScgpBc73Q-GIW-CBDlBtDj
|
|
|
52
52
|
graphiti_core/prompts/prompt_helpers.py,sha256=-9TABwIcIQUVHcNANx6wIZd-FT2DgYKyGTfx4IGYq2I,64
|
|
53
53
|
graphiti_core/prompts/summarize_nodes.py,sha256=tbg-AgWlzgFBeImKkZ28h2SpmqfPPqvN2Ol1Q71VF9Y,4146
|
|
54
54
|
graphiti_core/search/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
|
-
graphiti_core/search/search.py,sha256=
|
|
56
|
-
graphiti_core/search/search_config.py,sha256=
|
|
55
|
+
graphiti_core/search/search.py,sha256=u-kTmSu3VlRHYlQhuYsbwDQ-AKKCp3BZ9JZNRv3ttVY,16720
|
|
56
|
+
graphiti_core/search/search_config.py,sha256=v_rUHsu1yo5OuPfEm21lSuXexQs-o8qYwSSemW2QWhU,4165
|
|
57
57
|
graphiti_core/search/search_config_recipes.py,sha256=4GquRphHhJlpXQhAZOySYnCzBWYoTwxlJj44eTOavZQ,7443
|
|
58
58
|
graphiti_core/search/search_filters.py,sha256=cxiFkqB-r7QzVMh8nmujECLhzgsbeCpBHUQqDXnCQ3A,6383
|
|
59
59
|
graphiti_core/search/search_helpers.py,sha256=G5Ceaq5Pfgx0Weelqgeylp_pUHwiBnINaUYsDbURJbE,2636
|
|
60
|
-
graphiti_core/search/search_utils.py,sha256=
|
|
60
|
+
graphiti_core/search/search_utils.py,sha256=nz1Z2HrOt3ay64x_HXaFBPyBNMecyoIqzhc-7Ac0rws,34894
|
|
61
61
|
graphiti_core/telemetry/__init__.py,sha256=5kALLDlU9bb2v19CdN7qVANsJWyfnL9E60J6FFgzm3o,226
|
|
62
62
|
graphiti_core/telemetry/telemetry.py,sha256=47LrzOVBCcZxsYPsnSxWFiztHoxYKKxPwyRX0hnbDGc,3230
|
|
63
63
|
graphiti_core/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -71,7 +71,7 @@ graphiti_core/utils/maintenance/node_operations.py,sha256=ZnopNRTNdBjBotQ2uQiI7E
|
|
|
71
71
|
graphiti_core/utils/maintenance/temporal_operations.py,sha256=mJkw9xLB4W2BsLfC5POr0r-PHWL9SIfNj_l_xu0B5ug,3410
|
|
72
72
|
graphiti_core/utils/maintenance/utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
73
73
|
graphiti_core/utils/ontology_utils/entity_types_utils.py,sha256=QJX5cG0GSSNF_Mm_yrldr69wjVAbN_MxLhOSznz85Hk,1279
|
|
74
|
-
graphiti_core-0.
|
|
75
|
-
graphiti_core-0.
|
|
76
|
-
graphiti_core-0.
|
|
77
|
-
graphiti_core-0.
|
|
74
|
+
graphiti_core-0.18.0.dist-info/METADATA,sha256=dexXmf1OnLDXtkztEYhSDUufywjqUA5mOLWkLB9wqPc,23812
|
|
75
|
+
graphiti_core-0.18.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
76
|
+
graphiti_core-0.18.0.dist-info/licenses/LICENSE,sha256=KCUwCyDXuVEgmDWkozHyniRyWjnWUWjkuDHfU6o3JlA,11325
|
|
77
|
+
graphiti_core-0.18.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|