mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[GH-ISSUE #23995] issue: RAG Chunk Min Size Target option doesn't work #58813
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 @xNissX233 on GitHub (Apr 22, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23995
Open WebUI Version
0.9.1
Operating System
Arch Linux
Browser (if applicable)
Desktop App
Expected Behavior
When setting Chunk Min Size Target option to 100 for example, the context given to the model from the Knowledge files should be of minimum that size per chunk.
Actual Behavior
Setting Chunk Min Size Target to a high value still results in the model getting tiny pieces of information from each file.
Steps to Reproduce
Logs & Screenshots
@Classic298 commented on GitHub (Apr 22, 2026):
As explained in the docs, this config doesn't ENSURE all small markdown header sections get merged. It tries to. But it can't always do it
There are edge cases like when you're at the end of a file and there's one small chunk remaining that can't be merged into any other chunk. Then you HAVE to create the chunk even though it's small
@xNissX233 commented on GitHub (Apr 22, 2026):
That is definitely not my case, and I observe the same behavior with all the documents I try, but you can close the issue if you consider.
In my case it happens that I tell the model "continue" every now and then. Then I save the conversation in knowledge as context. And with RAG, if I say "continue" the model gets as context from the conversation in the txt file nothing more than a few "continue" lines, instead of actual longer messages
@Classic298 commented on GitHub (Apr 22, 2026):
What do you mean by continue
@xNissX233 commented on GitHub (Apr 22, 2026):
I write a message with content:
"Continue"
To the model so he continues his last message.
And that "Continue" is then saved as part of the conversation, being used wrongly by the RAG later in the context.
So for example:
Me: I like birds
AI: (gets useful context about birds) Birds are cool
Me: Continue
AI: (gets as context a bunch of "continue" lines and gives an answer that doesn't have any useful context)
@Classic298 commented on GitHub (Apr 22, 2026):
Aha but that has absolutely nothing to do with the min chunk size config. That's just the RAG working as designed. On every query it fetches new information
Try setting to native tool calling instead. The model will decide on it's own when to invoke the RAG
@xNissX233 commented on GitHub (Apr 22, 2026):
Isn't there an option to control this behavior without native tool mode then? native tool mode is a bit too expensive for me since it injects a lot of tokens each time it's called and the model takes a lot of time to think and answer
@Classic298 commented on GitHub (Apr 22, 2026):
@xNissX233 you can disable all the tool categories you don't want the model to have.
I.e. web search and such and only give it the knowledge tools
It's not many tokens maybe a few hundred which is just the prompt of the 5/6 knowledge tools there are
You have to pay the price anyways either way.
Either the task model gets all the tools each time and decides to do RAG or your chat model uses the tools natively.
@xNissX233 commented on GitHub (Apr 22, 2026):
Ok, would be nice to have an option to set an actual minimum amount of characters/tokens in each context provided with RAG though, since native mode sometimes doesn't retrieve anything if the model doesn't decide to do so.
Thank you.