From c5f0c4af87ff13bf8e3cbe0f4e9163ece44c3094 Mon Sep 17 00:00:00 2001 From: chinu0609 Date: Wed, 5 Nov 2025 20:22:17 +0530 Subject: [PATCH] fix: add text_doc flag --- cognee/modules/retrieval/utils/access_tracking.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cognee/modules/retrieval/utils/access_tracking.py b/cognee/modules/retrieval/utils/access_tracking.py index 36c0b7f50..65d597a93 100644 --- a/cognee/modules/retrieval/utils/access_tracking.py +++ b/cognee/modules/retrieval/utils/access_tracking.py @@ -67,12 +67,9 @@ async def update_node_access_timestamps(items: List[Any]): # Step 2: Find origin TextDocument nodes (without hardcoded relationship names) origin_query = """ UNWIND $node_ids AS node_id - MATCH (n:Node {id: node_id}) - OPTIONAL MATCH (n)-[e:EDGE]-(chunk:Node) - WHERE chunk.type = 'DocumentChunk' - OPTIONAL MATCH (chunk)-[e2:EDGE]-(doc:Node) - WHERE doc.type IN ['TextDocument', 'PdfDocument', 'AudioDocument', 'ImageDocument', 'UnstructuredDocument'] - RETURN DISTINCT doc.id as doc_id + MATCH (chunk:Node {id: node_id})-[e:EDGE]-(doc:Node) + WHERE chunk.type = 'DocumentChunk' AND doc.type IN ['TextDocument', 'Document'] + RETURN DISTINCT doc.id """ result = await graph_engine.query(origin_query, {"node_ids": node_ids})