Added native function calling support for knowledge bases with citations
Changes
Added query_knowledge built-in tool that searches model-configured knowledge bases when native FC is enabled
Fixed citations and UI display for native FC tools (web_search, query_knowledge) - results now show in WebSearchResults UI and model cites sources automatically
Updated tool descriptions to prioritize knowledge bases over web search
Filtered knowledge base metadata to only include essential fields (name, page, total_pages, creationdate)
Behavior
When native FC is enabled, knowledge bases are not auto-injected -> model decides when to query them
Tool results are converted to sources and emitted as events for UI display
Sources are injected into RAG template so model can cite them
Model checks local knowledge bases first before searching the web
Manual file/KB attachments continue to work as before
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/20379
**Author:** [@jannikstdl](https://github.com/jannikstdl)
**Created:** 1/5/2026
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `feat-native-fc-web-file`
---
### 📝 Commits (2)
- [`2d08583`](https://github.com/open-webui/open-webui/commit/2d085839b5f201a01e6f4c9cb712cc9117d60462) feat: native fuction calling for builtin internal knowledge file seatch
- [`a0ed58e`](https://github.com/open-webui/open-webui/commit/a0ed58e98c05b4834f2749507c3d76d935c26335) feat: show sources and use citations for native web and file tool calls
### 📊 Changes
**4 files changed** (+371 additions, -497 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/tools/builtin.py` (+162 -0)
📝 `backend/open_webui/utils/middleware.py` (+201 -34)
📝 `backend/open_webui/utils/tools.py` (+8 -1)
📝 `package-lock.json` (+0 -462)
</details>
### 📄 Description
# Added native function calling support for knowledge bases with citations
## Changes
- Added `query_knowledge` built-in tool that searches model-configured knowledge bases when native FC is enabled
- Fixed citations and UI display for native FC tools (`web_search`, `query_knowledge`) - results now show in WebSearchResults UI and model cites sources automatically
- Updated tool descriptions to prioritize knowledge bases over web search
- Filtered knowledge base metadata to only include essential fields (name, page, total_pages, creationdate)
## Behavior
- When native FC is enabled, knowledge bases are not auto-injected -> model decides when to query them
- Tool results are converted to sources and emitted as events for UI display
- Sources are injected into RAG template so model can cite them
- Model checks local knowledge bases first before searching the web
- Manual file/KB attachments continue to work as before
<img width="2282" height="1406" alt="image" src="https://github.com/user-attachments/assets/f670651a-7e7d-49f5-9594-5134b2c535c2" />
<img width="2286" height="1486" alt="image" src="https://github.com/user-attachments/assets/10972ab2-26f3-40c4-a222-d413433ec86b" />
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/20379
Author: @jannikstdl
Created: 1/5/2026
Status: ❌ Closed
Base:
dev← Head:feat-native-fc-web-file📝 Commits (2)
2d08583feat: native fuction calling for builtin internal knowledge file seatcha0ed58efeat: show sources and use citations for native web and file tool calls📊 Changes
4 files changed (+371 additions, -497 deletions)
View changed files
📝
backend/open_webui/tools/builtin.py(+162 -0)📝
backend/open_webui/utils/middleware.py(+201 -34)📝
backend/open_webui/utils/tools.py(+8 -1)📝
package-lock.json(+0 -462)📄 Description
Added native function calling support for knowledge bases with citations
Changes
query_knowledgebuilt-in tool that searches model-configured knowledge bases when native FC is enabledweb_search,query_knowledge) - results now show in WebSearchResults UI and model cites sources automaticallyBehavior
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.