[GH-ISSUE #19243] issue: Memory Feature breaks default system prompt in ollama #34348

Closed
opened 2026-04-25 08:17:24 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @snmogl on GitHub (Nov 17, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/19243

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

Ollama Version (if applicable)

No response

Operating System

unraid

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

Using the Memory (User Context) feature doesn't interfere with any default system prompts.

Actual Behavior

Using the Memory (User Context) feature sends a custom system prompt to the ollama API overwriting the system prompt from the modelfile resulting in an agent that now knows some detail about the user, but is completely missing the remainder of its prompting.

Steps to Reproduce

  1. Use ollama create with a Modelfile that includes a system prompt (For testing one can use something like "You are Benno, a coding assistant" as the prompt).
  2. Select the model in an unconfigured Open-WebUI and ask the assistant who they are, the reply should match the prompt from the modelfile.
  3. Add a Memory (i.e. "I need precise answers and links to official documentation.")
  4. Start a chat again and ask the assistant who they are, the reply will be that they claim to be the base model.

Logs & Screenshots

I've patched my version of Open-WebUI to include additional logging for what the *_system_message_content functions are called with. When I enable memory they get called to replace the system prompt with the memory content:

add_or_update_system_message_content("User Context:\n1. [2025-08-27] I speak German and English, for collaboration reasons continue the conversation in the language that it was started in.\n2. [2025-07-18] I can read and write code in rust,python,bash,lua and C.\n\nImplementations with little dependencies are great.\n3. [2025-05-05] I need precise answers. Link to official documentation.\n\nKeep answers as short as possible, but make them as long as neccessary.\n\nWhen giving examples make sure it matches the question. The shortest examples aren't aleways the best ones.\n\n",...,append=True)

But no other calls to those functions.

Additional Information

No putting the system prompts in Open-WebUI isn't a realistic option for me as that Ollama runner is also used by other frontends which make use of the same models and system prompts.

Originally created by @snmogl on GitHub (Nov 17, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/19243 ### 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.6.36 ### Ollama Version (if applicable) _No response_ ### Operating System unraid ### 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 Using the Memory (User Context) feature doesn't interfere with any default system prompts. ### Actual Behavior Using the Memory (User Context) feature sends a custom system prompt to the ollama API overwriting the system prompt from the modelfile resulting in an agent that now knows some detail about the user, but is completely missing the remainder of its prompting. ### Steps to Reproduce 1. Use `ollama create` with a Modelfile that includes a system prompt (For testing one can use something like "You are Benno, a coding assistant" as the prompt). 2. Select the model in an unconfigured Open-WebUI and ask the assistant who they are, the reply should match the prompt from the modelfile. 3. Add a Memory (i.e. "I need precise answers and links to official documentation.") 4. Start a chat again and ask the assistant who they are, the reply will be that they claim to be the base model. ### Logs & Screenshots I've patched my version of Open-WebUI to include additional logging for what the `*_system_message_content` functions are called with. When I enable memory they get called to replace the system prompt with the memory content: ``` add_or_update_system_message_content("User Context:\n1. [2025-08-27] I speak German and English, for collaboration reasons continue the conversation in the language that it was started in.\n2. [2025-07-18] I can read and write code in rust,python,bash,lua and C.\n\nImplementations with little dependencies are great.\n3. [2025-05-05] I need precise answers. Link to official documentation.\n\nKeep answers as short as possible, but make them as long as neccessary.\n\nWhen giving examples make sure it matches the question. The shortest examples aren't aleways the best ones.\n\n",...,append=True) ``` But no other calls to those functions. ### Additional Information No putting the system prompts in Open-WebUI isn't a realistic option for me as that Ollama runner is also used by other frontends which make use of the same models and system prompts.
GiteaMirror added the bug label 2026-04-25 08:17:24 -05:00
Author
Owner

@tjbck commented on GitHub (Nov 17, 2025):

There isn't a straight forward way to fix this "issue", this will require having a custom model in Open WebUI instead, which can be used via an OpenAI compatible chat completion endpoint.

<!-- gh-comment-id:3544266563 --> @tjbck commented on GitHub (Nov 17, 2025): There isn't a straight forward way to fix this "issue", this will require having a custom model in Open WebUI instead, which can be used via an OpenAI compatible chat completion endpoint.
Author
Owner

@snmogl commented on GitHub (Nov 18, 2025):

Shouldn't it be possible to inject those as other message types?

<!-- gh-comment-id:3548110248 --> @snmogl commented on GitHub (Nov 18, 2025): Shouldn't it be possible to inject those as other message types?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#34348