akitaonrails/ai-memory
The problem ai-memory solves is embarrassingly concrete: every time you end a coding agent session, the context dies. Start a new session in a different tool and you're back to re-explaining the architecture, the dead ends, the open questions. ai-memory treats this as an infrastructure problem rather than a prompting problem.
The mechanism is a local MCP server backed by a SQLite database and a plain markdown wiki in a git repository. Lifecycle hooks fire at session boundaries - start, end, compaction checkpoints - and POST sanitized observations to the server. When a session closes, those observations get compiled into coherent wiki pages. The next agent session receives a bounded handoff before its first prompt. The wiki itself is just files: greppable, viewable in Obsidian, version-controlled, restorable page by page with ai-memory restore-page.
The support matrix is genuinely wide. Claude Code, Codex, Cursor, Gemini CLI, Devin CLI, Command Code, Kiro CLI, Kimi Code, OpenCode, Grok Build CLI, and a dozen others all have first-party MCP config and lifecycle hook installers. The install commands are idempotent and write timestamped backups before touching config files. A few agents - VS Code Copilot, Zed, Claude Desktop - get MCP only because they don't expose lifecycle hooks yet.
The optional ai-memory run managed workstream mode goes further than handoffs. It wraps the agent launch, maintains a portable visible-event ledger, and handles native session resume per harness. Quit Claude Code mid-task, run ai-memory run codex --yolo in the same directory, and the new session picks up with native Codex session state plus the cross-harness history. ai-memory continue with no arguments finds the most recently used managed checkout and resumes it without requiring you to remember where it lives.
Retrieval combines FTS5 full-text search, entity matching (up to 10 canonical nouns stored in page frontmatter), graph-neighbor expansion, and optional vector similarity if you configure an embedding provider. An authority-aware ranking pass nudges maintained rules, decisions, and gotchas pages above raw session evidence before truncation - without making that preference absolute, so targeted history searches still surface session pages. The LLM is entirely optional: zero-LLM mode still gives you search, rule-based summaries, and handoffs.
Security defaults are sensible. The server binds to loopback only with no authentication, which is safe for a single-user laptop. Non-loopback without a bearer token now fails closed. HTTPS is deliberately delegated to a reverse proxy, with copy-paste Caddy and Cloudflare Tunnel compose templates provided. Multi-user attribution landed in v0.8: each developer gets their own token, writes are attributed in audit logs and page frontmatter, but data remains single-tenant with no per-page RBAC.
The codebase is a single Rust binary. The acknowledgements section is candid that it was built collaboratively with Claude Code itself, following a design document committed to the repo. The prior art section credits Karpathy's compile-not-retrieve pattern, agentmemory, basic-memory, cognee, Hermes Agent, and A-MEM explicitly - which is more intellectual honesty than most tools in this space manage.
A Rust MCP server that compiles agent session observations into a git-versioned markdown wiki and hands context forward across agent switches, with no vector database required.