Skip to content

Commit 348346c

Browse files
authored
retrieve chunks improvement (#698)
1 parent b6016a7 commit 348346c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

backend/app/rag/indices/knowledge_graph/graph_store/tidb_graph_store.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,7 @@ def get_chunks_by_relationships(
10821082
}
10831083

10841084
if chunk_ids:
1085+
logger.info(f"Getting chunks for relationships: {chunk_ids}")
10851086
# Query chunks
10861087
chunks = session.exec(
10871088
select(self._chunk_model).where(self._chunk_model.id.in_(chunk_ids))
@@ -1104,11 +1105,13 @@ def get_chunks_by_relationships(
11041105
]
11051106

11061107
document_ids = {
1107-
rel.meta.get("document_id")
1108+
rel.document_id
11081109
for rel in relationships
1109-
if rel.meta.get("document_id") is not None
1110+
if rel.document_id is not None
11101111
}
11111112

1113+
logger.info(f"Getting documents for relationships: {document_ids}")
1114+
11121115
documents = session.exec(
11131116
select(Document).where(Document.id.in_(document_ids))
11141117
).all()

0 commit comments

Comments
 (0)