From 35cd567c9ee2999241c23fa53a1c8990b8fea9f0 Mon Sep 17 00:00:00 2001 From: yangdx Date: Fri, 17 Oct 2025 00:19:30 +0800 Subject: [PATCH] Allow related chunks missing in knowledge graph queries --- docs/DockerDeployment.md | 1 - lightrag/operate.py | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/DockerDeployment.md b/docs/DockerDeployment.md index 7946de2d..968a8ec7 100644 --- a/docs/DockerDeployment.md +++ b/docs/DockerDeployment.md @@ -119,4 +119,3 @@ Before building multi-architecture images, ensure you have: - Docker 20.10+ with Buildx support - Sufficient disk space (20GB+ recommended for offline image) - Registry access credentials (if pushing images) - diff --git a/lightrag/operate.py b/lightrag/operate.py index 525f2d27..c34d72ae 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -3332,7 +3332,11 @@ async def _build_query_context( query_embedding=search_result["query_embedding"], ) - if not merged_chunks: + if ( + not merged_chunks + and not truncation_result["entities_context"] + and not truncation_result["relations_context"] + ): return None # Stage 4: Build final LLM context with dynamic token processing