mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-22 01:22:00 -05:00
Sending same embedding file (rag) multiple times increases token usage #2150
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 (Sep 21, 2024).
Bug Report
Installation Method
Docker
Environment
Open WebUI Version: v0.3.23
Ollama (if applicable): n/a
Operating System: Debian 12 6.1
Browser (if applicable): Edge v129
Confirmation:
Expected Behavior
The system should only send or stream each file or collection (RAG embedding) once in a chat. To achieve this, a function should be implemented to analyze and preprocess the
filesand retain only one instance of each uniquecollection_name. This is crucial as sending duplicatecollection_nameentries significantly increases the input token count, resulting in substantial cost implications.Actual Behavior
The current system sends the same file or collection (RAG embedding) multiple times, effectively doubling (or even tripling) the actual number of input tokens.
Description
Bug Summary
A bug has been identified where selecting a document or collection using the '#' character in a chat, followed by one or more consecutive questions about the context, results in the same document or collection being listed or sent multiple times in the input body. This is demonstrated in the example below, where the same filename appears twice.
Reproduction Details
Steps to Reproduce:
Just select a document/collection using the '#' char in a chat and then ask one or more consecutive questions about the context. Inspect the inlet/body contents to confirm duplication.
Logs and Screenshots
Browser Console Logs:
None
Docker Container Logs:
None
Screenshots/Screen Recordings (if applicable):
None
Additional Information
None
Note
If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!