mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[GH-ISSUE #23467] issue: selecting Collection in Chat with native function calling enabled model triggers RAG Query Generation and Retrieval #58657
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 @bannert1337 on GitHub (Apr 7, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23467
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.8.12
Ollama Version (if applicable)
No response
Operating System
Debian 13
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
The old RAG Query Generation and Retrieval process should also be skipped when native function calling is enabled and a collection is selected in chat.
Actual Behavior
After updating from v0.8.10 to v0.8.12, when selecting a collection in Chat now causes the old RAG Query Generation and Retrieval process to start before the model starts generating.
The model with native function calling enabled should handle the retrieval themself and being either limited or suggested to use the selected collection.
Steps to Reproduce
+button in chat text field.Logs & Screenshots
Additional Information
I have a model in Open WebUI with native function calling enabled and multiple collections attached.
This works perfectly fine.
@Classic298 commented on GitHub (Apr 7, 2026):
99% sure this is intended. If you manually add it, it will be queried the old fashioned way, because you also added it the old fashioned way.
If you want the AI to query it you need to have it use it's tools. The old "add knowledge base" RAG still exists of course, if you manually add it.
Leaving it open for @tjbck to triage but i am relatively sure this is intended
@bannert1337 commented on GitHub (Apr 7, 2026):
Thanks for the clarification! I understand that this is how the code currently routes the request, but I'd like to kindly challenge if this should be the intended behavior from a UX and architecture perspective.
As a user, my intuition is that selecting a specific knowledge base (e.g. via
#) should act as a scope/filter for the agent, not as a switch that degrades the model's capabilities.If I have a model with Native Tool Calling enabled, I expect it to use its tools autonomously. By manually attaching a collection, I simply want to tell the agent: "Please use your search tools, but restrict your search to this specific collection." >
Falling back to the legacy RAG pipeline (Task Model -> Embed -> Rerank -> Inject as prompt context) just because a collection was selected creates a very confusing UX: The model suddenly loses its agentic behavior and we lose the benefits of iterative tool usage (like the model deciding to search multiple times with different keywords if the first search fails).
Interestingly, the
query_knowledge_filestool inbuiltin.pyalready supports the__model_knowledge__parameter to scope its searches!Feature Request / Suggestion for @tjbck:
Would it be possible to introduce a logic where, IF native tool calling is active on a model, manually attaching a knowledge base bypasses the legacy RAG context-injection and instead simply passes the attached collections to the tools via
__model_knowledge__? This would make the agentic workflow much more powerful and intuitive.@Classic298 commented on GitHub (Apr 7, 2026):
Ok - but you just figured it out yourself.
Its not an issue. Its a feature request if anything
And yes this parameter exists and is currently used for custom models.
@Tyrannius commented on GitHub (Apr 18, 2026):
Wouldnt it then be better to move the "collection scope" from the model profile to the collection creation / collections access switcher? Like "Name of the collection" , "Describe your collection" and "Which model shall have access to the collection?" and below that the access as usual. The user , who intentionally have the right to create collections probably wont be using the attachment funtion anyways. No?