mirror of
https://github.com/pocketpaw/pocketpaw.git
synced 2026-05-20 08:49:49 +00:00
Comprehensive SEO optimization across 80 documentation pages: Title optimization (all pages): - Replaced generic titles like "Architecture", "Discord", "Slack" with search-intent titles like "PocketPaw Architecture: Event-Driven Message Bus", "Discord Bot Setup: Add PocketPaw to Your Server" - All titles now 50-70 characters with qualifying keywords Meta descriptions: - Expanded 7 short descriptions (under 145 chars) to 150-160 chars - Roadmap description expanded from 76 to 196 chars - Troubleshooting, Codex CLI, OpenCode, WebMCP all expanded H1 heading fixes: - Ensured single H1 per page matching the frontmatter title - All H1 headings updated to match new optimized titles Internal cross-links: - Added Related CardGroup sections to 60+ individual pages - Each links to 2-3 related pages within and across sections - Channels link to channel guides, backends link to Ollama guide, etc. Em dash cleanup: - Replaced em dashes with colons, periods, or double hyphens across multiple files in tools/, channels/, integrations/ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
97 lines
3.8 KiB
Plaintext
97 lines
3.8 KiB
Plaintext
---
|
|
title: "Memory Isolation: Per-Channel Data Separation"
|
|
description: "PocketPaw isolates memory per user in multi-channel deployments: the owner gets full memory access while external users receive SHA-256 hashed private memory silos for complete data separation."
|
|
section: Memory
|
|
ogType: article
|
|
keywords: ["memory isolation", "multi-user", "per-user memory", "privacy", "data separation", "owner id"]
|
|
tags: ["memory", "security", "multi-tenant"]
|
|
---
|
|
|
|
# Memory Isolation: Per-Channel Data Separation
|
|
|
|
When PocketPaw is connected to shared channels (Discord servers, Slack workspaces, group chats), multiple users interact with the same agent. Memory isolation ensures each user's memories are scoped and private, while the owner gets full access to all stored knowledge.
|
|
|
|
## How It Works
|
|
|
|
### Owner vs External Users
|
|
|
|
PocketPaw distinguishes between two types of users:
|
|
|
|
| Type | Identification | Memory Access |
|
|
|------|---------------|---------------|
|
|
| **Owner** | Matches `owner_id` in settings | Full access to all memories and facts |
|
|
| **External user** | Any other sender | Scoped to their own memory silo |
|
|
|
|
### User ID Resolution
|
|
|
|
When a message arrives from a channel, the system resolves the sender:
|
|
|
|
1. Extract `sender_id` from the inbound message metadata
|
|
2. Compare against the configured `owner_id`
|
|
3. If it matches (or no `owner_id` is set), treat as owner — use the default memory store
|
|
4. If it doesn't match, hash the sender ID with SHA-256 and use a per-user memory silo
|
|
|
|
### Memory Silos
|
|
|
|
External users get isolated storage:
|
|
|
|
```
|
|
~/.pocketpaw/memory/
|
|
├── MEMORY.md ← owner's long-term facts
|
|
├── sessions/ ← owner's session history
|
|
└── users/
|
|
├── a3f8c2d1e9b0.../ ← user 1's memory (hashed ID)
|
|
│ └── MEMORY.md
|
|
└── 7b4e1f9c6a2d.../ ← user 2's memory (hashed ID)
|
|
└── MEMORY.md
|
|
```
|
|
|
|
### Mem0 Isolation
|
|
|
|
When using Mem0 for semantic memory, the `user_id` is passed through to Mem0's storage layer. Each user's memories are tagged with their ID, so semantic search only returns relevant results.
|
|
|
|
## Configuration
|
|
|
|
### Setting Your Owner ID
|
|
|
|
```bash
|
|
export POCKETPAW_OWNER_ID="123456789" # Your Telegram user ID, Discord user ID, etc.
|
|
```
|
|
|
|
The owner ID should match the `sender_id` that your primary channel sends. For Telegram, this is your numeric user ID. For Discord, it's your Discord user ID.
|
|
|
|
## Context Injection
|
|
|
|
The agent's system prompt includes an identity block based on who's messaging:
|
|
|
|
- **Owner**: Gets the full USER.md profile, all long-term facts, and semantic memories
|
|
- **External user**: Gets a neutral identity block and only their own scoped memories
|
|
|
|
This prevents the agent from leaking your personal information (preferences, API keys, project details) to other users who message through shared channels.
|
|
|
|
## What Stays Global
|
|
|
|
Some data is intentionally not scoped per-user:
|
|
|
|
- **Daily notes** — Global operational context
|
|
- **Skills** — Loaded from `~/.claude/skills/` (and legacy paths) for all users
|
|
- **Session history** — Scoped by session key (which already includes channel + chat ID)
|
|
|
|
<Callout type="warning">
|
|
If `owner_id` is not set, all users are treated as the owner and share the same memory store. Set your owner ID when deploying to shared channels.
|
|
</Callout>
|
|
|
|
## Related
|
|
|
|
<CardGroup>
|
|
<Card title="Context Building" icon="lucide:layers" href="/memory/context-building">
|
|
How the context builder uses isolation to inject the right identity block.
|
|
</Card>
|
|
<Card title="Mem0 Integration" icon="lucide:sparkles" href="/memory/mem0">
|
|
Semantic memory with per-user isolation via tagged user IDs.
|
|
</Card>
|
|
<Card title="Security Overview" icon="lucide:shield" href="/security">
|
|
PocketPaw's full security stack including data separation.
|
|
</Card>
|
|
</CardGroup>
|