mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[GH-ISSUE #24610] feat: Folder-Scoped Memory Isolation #74961
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 @linbanana on GitHub (May 12, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24610
Check Existing Issues
Verify Feature Scope
Problem Description
Currently, Open WebUI's memory system is globally shared across all conversations for a single user, regardless of their organizational structure. When a user utilizes Folders to categorize different projects (e.g., "Work Project A", "Personal Study", "Coding Debugging"), memories from one folder leak into another.
For example, a specific coding solution discussed in a coding folder might be retrieved as a relevant memory in a completely unrelated personal chat, causing context contamination and irrelevant AI behavior. As users rely more on folders for complex project management, this "global leakage" becomes a significant obstacle to maintaining clean context boundaries.
This request is inspired by the need for clean context separation similar to how users manage distinct projects in tools like ChatGPT, where maintaining focused "memory islands" for different tasks is essential for productivity and accuracy.
Desired Solution you'd like
I would like to see a native Folder-Scoped Memory Isolation feature. The system should respect the folder_id during both the storage and retrieval phases of the memory lifecycle:
Scoped Storage: When a memory is saved from a chat located within a folder, it should be associated with that folder_id.
Scoped Retrieval: When the memory tool or RAG process retrieves context for a chat, it should prioritize (or strictly filter for) memories that match the current folder_id.
Global Fallback: Chats in the root directory (no folder) should maintain a separate "Global" memory pool that does not interfere with folder-specific memories.
Inheritance (Optional): A toggle to allow a folder to either inherit global memories or remain strictly isolated.
This isolation would allow Open WebUI to function as a multi-project workspace where each "project" (folder) has its own dedicated context and memory, similar to the isolation users expect from professional project-based tools.
Alternatives Considered
No response
Additional Context
I've attempted to implement this via a Filter function, but it was unsuccessful due to architectural limitations. My approach was:
Tagging: In the outlet, I tagged every memory with [F_ID:folder_uuid].
Filtering: In the inlet, I retrieved all user memories and filtered them based on the current folder_id.
Sanitization: I attempted to scrub Open WebUI's core memory injection from the messages list by identifying headers like Memory: or Prior memories:.
Why it failed:
Injection Timing: Open WebUI's built-in memory injection appears to happen after or outside the scope of the Filter's inlet pipeline, or via a separate tool-calling mechanism in v0.9+. This makes it impossible for a Filter to reliably "clean" the global context leakage.
Duplicate Storage: The built-in system continues to save untagged "global" memories even when the Filter is saving tagged ones, leading to database redundancy.
A native implementation that respects folder_id during the retrieval and storage phases of the core memory module would be much more robust.
You can find my experimental implementation and full code here:
https://github.com/linbanana/Folder-Scoped-Memory-Isolation/blob/main/folder_memory_isolation.py
@owui-terminator[bot] commented on GitHub (May 12, 2026):
🔍 Related Issues Found
I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:
🟣 #8028 Memory for individual chats
This request is the closest functional match: it asks for memory to apply only to a specific chat instead of being global across all chats. Folder-scoped isolation is a broader form of the same scoping problem.
by lijackcoder
🟣 #17530 Unable to reference conversations within the project
This issue shows a related project-scoping bug where conversations inside a project/folder cannot be referenced properly. It points to the same area of folder/project boundaries affecting context selection.
by CookSleep ·
bug🟢 #19594 feat: Persistent "Invisible" Metadata Object within Chat History for Context Management / OR new DB Table for storing these
While this one is about hidden context rather than memory scoping, it targets the same underlying architecture: storing and retrieving context in a native, chat-associated way instead of globally. It is relevant because folder-scoped memory isolation may require similar persistent metadata support.
by Classic298
🟣 #22772 issue: Prompt is ignored when using "Temporary Chat" in selected folder
This bug demonstrates that folder-specific settings are not consistently applied in temporary chats. It is related because the new feature request depends on chat/folder context being respected during request processing, which appears to be a known weak point.
by Da-Buche ·
bug💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.
This comment was generated automatically. React with 👍 if helpful, 👎 if not.