From 388aae1ac502abfdc8bee435b318739c2100d11b Mon Sep 17 00:00:00 2001 From: Parker Erickson Date: Thu, 5 Sep 2024 12:18:43 -0500 Subject: [PATCH 1/2] updates to hnsw overlap --- .../supportai/retrievers/HNSW_Overlap_Search.gsql | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/common/gsql/supportai/retrievers/HNSW_Overlap_Search.gsql b/common/gsql/supportai/retrievers/HNSW_Overlap_Search.gsql index d53b724c..5fbb0180 100644 --- a/common/gsql/supportai/retrievers/HNSW_Overlap_Search.gsql +++ b/common/gsql/supportai/retrievers/HNSW_Overlap_Search.gsql @@ -30,7 +30,12 @@ CREATE OR REPLACE DISTRIBUTED QUERY HNSW_Overlap_Search(Set 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; @@ -40,7 +45,11 @@ CREATE OR REPLACE DISTRIBUTED QUERY HNSW_Overlap_Search(Set 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; From 2efc5d1ee676340e6b80b098af0b4ce98062fcaa Mon Sep 17 00:00:00 2001 From: Parker Erickson Date: Fri, 6 Sep 2024 10:11:10 -0500 Subject: [PATCH 2/2] fix on error --- eventual-consistency-service/app/graphrag/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eventual-consistency-service/app/graphrag/util.py b/eventual-consistency-service/app/graphrag/util.py index 016a275e..50d02428 100644 --- a/eventual-consistency-service/app/graphrag/util.py +++ b/eventual-consistency-service/app/graphrag/util.py @@ -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(