u/Existing-Ganache-972

Tired of memory leakage between projects? I built a Folder-Scoped Memory Isolation filter for Open WebUI!

Tired of memory leakage between projects? I built a Folder-Scoped Memory Isolation filter for Open WebUI!

Hi everyone,

I've been using Open WebUI's "Personalized Memory" feature, but I found it frustrating that memories are global. If I'm working on a Python project in one folder and then have a casual chat in another, the AI often retrieves unrelated coding snippets, causing serious "context contamination."

To solve this, I built the Folder-Scoped Memory Isolation filter.

Key Features:

📂 Folder Isolation: Memories saved in a folder stay in that folder. Each project gets its own "brain."

💬 Chat Isolation: Even in the Global scope (no folder), memories can be isolated to individual chats.

🧹 Auto-Cleanup (GC): This is my favorite part — when you delete a chat, the filter automatically detects and deletes the "orphaned" memories during your next interaction.

🧠 Smart De-duplication: It knows when the AI is just reciting an existing memory and won't save it again, keeping your database clean.

🌐 Bilingual Support: Full support for both English and Traditional Chinese UI/Status messages.

🛡️ Transparent: It uses internal tags like [F_ID:...] which are automatically stripped before reaching the LLM or the User.

How it works: It intercepts the core memory injection, sanitizes the context, and injects only the memories relevant to your current folder or chat.

Supplemental Link Information

For those interested in the technical details or looking to install the filter, please refer to the following resources:

  1. GitHub Repository:

https://github.com/linbanana/Folder-Scoped-Memory-Isolation-for-Open-WebUI

• This repository contains the complete source code (filter.py). It is a great resource if you want to study how to use Open WebUI’s Filter Pipeline to intercept inlet and outlet data flows.

• Includes detailed setup instructions and developer documentation.

  1. Open WebUI Community Page (Functions/Filters):

https://openwebui.com/posts/folder_scoped_memory_isolation_7f58f346

• The easiest way to get started. You can simply click "Get" on this page to import the filter directly into your Open WebUI instance. You can also find community ratings and reviews here.

  1. GitHub Discussions Thread:

https://github.com/open-webui/open-webui/discussions/24611

• Join the technical conversation regarding memory limitations in Open WebUI. This thread explores the community's demand for better memory management and how this filter serves as a crucial bridge until official native support is expanded.

I’d love to hear your feedback or any feature requests! If you've been struggling with context leakage like I was, give this a try.