Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix bug over chunks classification by document in the promp (#4156)

devMls96da618b6a6f
diff --git a/api/db/services/dialog_service.py b/api/db/services/dialog_service.py
index ef86d763ca..73f8ff4813 100644
--- a/api/db/services/dialog_service.py
+++ b/api/db/services/dialog_service.py
@@ -124,7 +124,7 @@ def kb_prompt(kbinfos, max_tokens):
for i, ck in enumerate(kbinfos["chunks"]):
if i >= chunks_num:
break
- doc2chunks["docnm_kwd"].append(ck["content_with_weight"])
+ doc2chunks[ck["docnm_kwd"]].append(ck["content_with_weight"])
knowledges = []
for nm, chunks in doc2chunks.items():