Skip to content

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

Fix:When sharing the knowledge base of multiple tenants with one person, when this person queries the knowledge base of both tenants, they will only query the question of the first person's knowledge base (#7500)

duramisufa32a2d0fdb9
diff --git a/api/apps/sdk/doc.py b/api/apps/sdk/doc.py
index eb0110b8fa..5f05cca141 100644
--- a/api/apps/sdk/doc.py
+++ b/api/apps/sdk/doc.py
@@ -1407,6 +1407,7 @@ def retrieval_test(tenant_id):
else:
highlight = True
try:
+ tenant_ids = list(set([kb.tenant_id for kb in kbs]))
e, kb = KnowledgebaseService.get_by_id(kb_ids[0])
if not e:
return get_error_data_result(message="Dataset not found!")
@@ -1423,7 +1424,7 @@ def retrieval_test(tenant_id):
ranks = settings.retrievaler.retrieval(
question,
embd_mdl,
- kb.tenant_id,
+ tenant_ids,
kb_ids,
page,
size,