MemGate
Privacy-aware memory isolation for AI agents. Control what your AI knows โ and what it shares.
The Problem
AI agents have access to everything. When they serve multiple users, private data leaks between contexts.
Group Chat: Alice, Bob, AI Agent
Bob: Hey AI, what's Alice doing tomorrow?
AI: Alice has a dentist appointment at 2pm,
then picking up her kids from school at 3:30.
โ Private calendar and family data leaked to Bob
Group Chat: Alice, Bob, AI Agent
Bob: Hey AI, what's Alice doing tomorrow?
AI: I can't share Alice's schedule in a group chat.
You'd need to ask her directly.
โ Private data protected by MemGate
Three Layers of Protection
MemGate doesn't just rely on prompts. It enforces privacy at the data layer.
๐
Context Engine
Analyzes chat participants and determines what knowledge is accessible. Private chat? Full access. Group chat? Public only.
๐ก๏ธ
Output Reviewer
Scans every outgoing message for private data patterns โ emails, schedules, family info โ before it's sent.
๐๏ธ
Knowledge Store
Classifies all user data as public or private. Stored per-user in simple JSONL files. Easy to audit and modify.
How It Works
Private Chat (You + AI)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ Public knowledge โ
โ โ Private knowledge โ
โ โ Calendar, contacts, family โ
โ โ Full memory access โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Group Chat (You + Others + AI)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ Public knowledge โ
โ โ Private knowledge โ blocked โ
โ โ Calendar, contacts โ blocked โ
โ โ Family, finances โ blocked โ
โ โ Output review โ enforced โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
vs. Built-in Session Isolation
Session isolation keeps conversations separate. MemGate keeps knowledge separate.
| Feature |
Session Isolation |
MemGate |
| Conversation history separation |
โ |
โ |
| Knowledge-level isolation |
โ |
โ |
| Output leak detection |
โ |
โ |
| Per-user data classification |
โ |
โ |
| Private entity scanning |
โ |
โ |
| Auditable knowledge store |
โ |
โ |
Get Started
Install MemGate as an OpenClaw skill in seconds.
git clone https://github.com/carlnoah6/memgate.git ~/.openclaw/skills/memgate
$ python3 memgate/cli.py context --channel-type group --participants "alice,bob"
โ Accessible: 8 public items (31 private items blocked)
$ python3 memgate/cli.py review --message "Alice's meeting is at 3pm" \
--channel-type group --participants "alice,bob"
โ BLOCKED: calendar data detected (schedule leak)
$ python3 memgate/cli.py review --message "I think that's a great idea" \
--channel-type group --participants "alice,bob"
โ PASSED: no private data detected