Your agents forget everything. Amnesia remembers.
A pi extension that syncs, indexes, and analyzes session data from Claude Code, Pi, and Codex — with semantic search powered by Turso native vectors.
/sync— Incrementally ingests new session files into Turso./analyze [focus]— Asks the active model to analyze patterns in your session history./summarize [filter]— Summarizes recent sessions grouped by project.query_agent_data— A tool for structured queries, text search, semantic search, and read-only SQL.
pi install git:github.com/manusajith/pi-amnesiaturso db create amnesia
turso db show amnesia --url
turso db tokens create amnesiaexport TURSO_URL="libsql://amnesia-<your-org>.turso.io"
export TURSO_AUTH_TOKEN="<your-token>"/sync
Amnesia uses OpenAI embeddings for semantic search.
By default it uses text-embedding-3-small. You can override that with:
export AMNESIA_EMBEDDING_MODEL="text-embedding-3-large"The API key is resolved from Pi's model registry automatically, so you do not need a separate OPENAI_API_KEY when Pi already has an OpenAI provider configured.
If no OpenAI key is available, Amnesia still works — semantic search is disabled and text search remains available.
/sync
Scans:
~/.claude/projects/~/.pi/agent/sessions/~/.codex/archived_sessions/
/analyze
/analyze errors
/analyze tools
/analyze project my-app
/analyze last-week
/analyze agent claude last-month
/summarize
/summarize today
/summarize project my-app
/summarize last-week
Ask things like:
- "What tools do I use most across projects?"
- "Find sessions where I dealt with authentication issues"
- "Show me errors that keep recurring"
- "What did I work on this week?"
When embeddings are available:
- "Find conversations about database migrations"
- "When did I last work on deployment pipelines?"
| Agent | Location | Format |
|---|---|---|
| Claude Code | ~/.claude/projects/**/*.jsonl |
Messages with tool calls and sidechains |
| Pi | ~/.pi/agent/sessions/**/*.jsonl |
Typed event streams |
| Codex | ~/.codex/archived_sessions/*.jsonl |
Session metadata and response items |
projects— unique project paths and extracted repo namessessions— per-conversation metadatamessages— user/assistant/system messages with optional embeddingstool_calls— tool invocations and resultssync_state— per-source sync watermarkinsights— derived analysis data
npm install
npm run check
npm run formatTooling:
- oxlint for linting
- oxfmt for formatting
- tsc for type-checking
- node:test for tests
To support another agent, implement SessionAdapter in extensions/amnesia/lib/adapters/ and register it in extensions/amnesia/lib/sync.ts.
import type { SessionAdapter } from "./types.ts";
export const myAdapter: SessionAdapter = {
name: "my-agent",
async discoverFiles(sinceMs?) {
return [];
},
async parse(filePath) {
return null;
},
};MIT