mirror of
https://github.com/pocketpaw/pocketpaw.git
synced 2026-05-21 17:24:57 +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>
100 lines
2.8 KiB
Plaintext
100 lines
2.8 KiB
Plaintext
---
|
|
title: "File Store: Local JSON-Based Memory Backend"
|
|
description: "PocketPaw's default file store saves conversations as JSON in ~/.pocketpaw/memory/ with an indexed session catalog, atomic writes, full-text search, and automatic migration from legacy formats."
|
|
section: Memory
|
|
ogType: article
|
|
keywords: ["file store", "json storage", "session index", "atomic writes", "conversation history"]
|
|
tags: ["memory", "storage"]
|
|
---
|
|
|
|
# File Store: Local JSON-Based Memory Backend
|
|
|
|
The file store is PocketPaw's default memory backend. It stores sessions as JSON files in `~/.pocketpaw/memory/`.
|
|
|
|
## Directory Structure
|
|
|
|
```
|
|
~/.pocketpaw/memory/
|
|
├── _index.json # Session index
|
|
├── session_abc123.json # Session files
|
|
├── session_def456.json
|
|
└── ...
|
|
```
|
|
|
|
## Session Index
|
|
|
|
The `_index.json` file provides fast lookups:
|
|
|
|
```json
|
|
{
|
|
"session_abc123": {
|
|
"title": "Python prime number script",
|
|
"created_at": "2024-01-15T10:30:00Z",
|
|
"updated_at": "2024-01-15T11:45:00Z",
|
|
"message_count": 12,
|
|
"channel": "web"
|
|
}
|
|
}
|
|
```
|
|
|
|
### Index Features
|
|
|
|
- **Atomic writes** — Uses write-then-rename to prevent corruption
|
|
- **Auto-rebuild** — If `_index.json` is missing or corrupted, it's rebuilt from session files
|
|
- **Migration support** — Automatically indexes pre-existing sessions
|
|
|
|
## Session Format
|
|
|
|
Each session is a JSON file:
|
|
|
|
```json
|
|
{
|
|
"session_id": "session_abc123",
|
|
"messages": [
|
|
{
|
|
"role": "user",
|
|
"content": "Write a Python script for prime numbers",
|
|
"timestamp": "2024-01-15T10:30:00Z"
|
|
},
|
|
{
|
|
"role": "assistant",
|
|
"content": "Here's a Python script that checks for prime numbers...",
|
|
"timestamp": "2024-01-15T10:30:15Z"
|
|
}
|
|
],
|
|
"facts": [
|
|
"User prefers Python",
|
|
"User is on Linux"
|
|
],
|
|
"metadata": {
|
|
"channel": "web",
|
|
"agent_backend": "claude_agent_sdk"
|
|
}
|
|
}
|
|
```
|
|
|
|
## Facts Extraction
|
|
|
|
The file store automatically extracts key facts from conversations (e.g., user preferences, system details) and stores them in the session's `facts` array. These facts are loaded into context for future conversations.
|
|
|
|
## Storage Considerations
|
|
|
|
- Each session is a separate file for simple backup and cleanup
|
|
- No database required — just filesystem operations
|
|
- Suitable for single-user, moderate-volume usage
|
|
- For heavy usage, consider enabling Mem0 for semantic search
|
|
|
|
## Related
|
|
|
|
<CardGroup>
|
|
<Card title="Mem0 Integration" icon="lucide:sparkles" href="/memory/mem0">
|
|
Add semantic long-term memory with auto-learning and vector search.
|
|
</Card>
|
|
<Card title="Sessions" icon="lucide:history" href="/memory/sessions">
|
|
Session lifecycle management, keys, and dashboard operations.
|
|
</Card>
|
|
<Card title="Context Building" icon="lucide:layers" href="/memory/context-building">
|
|
How stored memories are assembled into the agent's context window.
|
|
</Card>
|
|
</CardGroup>
|