[GH-ISSUE #16531] issue: Default RAG prompt is injected even when disabled/overridden #56612

Closed
opened 2026-05-05 19:48:38 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Szadam88 on GitHub (Aug 12, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/16531

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

6.2

Ollama Version (if applicable)

No response

Operating System

Alpine linux

Browser (if applicable)

non-relevant

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

If the RAG template is blank/disabled, no RAG text should be added to the system prompt—regardless of tools/attachments/KB state.

Actual Behavior

Output:

Image

Steps to Reproduce

Steps to reproduce
Start Open WebUI via Docker.

In the UI, set a very simple/empty RAG prompt (e.g., just "emptyEmptyEmptyEmptyEmptyEmpty" or blank).

Start a new chat (fresh session), optionally enable a tool/KB or attach a file. in my scenario i noticed that at n8n side:
I have configured n8n pipeline

Logs & Screenshots

System prompt:

Image

Rag template:

Image

Additional Information

Proposed Fixes
Provide a single authoritative switch (env + UI) like OPENWEBUI_DISABLE_RAG=true that guarantees no RAG injection in any code path.

Centralize prompt composition to one function that respects the disable flag and empty template.

Ensure user/workspace settings override defaults consistently and avoid rehydrating defaults from persistence when empty/disabled.

Originally created by @Szadam88 on GitHub (Aug 12, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/16531 ### 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 6.2 ### Ollama Version (if applicable) _No response_ ### Operating System Alpine linux ### Browser (if applicable) non-relevant ### 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 If the RAG template is blank/disabled, no RAG text should be added to the system prompt—regardless of tools/attachments/KB state. ### Actual Behavior Output: <img width="388" height="482" alt="Image" src="https://github.com/user-attachments/assets/ee894a5e-7790-47a5-b98a-9a8b67907654" /> ### Steps to Reproduce Steps to reproduce Start Open WebUI via Docker. In the UI, set a very simple/empty RAG prompt (e.g., just "emptyEmptyEmptyEmptyEmptyEmpty" or blank). Start a new chat (fresh session), optionally enable a tool/KB or attach a file. in my scenario i noticed that at n8n side: I have configured n8n pipeline ### Logs & Screenshots **System prompt:** <img width="319" height="68" alt="Image" src="https://github.com/user-attachments/assets/211c8786-b7af-49af-95a6-619b40ef7daa" /> **Rag template:** <img width="429" height="84" alt="Image" src="https://github.com/user-attachments/assets/fa58f8f0-0f04-4edf-9671-2bd7172feb8b" /> ### Additional Information **Proposed Fixes** Provide a single authoritative switch (env + UI) like OPENWEBUI_DISABLE_RAG=true that guarantees no RAG injection in any code path. Centralize prompt composition to one function that respects the disable flag and empty template. Ensure user/workspace settings override defaults consistently and avoid rehydrating defaults from persistence when empty/disabled.
GiteaMirror added the bug label 2026-05-05 19:48:38 -05:00
Author
Owner

@tjbck commented on GitHub (Aug 12, 2025):

Above is tag generation.

<!-- gh-comment-id:3180289574 --> @tjbck commented on GitHub (Aug 12, 2025): Above is tag generation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#56612