Files
pocketpaw/docs/memory/sessions.mdx
Prakash 57b807c117 docs(seo): optimize titles, descriptions, headings, and cross-links
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>
2026-03-08 17:41:36 +05:30

99 lines
3.5 KiB
Plaintext

---
title: "Sessions: Conversation History Management"
description: "Sessions are PocketPaw's core conversation units with full lifecycle management: creation, switching, renaming, searching, and deletion. Each channel generates unique session keys for isolation."
section: Memory
ogType: article
keywords: ["sessions", "conversation management", "session keys", "chat history", "session lifecycle"]
tags: ["memory", "sessions"]
---
# Sessions: Conversation History Management
Sessions are the core unit of conversation in PocketPaw. Each session tracks a complete conversation thread with history and metadata.
## Session Lifecycle
1. **Creation** — A new session is created when a user starts a new conversation
2. **Active** — Messages are added as the conversation progresses
3. **Suspended** — The user switches to another session or closes the dashboard
4. **Resumed** — The user returns to a previous session
5. **Deleted** — The user explicitly deletes the session
## Session Keys
Each channel generates unique session keys:
| Channel | Key Format | Example |
|---------|------------|---------|
| Web | Auto-generated UUID | `session_a1b2c3d4` |
| Telegram | `{chat_id}` | `123456789` |
| Telegram Topics | `{chat_id}:topic:{topic_id}` | `123456789:topic:42` |
| Discord | `{channel_id}` or `dm:{user_id}` | `dm:987654321` |
| Slack | `{channel_id}:{thread_ts}` | `C01ABC:1705123456.789` |
| WhatsApp | `{phone_number}` | `+1234567890` |
| Signal | `{phone_number}` | `+1234567890` |
| Matrix | `{room_id}` | `!abc:matrix.org` |
| Teams | `{conversation_id}` | `19:abc@thread.v2` |
| Google Chat | `{space_name}` | `spaces/abc123` |
## Dashboard Session Management
The web dashboard provides full session management:
### Session List
The sidebar shows all sessions grouped by time:
- **Today** — Sessions from today
- **Yesterday** — Sessions from yesterday
- **This Week** — Sessions from this week
- **Older** — Older sessions
### Session Operations
- **New session** — Create a blank conversation
- **Switch session** — Click a session in the sidebar
- **Rename session** — Edit the session title
- **Delete session** — Remove a session
- **Search sessions** — Full-text search across all sessions
### REST API
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/sessions` | GET | List all sessions |
| `/api/sessions/{id}` | DELETE | Delete a session |
| `/api/sessions/{id}/title` | PUT | Rename a session |
| `/api/sessions/search` | GET | Search sessions |
| `/api/sessions/recent` | GET | Get recent sessions |
### WebSocket Actions
| Action | Description |
|--------|-------------|
| `switch_session` | Switch to a session by ID |
| `new_session` | Create and switch to a new session |
| `resume_session` | Resume a session (query param) |
## State Management
The frontend uses a `StateManager` that:
- Caches session data in localStorage for fast switching
- Uses an LRU cache to limit memory usage
- Syncs state between the sidebar and chat area
- Persists the active session ID for page reloads
## Related
<CardGroup>
<Card title="File Store" icon="lucide:database" href="/memory/file-store">
How sessions are stored as JSON files on disk.
</Card>
<Card title="Context Building" icon="lucide:layers" href="/memory/context-building">
How session history is assembled into the agent's context window.
</Card>
<Card title="Memory Isolation" icon="lucide:shield" href="/memory/memory-isolation">
Per-user session scoping for multi-channel deployments.
</Card>
</CardGroup>