feat: Separate RAG Relevance Threshold for Knowledge Base vs. Drag-and-Drop Files - to Improve Accuracy #5907

Open
opened 2025-11-11 16:38:02 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @ips972 on GitHub (Jul 30, 2025).

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

Currently, Open WebUI uses a uniform Retrieval-Augmented Generation (RAG) methodology for all types of content, including both files added via the knowledge base and files uploaded via drag-and-drop to the GUI. This approach does not account for the different user intents and information needs associated with these two workflows.

Users interacting with the knowledge bases typically have specific questions and are seeking precise, targeted answers. In contrast, users uploading files via the GUI are more likely to ask open-ended questions such as "What is this file about?" or "Summarize this for me." Applying the same retrieval thresholds and filtering logic to both use cases can lead to incomplete or hallucinated responses, especially when the Relevance Threshold (with hybrid and reranking models ) filters out relevant but less "score-dense" file content.

Desired Solution you'd like

Introduce separated RAG behavior for the two use cases:

Knowledge Base Entries:
Use a higher retrieval threshold and stricter relevance filtering. Users consulting the knowledge base usually have clear expectations and prior knowledge, so high-precision retrieval is more appropriate.

Drag-and-Drop/upload Files via GUI:
Use a lower threshold or a hybrid RAG with reranking, even for moderately relevant chunks (e.g., 2–4% relevance). This allows general exploratory questions to still surface meaningful information from the uploaded documents without triggering false negatives or hallucinated responses.
in this case - since its usually a single to a few files only - one might add the option to bypass RAG and go full context mode too. (this can be left to the user with an additional (full context mode) button in the Gui next to web search if enabled by admin (to allow this behavior to the users)

This separation would make the system more intuitive and reliable across use cases, reducing user frustration and increasing the utility of Open WebUI in exploratory file analysis scenarios.

Alternatives Considered

Adjusting the RAG configuration manually before each use depending on the context, but this places too much responsibility on end-users.

Using a global hybrid RAG with looser filtering, which may harm knowledge base accuracy.

These approaches are either too manual or compromise quality. A built-in context-sensitive strategy is more scalable.

Additional Context

This request emerged from practical use and evaluation of the current RAG performance across different workflows. A context-aware approach would significantly improve user experience and reduce the risk of hallucinated or misleading outputs, particularly in file summarization scenarios.

Originally created by @ips972 on GitHub (Jul 30, 2025). ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description Currently, Open WebUI uses a uniform Retrieval-Augmented Generation (RAG) methodology for all types of content, including both files added via the knowledge base and files uploaded via drag-and-drop to the GUI. This approach does not account for the different user intents and information needs associated with these two workflows. Users interacting with the knowledge bases typically have specific questions and are seeking precise, targeted answers. In contrast, users uploading files via the GUI are more likely to ask open-ended questions such as "What is this file about?" or "Summarize this for me." Applying the same retrieval thresholds and filtering logic to both use cases can lead to incomplete or hallucinated responses, especially when the Relevance Threshold (with hybrid and reranking models ) filters out relevant but less "score-dense" file content. ### Desired Solution you'd like Introduce separated RAG behavior for the two use cases: Knowledge Base Entries: Use a higher retrieval threshold and stricter relevance filtering. Users consulting the knowledge base usually have clear expectations and prior knowledge, so high-precision retrieval is more appropriate. Drag-and-Drop/upload Files via GUI: Use a lower threshold or a hybrid RAG with reranking, even for moderately relevant chunks (e.g., 2–4% relevance). This allows general exploratory questions to still surface meaningful information from the uploaded documents without triggering false negatives or hallucinated responses. in this case - since its usually a single to a few files only - one might add the option to bypass RAG and go full context mode too. (this can be left to the user with an additional (full context mode) button in the Gui next to web search if enabled by admin (to allow this behavior to the users) This separation would make the system more intuitive and reliable across use cases, reducing user frustration and increasing the utility of Open WebUI in exploratory file analysis scenarios. ### Alternatives Considered Adjusting the RAG configuration manually before each use depending on the context, but this places too much responsibility on end-users. Using a global hybrid RAG with looser filtering, which may harm knowledge base accuracy. These approaches are either too manual or compromise quality. A built-in context-sensitive strategy is more scalable. ### Additional Context This request emerged from practical use and evaluation of the current RAG performance across different workflows. A context-aware approach would significantly improve user experience and reduce the risk of hallucinated or misleading outputs, particularly in file summarization scenarios.
Author
Owner

@sanchitbhavsar commented on GitHub (Aug 1, 2025):

One way to set up two different retrieval pipelines:
* One with strict retrieval + high thresholds (for KB)
* One with hybrid RAG + reranking or full context (for file uploads)

@tjbck do you have some feedback on this

@sanchitbhavsar commented on GitHub (Aug 1, 2025): One way to set up two different retrieval pipelines: * One with strict retrieval + high thresholds (for KB) * One with hybrid RAG + reranking or full context (for file uploads) @tjbck do you have some feedback on this
Author
Owner

@kaiyanchen commented on GitHub (Aug 14, 2025):

is it possible to allow users/admin to setup the retrieval method by Knowledge base level? I met the same issue, and the results is not good. so I have to setup full context mode, which gives what i wanted.

@kaiyanchen commented on GitHub (Aug 14, 2025): is it possible to allow users/admin to setup the retrieval method by Knowledge base level? I met the same issue, and the results is not good. so I have to setup full context mode, which gives what i wanted.
Author
Owner

@tan-yong-sheng commented on GitHub (Aug 28, 2025):

I am thinking if we could just make a standalone 'Knowledge Base' nav bar (which deals with knowledge base), besides just squeezing all the configuration at 'Documents' nav bar (which deals with drag-and-drop file upload).

For example, I prefer 'bypass embeddings and retrieval' when dealing with a single drag-and-drop file upload, but sometimes, i love to have the flexibility to configure either 'bypass embeddings and retrieval' or not for each knowledge base. Having a specific nav bar for 'Knowledge base' making it easier to configure a different settings dealing with single drag-and-drop file upload.

Image
@tan-yong-sheng commented on GitHub (Aug 28, 2025): I am thinking if we could just make a standalone 'Knowledge Base' nav bar (which deals with knowledge base), besides just squeezing all the configuration at 'Documents' nav bar (which deals with drag-and-drop file upload). For example, I prefer 'bypass embeddings and retrieval' when dealing with a single drag-and-drop file upload, but sometimes, i love to have the flexibility to configure either 'bypass embeddings and retrieval' or not for each knowledge base. Having a specific nav bar for 'Knowledge base' making it easier to configure a different settings dealing with single drag-and-drop file upload. <img width="1028" height="861" alt="Image" src="https://github.com/user-attachments/assets/262a10dc-fe27-4c58-813e-aff27e2f1ebd" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#5907