OpenClaw Skill ยท Open Source

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.

Without MemGate
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
With MemGate
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
CLI Usage
$ 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