mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[GH-ISSUE #10747] Empty Context with Focused Retrieval in RAG #135745
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bgeneto on GitHub (Feb 25, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/10747
Bug Report
Installation Method
Docker, via docker compose.
Environment
Open WebUI Version: v0.5.16
Ollama (if applicable): N/A
Operating System: Ubuntu 22.04
Browser (if applicable): Firefox 125.0.3
Confirmation:
Expected Behavior:
When using RAG with Focused Retrieval enabled (Full Context Mode disabled), the context should be populated with relevant information extracted from the uploaded document, even if the document is small. The LLM should be able to answer at least specific questions based on this context.
Actual Behavior:
When using RAG with Focused Retrieval enabled, the context is often empty, even with very small documents. The LLM reports that the context is empty and cannot answer questions related to the document's content. Disabling Focused Retrieval (enabling Full Context Mode) resolves the issue, and the context is correctly populated. In both cases, nevertheless, the vector db (prismas, milvus, pgvector...) is correctly populated with embeddings.
Description
Bug Summary:
RAG with Focused Retrieval often results in an empty context, preventing the LLM from answering questions about uploaded documents, even minimal ones. Disabling Focused Retrieval fixes the problem.
Reproduction Details
Steps to Reproduce:
Logs and Screenshots
Browser Console Logs:
(No relevant errors in the browser console.)
Docker Container Logs:
(No relevant errors in the Docker container logs related to RAG processing. Happy to provide full logs if needed, but they are quite verbose.)
Screenshots/Screen Recordings (if applicable):
I can provide screenshots if necessary, but the steps above are very straightforward to reproduce. The key visual difference is the LLM's response indicating an empty context vs. a response based on the document.
Additional Information
This issue seems to be related to how Focused Retrieval processes and selects relevant chunks from the document. Maybe the "Full Context Mode" bypasses this chunk selection and provides the entire processed document to the LLM, which explains why it works correctly. The issue is consistent across different LLMs and document types (txt, pdf, docx, xlsx). I would like to know better how Focused Retrieval is supposed to work.
@galvanoid commented on GitHub (Feb 25, 2025):
I get exactly the same error. When I upload a document and ask about it, it tells me there is no context.
@galvanoid commented on GitHub (Feb 25, 2025):
I've researched this error and the problem seems to be with the "minimum score" in the Documents options. Any value above 0 (0.1, 0.2, etc.) provides that error.
@bgeneto commented on GitHub (Feb 25, 2025):
That's just a workaround (before Focused Retrieval feature was released, by the way).
I think you can also avoid this issue by:
But the issue with Focused Retrieval and empty context will remain (despite been avoided).
@bgeneto commented on GitHub (Feb 25, 2025):
By the way... For consistency in user interface design, I suggest we use toggle switches whenever we need to show On/Off values. You can see an (inconsistent) example in the image below.