[GH-ISSUE #10747] Empty Context with Focused Retrieval in RAG #70622

Closed
opened 2026-05-13 02:40:09 -05:00 by GiteaMirror · 4 comments
Owner

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:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

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:

  1. Start a new chat in OpenWebUI.
  2. Ensure "Full Context Mode" is disabled in Settings (or that "Focused Retrieval" is enabled in the right pane. This is the default setting (unfortunately).
  3. Upload a small document (e.g., a simple text file with a few sentences, a small PDF, or a minimal DOCX/XLSX). I used a TXT file containing only "This is a test document for RAG dated 2025-02-25."
  4. Select any LLM.
  5. Ask the LLM a question about the document's content, such as "What is in the context?" or "What does the document say?", "Are there dates in the context?".
  6. Observe that the LLM responds that the context is empty.
  7. Go to Settings and enable "Full Context Mode" (or disable "Focused Retrieval" in the RAG section).
  8. Repeat steps 5 and 6. Observe that the LLM now correctly answers based on the document's content.

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.

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:** - [x] I have read and followed all the instructions provided in the README.md. - [x] I am on the latest version of both Open WebUI and Ollama. - [ ] I have included the browser console logs. - [ ] I have included the Docker container logs. - [x] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## 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:** 1. Start a new chat in OpenWebUI. 2. Ensure "Full Context Mode" is *disabled* in Settings (or that "Focused Retrieval" is *enabled* in the right pane. This is the default setting (unfortunately). 3. Upload a small document (e.g., a simple text file with a few sentences, a small PDF, or a minimal DOCX/XLSX). I used a TXT file containing only "This is a test document for RAG dated 2025-02-25." 4. Select any LLM. 5. Ask the LLM a question about the document's content, such as "What is in the context?" or "What does the document say?", "Are there dates in the context?". 6. Observe that the LLM responds that the context is empty. 7. Go to Settings and *enable* "Full Context Mode" (or *disable* "Focused Retrieval" in the RAG section). 8. Repeat steps 5 and 6. Observe that the LLM now correctly answers based on the document's content. ## 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.
Author
Owner

@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.

<!-- gh-comment-id:2682882367 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:2682976365 --> @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.
Author
Owner

@bgeneto 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.

That's just a workaround (before Focused Retrieval feature was released, by the way).

I think you can also avoid this issue by:

  • turning OFF Hybrid search (since it only makes sense with minimum score values greater than zero); or
  • turning ON Full Context Mode in Documents Settings.

But the issue with Focused Retrieval and empty context will remain (despite been avoided).

<!-- gh-comment-id:2683208447 --> @bgeneto 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. That's just a workaround (before Focused Retrieval feature was released, by the way). I think you can also avoid this issue by: - turning OFF Hybrid search (since it only makes sense with minimum score values greater than zero); or - turning ON Full Context Mode in Documents Settings. But the issue with Focused Retrieval and empty context will remain (despite been avoided).
Author
Owner

@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.

Image

<!-- gh-comment-id:2683226512 --> @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. ![Image](https://github.com/user-attachments/assets/ff1bb21e-3d41-4193-859f-ff14aa31e639)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#70622