mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
RAG is only used on the first chat message #1450
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 @aleixdorca on GitHub (Jul 6, 2024).
Bug Report
Description
Bug Summary:
Open-Web UI only uses the "RAG" (Retrieval Augmented Generation) technique on the first message of the conversation. From the second message onwards, the response does not seem to be based on the previous conversation context.
Steps to Reproduce:
Start a new chat, upload a file and ask a question. Docker and Ollama log the normal RAG behaviour (with the proper RAG prompt). From the second message RAG is not used.
Expected Behavior:
RAG should be used on all questions, isn't it?
Environment
Open WebUI Version: 0.3.7
Ollama (if applicable): 0.1.48
Operating System: debian+docker
Browser (if applicable): Chrome 126.0.6478.127
Reproduction Details
Confirmation:
Logs and Screenshots
Docker Container Logs:
The docker logs show when the document is uploaded and embedded. For the first question RAG is shown in the Docker Logs as:
Ollama logs the query as well. But, on the second message, only ollama logs a basic message, no RAG is used at all.
Installation Method
The project was installed using Docker
@aleixdorca commented on GitHub (Jul 6, 2024):
I have also tried with different models (mistral, llama3, gemma2), just in case. Same behaviour.
@silentoplayz commented on GitHub (Jul 6, 2024):
This is not a bug, but rather a deliberate change in how RAG handles uploaded documents. Since the introduction of the
Knowledgefeature, the default behavior has been updated. Now, uploaded documents are only considered within the context of a single message. To restore the previous functionality, you can enable uploaded documents or collections of documents asKnowledgefor a model file in theModelssection of theWorkspace. This allows the model file to retain knowledge of the documents from the initial message onwards, eliminating the need to manually add documents to each query during a chat session with the model.@aleixdorca commented on GitHub (Jul 6, 2024):
Thanks for answering and closing the bug report.
I don't get it, though. The way you put it means (please correct me if I am wrong):
This breaks a major feature of Open WebUI, in my opinion.
To add to this, the setup we are testing at our university gives access to 50 users, none with admin rights. Admins should add the company's information, this I get, but for casual documents, users should have more control and access to the RAG feature.
@silentoplayz commented on GitHub (Jul 6, 2024):
I understand your concerns and appreciate you breaking down the limitations of the current implementation of RAG within Open WebUI.
You are correct that:
DocumentsandModelssections has always been limited to only administrative configuration.Workspace, which means they can't manage documents or the recent addition of model file knowledge, which may seem even more restrictive.In addition to these existing limitations, the recent change to RAG's handling of uploaded documents has introduced new challenges. You're right that:
Speaking for many, I acknowledge that this change may have taken a hit to a major feature of Open WebUI in the perspective of some users, and we should revisit the design to make it more user-friendly and accessible.
With this all having been said, I will mention that the Open WebUI team is aware of the need for a more flexible solution that allows users to manage their own documents without relying on administrators. This is an area that is actively being worked on to be improved in the future, and we're excited to introduce "teams" in an upcoming feature. Related - https://github.com/open-webui/open-webui/issues/2924
@aleixdorca commented on GitHub (Jul 6, 2024):
It's great to hear that you understand the concerns regarding the recent changes to RAG in Open WebUI.
You've accurately outlined the issues, including the limitations for regular users, the inconvenience of reuploading documents per session, and the potential for inaccurate responses due to missing document links.
It's reassuring to know that the Open WebUI team is aware of these challenges and is actively working on a solution. The introduction of "teams" in an upcoming feature seems promising and could address many of the current limitations.
I appreciate your constructive feedback and your willingness to engage in this discussion.
I will keep an eye on future updates.
@Qualzz commented on GitHub (Jul 11, 2024):
It's very difficult to have a chat over a document, as the LLM doesn't create it's own query.
Thus you need to write every keyword in every message.
Exemple:
User: Can you retrieve the frame data for whatever here:
AI: Here is the data
User: Can you also display the images as markdown ?
AI: I don't fucking know what you're talking about -> Because the query will be "
Can you also display the images as markdown ?"@silentoplayz commented on GitHub (Jul 11, 2024):
Related: https://github.com/open-webui/open-webui/discussions/3516#discussioncomment-10016923
@flyfox666 commented on GitHub (Jul 13, 2024):
Finally found this issue to solve my doubts haha.I'm waiting for the latest version to be updated.In fact, I still hope that ordinary users can have their own workspace, while the administrator can have a supervision, so that the company's internal BU department to deploy more quickly and easily!
Really Appreciated