Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates to hnsw overlap #274

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions common/gsql/supportai/retrievers/HNSW_Overlap_Search.gsql
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ CREATE OR REPLACE DISTRIBUTED QUERY HNSW_Overlap_Search(Set<STRING> v_types, STR
start = SELECT s FROM start:s POST-ACCUM s.@num_times_seen += 1;

FOREACH i IN RANGE[0, num_hops-1] DO
start = SELECT t FROM start:s -(:e)- :t
start = SELECT t FROM start:s -((RELATIONSHIP|
CONTAINS_ENTITY|
IS_AFTER|
reverse_CONTAINS_ENTITY|
IS_HEAD_OF|
HAS_TAIL):e)- :t
ACCUM @@edges += e
POST-ACCUM t.@num_times_seen += 1;
END;
Expand All @@ -40,7 +45,11 @@ CREATE OR REPLACE DISTRIBUTED QUERY HNSW_Overlap_Search(Set<STRING> v_types, STR
IF s.type == "Relationship" THEN
@@relationship_info += (s.id -> s.definition)
ELSE IF s.type == "Entity" THEN
@@entity_info += (s.id -> s.definition)
STRING tmp_dsc = s.definition,
FOREACH dsc IN s.description DO
tmp_dsc = tmp_dsc + dsc +";"
END,
@@entity_info += (s.id -> tmp_dsc)
ELSE IF s.type == "DocumentChunk" THEN
@@to_retrieve_content += s
END;
Expand Down
4 changes: 2 additions & 2 deletions eventual-consistency-service/app/graphrag/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ async def check_vertex_exists(conn, v_id: str):
res.raise_for_status()
return res.json()
except Exception as e:
logger.error(f"Check err:\n{e}\n{res.text}")
return {"error": True, "message": res.text}
logger.error(f"Check err:\n{e}\n{e}")
return {"error": True, "message": e}


async def upsert_edge(
Expand Down
Loading