mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-12 11:04:58 -05:00
[GH-ISSUE #3556] Add switch to disable RAG on attachments. #116617
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 @nickovs on GitHub (Jun 30, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/3556
Currently if you drop even a single document onto Open WebUI and ask a question about that document, it appears that RAG is always used. It would be helpful to be able to switch this off.
Currently, for each attachment the document text is extracted, the text is chunked, embeddings computed and indexed, an index lookup is performed and then some of the chunks are passed to the LLM. While this is an OK solution for retrieval tasks, it abjectly fails for summarisation tasks.
For LLMs with small context windows summarisation is hard, but many LLMs now support very large context windows; GPT-4o has a 128K context windows and Anthropic Claude 3 support 200K tokens or about 400 pages of text. To make best use of these longer-context models it would be helpful to be able to pass the entire extracted text of all attachments into the LLM. Having a switch to bypass the RAG steps would achieve this.
@tjbck commented on GitHub (Jul 1, 2024):
This behaviour has been changed since 0.3.6
@nickovs commented on GitHub (Jul 1, 2024):
Can you describe the new behaviour? I am using 0.3.7 (commit
7bc88eb0) and when I attach a multi-page document only a subset of 5 pages are being passed as context, not in the order of the original document. If I change the "Top K" parameter to 10 then I get 10 pages passed in, again not in the order of the original document. Clearly there is something still preventing more than the "top k" hits from being used and the re-ordering suggests that they are coming from some sort of lookup result.@hkosm commented on GitHub (Aug 4, 2024):
+1 A toggle to completely disable RAG would be great. E.g. also when using an external RAG system and relying on the files object in custom tools.
@buger commented on GitHub (Aug 16, 2024):
Can confirm, much needed! In the long term, smth like Claude projects will be amazing, and I'm pretty sure it just puts the whole content of files to the context.
@NeverOccurs commented on GitHub (Sep 10, 2024):
Try this:
https://github.com/NeverOccurs/full_doc_pipe
Use it as a filter function in Open-Webui. It allows uploading a file and push it fully into system prompt. Then you can direct ask the LLM to summarize it or whatever. It doesn't support changing file midway through the chat though.
Still optimizing it but for now I think it is enough for my use case. I'm trying to incorporating it with Claude's prompt caching to minimize cost.
@juancarlosm commented on GitHub (Nov 21, 2024):
Definitely necessary, at least to deactivate the RAG process by model, for example, to send the file to an agent like open-interpreter, or to user an OpenAI assistant that handles the file directly, it doesn't need the RAG stuff.
@antirez commented on GitHub (Feb 3, 2025):
I don't understand. Here with a one liner the problem is dismissed. People continue to tell that it's really needed (with large context LLMs otherwise OpenWebUI is useless) and no reply is added to clarify. So what's the matter here?
@leboomer-0x42 commented on GitHub (Mar 20, 2025):
hello all, for those that missed it (like me before digging prior to "put my self on the list" )
here lies the solution : https://github.com/open-webui/open-webui/issues/7209
magic word to look for in admin pan : BYPASS_EMBEDDING_AND_RETRIEVAL
because a pic is often better than a non native explanation :
@maurizioaiello commented on GitHub (May 1, 2025):
This is not a solution. https://github.com/open-webui/open-webui/issues/7209
explain how to fix it on a system wide setting, which means per all the models and per all the chat. The useful thing would be to leave RAG always on, and a toggle for deactivating RAG ONLY for that chat in that moment.
@Buco7854 commented on GitHub (Jun 4, 2025):
What would be nice is leave the ability to disable it with like a filter function. It seems like it used to be possible but was removed (why?). The main usecase would be for code execution where you typically does not need to embed a spreadsheet for example.
@ConstantinEilebrecht commented on GitHub (Jun 5, 2025):
A toggle per model would be great to have full flexibility if you connect other system like n8n etc. for complex workflow. In these cases you don't need to start the RAG process within owui.
@Buco7854 commented on GitHub (Jun 5, 2025):
I do not find the toggle to be really flexible depending on what you need to do. But just giving the ability to handle file upload in a filter function would be enough. People that just want a toggle could just do it based on a UserValve and people that need something a bit more advance could also do it. Looking at the code base it seems embeding the file would be as simple as calling a function.
@dotmobo commented on GitHub (Apr 30, 2026):
+1
I added a model (GLM OCR) as a chat model and I want to be able to pass both images and PDFs to it.
Images are working correctly. However, for PDFs, the GLM OCR model does not receive the actual file because the system uses Apache Tika for content extraction and a RAG process.
I want to keep the RAG and Apache Tika workflow for all other models, but disable it specifically for the GLM OCR model.
@Classic298 commented on GitHub (Apr 30, 2026):
@dotmobo would a file_handle filter do that job for you?