Edge search updates (#753)

* update edge fulltext search

* update

* update
This commit is contained in:
Preston Rasmussen 2025-07-22 10:05:58 -04:00 committed by GitHub
parent 7daa46067e
commit 38dd3e8dc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 14 deletions

View file

@ -169,7 +169,7 @@ async def edge_fulltext_search(
get_relationships_query('edge_name_and_fact', db_type=driver.provider)
+ """
YIELD relationship AS rel, score
MATCH (n:Entity)-[r:RELATES_TO]->(m:Entity)
MATCH (n:Entity)-[r:RELATES_TO {uuid: rel.uuid}]->(m:Entity)
WHERE r.group_id IN $group_ids """
+ filter_query
+ """
@ -295,12 +295,12 @@ async def edge_bfs_search(
query = (
"""
UNWIND $bfs_origin_node_uuids AS origin_uuid
MATCH path = (origin:Entity|Episodic {uuid: origin_uuid})-[:RELATES_TO|MENTIONS]->{1,3}(n:Entity)
UNWIND relationships(path) AS rel
MATCH (n:Entity)-[r:RELATES_TO]-(m:Entity)
WHERE r.uuid = rel.uuid
"""
UNWIND $bfs_origin_node_uuids AS origin_uuid
MATCH path = (origin:Entity|Episodic {uuid: origin_uuid})-[:RELATES_TO|MENTIONS]->{1,3}(n:Entity)
UNWIND relationships(path) AS rel
MATCH (n:Entity)-[r:RELATES_TO]-(m:Entity)
WHERE r.uuid = rel.uuid
"""
+ filter_query
+ """
RETURN DISTINCT
@ -443,10 +443,10 @@ async def node_bfs_search(
query = (
"""
UNWIND $bfs_origin_node_uuids AS origin_uuid
MATCH (origin:Entity|Episodic {uuid: origin_uuid})-[:RELATES_TO|MENTIONS]->{1,3}(n:Entity)
WHERE n.group_id = origin.group_id
"""
UNWIND $bfs_origin_node_uuids AS origin_uuid
MATCH (origin:Entity|Episodic {uuid: origin_uuid})-[:RELATES_TO|MENTIONS]->{1,3}(n:Entity)
WHERE n.group_id = origin.group_id
"""
+ filter_query
+ ENTITY_NODE_RETURN
+ """

View file

@ -1,7 +1,7 @@
[project]
name = "graphiti-core"
description = "A temporal graph building library"
version = "0.17.8"
version = "0.17.9"
authors = [
{ "name" = "Paul Paliychuk", "email" = "paul@getzep.com" },
{ "name" = "Preston Rasmussen", "email" = "preston@getzep.com" },

View file

@ -70,7 +70,10 @@ async def test_graphiti_init():
created_at=[[DateFilter(date=utc_now(), comparison_operator=ComparisonOperator.less_than)]]
)
results = await graphiti.search_(query='Who is Tania?', search_filter=search_filter)
results = await graphiti.search_(
query='What is the hall of portrait?',
search_filter=search_filter,
)
pretty_results = search_results_to_context_string(results)

2
uv.lock generated
View file

@ -746,7 +746,7 @@ wheels = [
[[package]]
name = "graphiti-core"
version = "0.17.6"
version = "0.17.9"
source = { editable = "." }
dependencies = [
{ name = "diskcache" },