[GH-ISSUE #12926] issue: RAG_TEMPLATE Not Applying to Documents Retrieved by Tool #55426

Closed
opened 2026-05-05 17:32:58 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @jfouret on GitHub (Apr 16, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12926

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

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

  • 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 listed steps to reproduce the bug in detail.

Expected Behavior

The RAG_TEMPLATE is not applied to documents retrieved by tools. Modifying the RAG_TEMPLATE to include debugging instructions or other changes does not affect the output when documents are retrieved using a tool.

Actual Behavior

The RAG_TEMPLATE is not applied to documents retrieved by tools. Modifying the RAG_TEMPLATE to include debugging instructions or other changes does not affect the output when documents are retrieved using a tool.

Steps to Reproduce

  • Configure a tool to retrieve documents.
  • Modify the RAG_TEMPLATE to include a debugging instruction or a noticeable change.
  • Execute the tool and observe the output and subsequent assistant response.
  • Verify that the RAG_TEMPLATE changes are not reflected in the assistant response.

Logs & Screenshots

Debug message
Image
With web search
Image
With a Tool:
Image
Image

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.

Originally created by @jfouret on GitHub (Apr 16, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/12926 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### 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 - [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 listed steps to reproduce the bug in detail. ### Expected Behavior The `RAG_TEMPLATE` is not applied to documents retrieved by tools. Modifying the `RAG_TEMPLATE` to include debugging instructions or other changes does not affect the output when documents are retrieved using a tool. ### Actual Behavior The `RAG_TEMPLATE` is not applied to documents retrieved by tools. Modifying the `RAG_TEMPLATE` to include debugging instructions or other changes does not affect the output when documents are retrieved using a tool. ### Steps to Reproduce - Configure a tool to retrieve documents. - Modify the `RAG_TEMPLATE` to include a debugging instruction or a noticeable change. - Execute the tool and observe the output and subsequent assistant response. - Verify that the `RAG_TEMPLATE` changes are not reflected in the assistant response. ### Logs & Screenshots Debug message ![Image](https://github.com/user-attachments/assets/99b6398d-135e-4efb-a1b4-8035dccfa07c) With web search ![Image](https://github.com/user-attachments/assets/2bf24024-d908-4073-8693-713361ad87eb) With a Tool: ![Image](https://github.com/user-attachments/assets/152b4aa7-cef0-4b62-924b-7dd09bcf9524) ![Image](https://github.com/user-attachments/assets/658ee8a0-9a2e-4a89-9cbf-16a62beb9ed1) 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.
GiteaMirror added the bug label 2026-05-05 17:32:58 -05:00
Author
Owner

@jfouret commented on GitHub (Apr 16, 2025):

Ideally we would have the possibility to directly modify/add messages within the tool

<!-- gh-comment-id:2809758378 --> @jfouret commented on GitHub (Apr 16, 2025): Ideally we would have the possibility to directly modify/add messages within the tool
Author
Owner

@tjbck commented on GitHub (Apr 16, 2025):

You should use a Pipe Function for this and not a tool.

<!-- gh-comment-id:2809884399 --> @tjbck commented on GitHub (Apr 16, 2025): You should use a Pipe Function for this and not a tool.
Author
Owner

@jfouret commented on GitHub (Apr 16, 2025):

thank you,

I just wonder what do you mean by "this".

    1. Pipe is the solution to directly modify/add messages within the tool. This is true I am sorry I am quite new using this (2days).
    1. Or the fact that the RAG_TEMPLATE does not apply to the citations added by a tool is expected, and to apply the RAG_TEMPLATE myself via a pipe that would detect citations ?

Or both ?

Bests,

<!-- gh-comment-id:2810015144 --> @jfouret commented on GitHub (Apr 16, 2025): thank you, I just wonder what do you mean by "this". - 1. Pipe is the solution to directly modify/add messages within the tool. This is true I am sorry I am quite new using this (2days). - 2. Or the fact that the `RAG_TEMPLATE` does not apply to the citations added by a tool is expected, and to apply the `RAG_TEMPLATE` myself via a pipe that would detect citations ? Or both ? Bests,
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#55426