mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[GH-ISSUE #18603] feat: Add Memory (experimental) as a capability that can be disabled per agent #18650
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 @vk2r on GitHub (Oct 24, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/18603
Check Existing Issues
Problem Description
I have noticed that some agents are indiscriminately using information stored in memory without being asked to do so.
I would like to be able to disable an agent’s ability to retrieve information from memory, in order to have more fine-grained control over what is provided to the LLM.
Desired Solution you'd like
I would like to have the option to enable or disable the memory feature.
Alternatives Considered
No response
Additional Context
No response
@rgaricano commented on GitHub (Oct 24, 2025):
@vk2r
Hola Victor,
A way to do that without main code changes is with a tool.
Disabling the memory feature in settings and using a tool (model callable) to do the management, and prompting the model how or when it can read/write memories.
Also the tool can have specific instructions or valves...
You can try with a tool like this: Memory_Manager_Tool.py
(I generate it but I haven't been able to test and debug properly; I want to finish other things first.)
Test it, let me know, and we'll improve it.
Memory_Manager_Tool
The tool provides two functions that the model can call:
When you enable this tool in a chat, the model will see these functions in its tool specifications and can decide when to call them based on the conversation context.
The tool execution happens through chat_completion_tools_handler() in the middleware, giving the model explicit control over memory operations.
How to Use
Create the tool: Go to Workspace → Tools → Create New Tool
Paste the code above into the tool editor
Save the tool - it will be registered in the tools system
Disable automatic memory injection in Settings → Personalization → Memory
Enable the tool in your chat by selecting it from the tools dropdown
Salu2
@vk2r commented on GitHub (Oct 24, 2025):
Thank you very much for the solution. However, I was wondering if this could be integrated as an agent option in the future.
I think it is important that an option provided by the same platform be managed by options found on the same platform and not by external tools.
PS: I got the following error when creating the function in OpenWebUI:
@rgaricano commented on GitHub (Oct 24, 2025):
Is not a function, it's a tool (to be added in workspace tools)
Yes, when memories are enabled all memories are inyected in the context, ....
I tried similar thing as you ask (a toggle button) with an action function it seem that work ( I left in the middle of debug it, the changes of the memory states isn't refreshed/reflected in the settings)
@rgaricano commented on GitHub (Oct 24, 2025):
and this is other tool that also I have on dev, trying to implement a memory toggle (& solve the refresh state):
@vk2r commented on GitHub (Oct 24, 2025):
PS: False alarm. My mistake. I was still testing the feature you gave me.
PS: Do you think this toggle will be implemented natively at some point?
@rgaricano commented on GitHub (Oct 24, 2025):
Maybe, this feature (memory) is as "experimental"