PAI Knowledge OS — v0.9.10
Claude Code has a memory problem. Every new session starts cold — no idea what you built yesterday, what decisions you made, or where you left off. PAI fixes this.
Install PAI and Claude remembers. Ask it what you were working on. Ask it to find that conversation about the database schema. Ask it to pick up exactly where the last session ended. It knows.
Quick Start
Tell Claude Code:
Clone https://github.com/mnott/PAI and set it up for me
Or install with a single command:
npx @tekmidian/pai install
Or manually:
1. Install
git clone https://github.com/mnott/PAI
cd PAI
bun install
bun run build
2. Run the setup wizard
pai setup
The wizard walks you through: storage mode (SQLite or PostgreSQL), project directories, Obsidian vault path, MCP server registration, CLAUDE.md template, and daemon configuration. It's idempotent — safe to re-run anytime.
3. Start the daemon
pai daemon start
The daemon runs in the background via launchd, indexing your sessions and serving the MCP tools. It starts automatically on login.
4. Verify
pai daemon status # should show "running"
pai memory search "test" # should return results after indexing
That's it. Claude Code now has persistent memory across all sessions.
Automatic Session Notes — by Topic
PAI's headline feature: every session is automatically documented. No manual note-taking, no "pause session" commands, no forgetting to save what you did.
When you work, a background daemon watches your session continuously. Every time Claude's context compacts — which happens automatically as the conversation grows — the daemon reads the JSONL transcript, combines it with your git history, and spawns a headless Claude process to write a structured session note. Not just at session end. Midway through your work, while you're still coding. The notes build up in real time as you go — what was built, what decisions were made, what problems were hit, what's left to do.
When you change topics mid-session, PAI creates a new note. If you start the day debugging audio, then pivot to a Flutter rewrite, you get two notes — not one giant file mixing unrelated work:
Notes/2026/03/
0001 - 2026-03-23 - Phase 1 Research and Architecture.md
0002 - 2026-03-24 - Background Audio and iOS Conflicts.md
0003 - 2026-03-24 - Flutter Rewrite with Whisper.md ← auto-split, same day
Topic detection uses Jaccard word similarity between the new summary's topic and the existing note's title. Below 30% overlap = new note.
Model tiering: Opus for final session summaries (best quality, runs once). Sonnet for mid-session checkpoints (good quality, runs on compaction). All using your Max plan — no API charges.
This is not a template or a skeleton. These are real notes with build error chronologies, architectural decisions with rationale, code snippets, and "what was tried and failed" sections. The kind of notes you'd write yourself if you had time.
What You Can Ask Claude
Searching Your Memory
- "Search your memory for authentication" — finds past sessions about auth, even with different words
- "What do you know about the Whazaa project?" — retrieves full project context instantly
- "Find where we discussed the database migration" — semantic search finds it even if you phrase it differently
- "Search your memory for that Chrome browser issue" — keyword and meaning-based search combined
Managing Projects
- "Show me all my projects" — lists everything PAI tracks with stats
- "Which project am I in?" — auto-detects from your current directory
- "What's the status of the PAI project?" — full project details, sessions, last activity
- "How many sessions does Whazaa have?" — project-level session history
Navigating Sessions
- "List my recent sessions" — shows what you've been working on across all projects
- "What did we do in session 42?" — retrieves any specific session by number
- "What were we working on last week?" — Claude knows, without you re-explaining
- "Clean up my session notes" — auto-names unnamed sessions and organizes by date
Reviewing Your Work
- "Review my week" — synthesizes session notes, git commits, and completed tasks into a themed narrative
- "What did I do today?" — daily review across all projects
- "Journal this thought" — capture freeform reflections with timestamps
- "Plan my week" — forward-looking priorities based on open TODOs and recent activity
- "What themes are emerging in my work?" — spot patterns across sessions and projects
Sharing Your Work