Skip to content

Commit 982ec24

Browse files
SyedShahmeerAli12Syed Shahmeer AliKevinHuSh
authored
Fix kb isolation infinity conn (#9913)
### What problem does this PR solve? This PR fixes a critical bug in the knowledge base isolation feature where chat responses were referencing documents from incorrect knowledge bases. The issue was in the `infinity_conn.py` file where the `equivalent_condition_to_str()` function was incorrectly skipping `kb_id` filtering, causing documents from unintended knowledge bases to be included in search results. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: Syed Shahmeer Ali <ashahmeer73@gmail.com> Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
1 parent 1f7a035 commit 982ec24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rag/utils/infinity_conn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def exists(cln):
6767

6868
cond = list()
6969
for k, v in condition.items():
70-
if not isinstance(k, str) or k in ["kb_id"] or not v:
70+
if not isinstance(k, str) or not v:
7171
continue
7272
if field_keyword(k):
7373
if isinstance(v, list):

0 commit comments

Comments
 (0)