Skip to content

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

Feat: Surpport dynamically add knowledge basees for retrieval while u… (#7915)

sinopec243ed4bc351c
diff --git a/api/db/services/conversation_service.py b/api/db/services/conversation_service.py
index 575eea6955..c378129371 100644
--- a/api/db/services/conversation_service.py
+++ b/api/db/services/conversation_service.py
@@ -123,6 +123,8 @@ def completion(tenant_id, chat_id, question, name="New session", session_id=None
message_id = msg[-1].get("id")
e, dia = DialogService.get_by_id(conv.dialog_id)
+ kb_ids = kwargs.get("kb_ids",[])
+ dia.kb_ids = list(set(dia.kb_ids + kb_ids))
if not conv.reference:
conv.reference = []
conv.message.append({"role": "assistant", "content": "", "id": message_id})