mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-26 22:49:41 -05:00
[GH-ISSUE #12830] issue: BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL leads to exceeding context window limit #16726
Reference in New Issue
Block a user
Originally created by @harrywang on GitHub (Apr 14, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12830
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
0.6.4
Ollama Version (if applicable)
No response
Operating System
Ubuntu 22.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
When enable BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL, all search results are combined and attached as the context for the chat. It should be truncated or better managed to make sure it does not exceed the chosen model's context length.
Actual Behavior
It leads to the following error.

Steps to Reproduce
Enable web search and BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL, set a large search result count, say, 5, should reproduce the error.
Logs & Screenshots
See above.
Additional Information
No response
@tjbck commented on GitHub (Apr 14, 2025):
Intended behaviour. Use a model with a larger context length.
@Anaphylaxis commented on GitHub (Apr 14, 2025):
I mean, he's using 128k, the only ones with larger are basically Gemini. The real answer would be to lower the search results from 5, a solution would be the ability to dynamically alter the sources -- checkboxes to enable/disable and ability to edit (truncate manually for example) -- would not only fix this "issue" but completely revamp the web search feature.
@harrywang commented on GitHub (Apr 14, 2025):
@Anaphylaxis thanks, I changed the search results to 2 which will end up with 6 urls (3 queries are auto generated). We may add a function to summarize or truncate the search results.
@Anaphylaxis commented on GitHub (Apr 14, 2025):
3 queries generated is due to the web search query, if u want to customize it you can change the query under admin settings -> interface -> Query Generation Prompt
@harrywang commented on GitHub (Apr 14, 2025):
Yes. I think the default 3 queries is good.