Brazilakitaonrails/ai-memory
Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Featured achievements
The project's latest awards
#2 Repository of the month
#2 Repository of the month
#1 Repository of the month
🧠 Long-term memory for AI coding agents
Quit Claude Code mid-task, start OpenAI Codex in the same directory hours later — continue without re-explaining the architecture, failed approaches, or open questions.
ai-memory is a Rust-based persistent memory layer for LLM coding agents. It captures every prompt, tool call, and decision automatically via lifecycle hooks, then at session-end rewrites the relevant pages into a coherent narrative stored as plain markdown in a git repo. When the next agent starts — whether Claude Code, Codex, OpenCode, Cursor, or Gemini CLI — it sees a "where you left off" handoff block before its first prompt. No vector database to babysit, no manual write_note ceremony, no context-loading chore.
✨ Highlights
- Zero-friction capture: lifecycle hooks fire-and-forget every prompt, tool call, and session boundary — you never type
write_note. - Cross-agent handoffs: quit Claude Code mid-task, start Codex in the same directory hours later; the next agent sees a "where you left off" block before its first prompt.
- Per-project isolation: each project lives at
<wiki_root>/<workspace_id>/<project_id>/…keyed by stable UUIDs; worktrees of the same repo share one project identity; a.ai-memory.tomlmarker file overrides either field explicitly. - Karpathy-style LLM wiki: pages compile from observations at session-end (or PreCompact), not retrieved over raw logs; supersession chain plus git-versioned markdown enables time-travel via
ai-memory checkpoints,restore-page, or rawgit log. - Built-in
/webbrowser: read-only HTML UI with project list, folder tree, FTS5 search, markdown rendering, and dark mode — mounted on the same axum server as MCP. - Multi-agent + multi-machine ready: supports Claude Code, Codex, OpenCode, Cursor, Gemini CLI, Antigravity CLI, Grok Build CLI, OpenClaw, Oh My Pi / OMP, Claude Desktop, and VS Code Copilot; server runs local (loopback) or on a homelab box (LAN/VPN/cloud) with bearer-token auth.
- Embedding providers: OpenAI, Voyage, and Google Gemini.
- LLM/auth providers: Anthropic, OpenAI, OpenAI OAuth/Codex, GitHub Copilot, Gemini, OpenAI-compatible endpoints, and generic OIDC device auth for native hooks.
💡 Why it matters
What makes ai-memory different is that it treats memory as infrastructure, not a feature. Instead of agents stuffing context into a window or relying on vector stores that decay and need re-embedding, it builds a git-backed wiki that is grep-able, openable in Obsidian, and backup-able with rsync. The session-end rewrite step turns raw tool calls and prompts into a coherent narrative — so the next agent reads a handoff, not a log dump.
It fits best for teams running multiple AI coding agents across sessions and vendors, especially where continuity between sessions matters more than raw retrieval. The multi-user v0.8 status and shared-server modes with bearer-token auth make it practical for homelab or small-team deployments.
#AI #Rust #OpenSource #AgentMemory #TiniX