graphiti-core 0.12.0rc5__py3-none-any.whl → 0.12.2__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/cross_encoder/openai_reranker_client.py +1 -1
- graphiti_core/driver/__init__.py +17 -0
- graphiti_core/driver/driver.py +66 -0
- graphiti_core/driver/falkordb_driver.py +131 -0
- graphiti_core/driver/neo4j_driver.py +61 -0
- graphiti_core/edges.py +26 -26
- graphiti_core/embedder/azure_openai.py +64 -0
- graphiti_core/graph_queries.py +149 -0
- graphiti_core/graphiti.py +21 -8
- graphiti_core/graphiti_types.py +2 -2
- graphiti_core/helpers.py +9 -3
- graphiti_core/llm_client/__init__.py +16 -0
- graphiti_core/llm_client/azure_openai_client.py +73 -0
- graphiti_core/nodes.py +31 -31
- graphiti_core/prompts/dedupe_nodes.py +5 -1
- graphiti_core/prompts/extract_edges.py +2 -0
- graphiti_core/prompts/extract_nodes.py +2 -0
- graphiti_core/search/search.py +6 -10
- graphiti_core/search/search_utils.py +243 -187
- graphiti_core/utils/bulk_utils.py +21 -11
- graphiti_core/utils/maintenance/community_operations.py +6 -7
- graphiti_core/utils/maintenance/edge_operations.py +68 -3
- graphiti_core/utils/maintenance/graph_data_operations.py +13 -42
- graphiti_core/utils/maintenance/node_operations.py +19 -5
- {graphiti_core-0.12.0rc5.dist-info → graphiti_core-0.12.2.dist-info}/METADATA +4 -3
- {graphiti_core-0.12.0rc5.dist-info → graphiti_core-0.12.2.dist-info}/RECORD +28 -21
- {graphiti_core-0.12.0rc5.dist-info → graphiti_core-0.12.2.dist-info}/LICENSE +0 -0
- {graphiti_core-0.12.0rc5.dist-info → graphiti_core-0.12.2.dist-info}/WHEEL +0 -0
graphiti_core/search/search.py
CHANGED
|
@@ -18,9 +18,8 @@ import logging
|
|
|
18
18
|
from collections import defaultdict
|
|
19
19
|
from time import time
|
|
20
20
|
|
|
21
|
-
from neo4j import AsyncDriver
|
|
22
|
-
|
|
23
21
|
from graphiti_core.cross_encoder.client import CrossEncoderClient
|
|
22
|
+
from graphiti_core.driver.driver import GraphDriver
|
|
24
23
|
from graphiti_core.edges import EntityEdge
|
|
25
24
|
from graphiti_core.errors import SearchRerankerError
|
|
26
25
|
from graphiti_core.graphiti_types import GraphitiClients
|
|
@@ -94,7 +93,7 @@ async def search(
|
|
|
94
93
|
)
|
|
95
94
|
|
|
96
95
|
# if group_ids is empty, set it to None
|
|
97
|
-
group_ids = group_ids if group_ids else None
|
|
96
|
+
group_ids = group_ids if group_ids and group_ids != [''] else None
|
|
98
97
|
edges, nodes, episodes, communities = await semaphore_gather(
|
|
99
98
|
edge_search(
|
|
100
99
|
driver,
|
|
@@ -160,7 +159,7 @@ async def search(
|
|
|
160
159
|
|
|
161
160
|
|
|
162
161
|
async def edge_search(
|
|
163
|
-
driver:
|
|
162
|
+
driver: GraphDriver,
|
|
164
163
|
cross_encoder: CrossEncoderClient,
|
|
165
164
|
query: str,
|
|
166
165
|
query_vector: list[float],
|
|
@@ -174,7 +173,6 @@ async def edge_search(
|
|
|
174
173
|
) -> list[EntityEdge]:
|
|
175
174
|
if config is None:
|
|
176
175
|
return []
|
|
177
|
-
|
|
178
176
|
search_results: list[list[EntityEdge]] = list(
|
|
179
177
|
await semaphore_gather(
|
|
180
178
|
*[
|
|
@@ -261,7 +259,7 @@ async def edge_search(
|
|
|
261
259
|
|
|
262
260
|
|
|
263
261
|
async def node_search(
|
|
264
|
-
driver:
|
|
262
|
+
driver: GraphDriver,
|
|
265
263
|
cross_encoder: CrossEncoderClient,
|
|
266
264
|
query: str,
|
|
267
265
|
query_vector: list[float],
|
|
@@ -275,7 +273,6 @@ async def node_search(
|
|
|
275
273
|
) -> list[EntityNode]:
|
|
276
274
|
if config is None:
|
|
277
275
|
return []
|
|
278
|
-
|
|
279
276
|
search_results: list[list[EntityNode]] = list(
|
|
280
277
|
await semaphore_gather(
|
|
281
278
|
*[
|
|
@@ -344,7 +341,7 @@ async def node_search(
|
|
|
344
341
|
|
|
345
342
|
|
|
346
343
|
async def episode_search(
|
|
347
|
-
driver:
|
|
344
|
+
driver: GraphDriver,
|
|
348
345
|
cross_encoder: CrossEncoderClient,
|
|
349
346
|
query: str,
|
|
350
347
|
_query_vector: list[float],
|
|
@@ -356,7 +353,6 @@ async def episode_search(
|
|
|
356
353
|
) -> list[EpisodicNode]:
|
|
357
354
|
if config is None:
|
|
358
355
|
return []
|
|
359
|
-
|
|
360
356
|
search_results: list[list[EpisodicNode]] = list(
|
|
361
357
|
await semaphore_gather(
|
|
362
358
|
*[
|
|
@@ -392,7 +388,7 @@ async def episode_search(
|
|
|
392
388
|
|
|
393
389
|
|
|
394
390
|
async def community_search(
|
|
395
|
-
driver:
|
|
391
|
+
driver: GraphDriver,
|
|
396
392
|
cross_encoder: CrossEncoderClient,
|
|
397
393
|
query: str,
|
|
398
394
|
query_vector: list[float],
|