diff --git a/pilot/graph_engine/graph_engine.py b/pilot/graph_engine/graph_engine.py index a50ebabdc..faf53aba1 100644 --- a/pilot/graph_engine/graph_engine.py +++ b/pilot/graph_engine/graph_engine.py @@ -129,6 +129,11 @@ class RAGGraphEngine: ) result = [future.result() for future in future_tasks] + # for triplet in triplets: + # subj, _, obj = triplet + # self.graph_store.upsert_triplet(*triplet) + # self.graph_store.upsert_triplet(*triplet) + # index_struct.add_node([subj, obj], text_node) return index_struct # for doc in documents: # triplets = self._extract_triplets(doc.page_content) @@ -162,8 +167,9 @@ class RAGGraphEngine: print( f"current thread-{thread_id} end extract triplets tasks, triplets-{triplets}" ) - for triplet in triplets: - subj, _, obj = triplet - self.graph_store.upsert_triplet(*triplet) - self.graph_store.upsert_triplet(*triplet) - index_struct.add_node([subj, obj], text_node) + return triplets + # for triplet in triplets: + # subj, _, obj = triplet + # self.graph_store.upsert_triplet(*triplet) + # self.graph_store.upsert_triplet(*triplet) + # index_struct.add_node([subj, obj], text_node) diff --git a/pilot/graph_engine/graph_search.py b/pilot/graph_engine/graph_search.py index d1f6a4519..fb883e48b 100644 --- a/pilot/graph_engine/graph_search.py +++ b/pilot/graph_engine/graph_search.py @@ -145,7 +145,7 @@ class RAGGraphSearch(BaseSearch): if len(sorted_nodes_with_scores) == 0: logger.info("> No nodes found by keywords, returning empty response.") return [ - NodeWithScore(node=TextNode(text="No relationships found."), score=1.0) + Document(page_content="No relationships found.") ] # add relationships as Node