mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #12926] issue: RAG_TEMPLATE Not Applying to Documents Retrieved by Tool #32289
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 @jfouret on GitHub (Apr 16, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12926
Check Existing Issues
Installation Method
Docker
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
The
RAG_TEMPLATEis not applied to documents retrieved by tools. Modifying theRAG_TEMPLATEto include debugging instructions or other changes does not affect the output when documents are retrieved using a tool.Actual Behavior
The
RAG_TEMPLATEis not applied to documents retrieved by tools. Modifying theRAG_TEMPLATEto include debugging instructions or other changes does not affect the output when documents are retrieved using a tool.Steps to Reproduce
RAG_TEMPLATEto include a debugging instruction or a noticeable change.RAG_TEMPLATEchanges are not reflected in the assistant response.Logs & Screenshots
Debug message




With web search
With a Tool:
https://github.com/jfouret/openwebui-modules/blob/main/tools/europepmc_fetcher.py
Additional Information
In addition the inlet Filter only apply before tool execution, there is no way to apply a filter between the tool and the next assistant response.
@jfouret commented on GitHub (Apr 16, 2025):
Ideally we would have the possibility to directly modify/add messages within the tool
@tjbck commented on GitHub (Apr 16, 2025):
You should use a Pipe Function for this and not a tool.
@jfouret commented on GitHub (Apr 16, 2025):
thank you,
I just wonder what do you mean by "this".
RAG_TEMPLATEdoes not apply to the citations added by a tool is expected, and to apply theRAG_TEMPLATEmyself via a pipe that would detect citations ?Or both ?
Bests,