### What problem does this PR solve?     user will be used as a common keyword to participate in the search, which may lead to the recall of irrelevant content and reduce the search accuracy. If user appears frequently in your knowledge base, it may affect relevance sorting and even recall some irrelevant FAQs or documents. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [ ] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [ ] Refactoring - [x] Performance Improvement - [ ] Other (please describe): --------- Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
| @@ -96,6 +96,7 @@ class Retrieval(ComponentBase, ABC): | |||
| rerank_mdl = LLMBundle(kbs[0].tenant_id, LLMType.RERANK, self._param.rerank_id) | |||
| if kbs: | |||
| query = re.sub(r"^user[::\s]*", "", query, flags=re.IGNORECASE) | |||
| kbinfos = settings.retrievaler.retrieval( | |||
| query, | |||
| embd_mdl, | |||