akitaonrails/ai-memory
The core problem ai-memory solves is embarrassingly concrete: every time you end an LLM coding agent session, the context evaporates. Start a new session in the same agent, let alone a different one, and you're re-explaining architecture decisions, failed approaches, and open questions from scratch. This tool attacks that problem with a persistent, git-versioned markdown wiki compiled from sanitized lifecycle observations - hooks fire at session boundaries, tool calls, and compaction checkpoints, and the server assembles those observations into coherent pages rather than dumping raw logs.
The design choice that matters most here is the compile-not-retrieve pattern, credited explicitly to Karpathy's LLM Wiki notes. Observations become consolidated pages; the next agent receives a bounded handoff document, not a firehose of chat history. That distinction keeps context windows manageable and makes the wiki useful for humans too - it's plain markdown, greppable, renderable in Obsidian, and backed up with rsync. No vector database required, though optional embedding providers (OpenAI, Voyage, Gemini, or keyless OpenAI-compatible endpoints like Ollama) can layer vector retrieval on top of the default FTS5 plus entity-match plus graph-neighbor RRF pipeline.
The agent support matrix is genuinely wide: Claude Code, Codex, Command Code, Devin CLI, OpenCode, Cursor, Gemini CLI, Kimi Code, Kiro CLI, Grok Build CLI, and more, each with their own lifecycle hook quirks accounted for. Some agents don't expose a true session-end hook, so the README documents exactly which ones need a manual ai-memory finalize-session call. That kind of per-harness honesty about limitations is more useful than a clean compatibility table that papers over edge cases.
The optional managed workstream feature goes further than handoffs: ai-memory run claude, then ai-memory run codex --yolo, and the tool transparently resumes one logical workstream with native per-harness sessions and a portable visible-event ledger. This is the difference between a summary handoff and actual continuity - the ledger preserves the sequence of events, not just a digest.
Retrieval has some thought behind it. Entity-assisted recall stores up to 10 specific nouns per page in frontmatter and uses lexical matching to recover pages even when query wording diverges from page wording - no extra LLM call at query time. An authority-aware ranking system gives maintained rules, decisions, procedures, and gotchas pages a retrieval advantage over episodic session evidence, while still allowing targeted history searches to find session pages. The README is careful to note that retrieved text remains untrusted historical evidence regardless of its namespace or rank - a meaningful constraint given that agents might otherwise treat memory contents as instructions.
The zero-LLM mode is a real feature, not a footnote. FTS5 search, rule-based summarization, and manually declared entities all work without any API key. LLM consolidation, richer linting, and bootstrap are opt-in additions. For teams running this on a homelab box, the multi-user attribution system (per-operator memory slots, OIDC device auth, four-rung auth ladder) covers shared deployments without requiring per-page RBAC.
Built in Rust, single binary, SQLite for indexes, markdown on disk. The architecture is deliberately boring in the right ways.
A persistent cross-agent memory layer that compiles session observations into a git-versioned wiki rather than replaying raw logs - boring architecture, genuinely useful problem.