[GH-ISSUE #23467] issue: selecting Collection in Chat with native function calling enabled model triggers RAG Query Generation and Retrieval #19991

Open
opened 2026-04-20 02:34:11 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @bannert1337 on GitHub (Apr 7, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23467

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

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

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

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

  1. Create multiple collections with documents.
  2. Create model with collections attached and native function calling enabled.
  3. Open chat with created model.
  4. Select collection with + button in chat text field.
  5. Send message with collection selected.

Logs & Screenshots

Image Image

Additional Information

I have a model in Open WebUI with native function calling enabled and multiple collections attached.
This works perfectly fine.

Originally created by @bannert1337 on GitHub (Apr 7, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/23467 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### 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 - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### 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 1. Create multiple collections with documents. 2. Create model with collections attached and native function calling enabled. 3. Open chat with created model. 4. Select collection with `+` button in chat text field. 5. Send message with collection selected. ### Logs & Screenshots <img width="1496" height="280" alt="Image" src="https://github.com/user-attachments/assets/93052543-2e9f-4fab-a699-d2ecd2641585" /> <img width="1968" height="224" alt="Image" src="https://github.com/user-attachments/assets/b185d92f-32b8-427f-b631-21ca09951eca" /> ### Additional Information I have a model in Open WebUI with native function calling enabled and multiple collections attached. This works perfectly fine.
GiteaMirror added the bug label 2026-04-20 02:34:11 -05:00
Author
Owner

@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

<!-- gh-comment-id:4197960638 --> @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
Author
Owner

@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_files tool in builtin.py already 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.

<!-- gh-comment-id:4200956604 --> @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_files` tool in `builtin.py` already 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.
Author
Owner

@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.

<!-- gh-comment-id:4201003875 --> @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.
Author
Owner

@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?

<!-- gh-comment-id:4273087752 --> @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?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#19991