akitaonrails / ai-memory
A long-term memory solution for coding-agent CLIs and handoffs across different agent vendors.
description README.md
Long-term memory for AI coding agents. Quit Claude Code mid-task, start OpenAI Codex in the same directory, continue without re-explaining the architecture, the failed approaches, or the open questions.
Website: aimemory.sh
Why ai-memory
Your coding agent probably has a memory feature already. Claude Code takes its own notes, Cursor remembers some things, and every platform is adding more. They all have the same limits: the notes live on one machine, belong to one agent, and drop out of view when you switch tools or hand the work to a teammate.
ai-memory removes those limits.
-
It follows you across agents. More than twenty harnesses (Claude Code, Codex, Cursor, Gemini CLI, OpenCode, Grok, Devin, Kimi, Kiro, and others) feed one shared memory. Quit Claude Code mid-task, open Codex in the same directory, and the next agent picks up a handoff that says where you left off, what failed, and what is still open. Handoffs are a typed protocol: each one has an owner and is claimed exactly once.
-
It can carry the session, not just a summary. Start agents with
ai-memory run: quit Claude Code, runai-memory run codex, and Codex gets the shared workstream plus a private, temporary local projection of Claude's visible native history for exact details the bounded startup packet omitted. The remote server receives only the harness and session identity, never the local transcript path or body. Direct harness launches behave exactly as before. -
It follows you across projects. A small profile of how you usually work (your package manager, test layout, architecture habits) reaches every new repository at session start, so you stop re-explaining yourself. It sits below each repository's rules file as a default. It is on by default for a single user, and on a shared server it is opt-in and private per person. See
docs/cross-project-profile.md. -
It follows you across machines. Memory lives in a server you run, on the same laptop, a homelab box, or anywhere else, so the project you left on the desktop is the project you resume on the laptop, with the same knowledge and the same open questions.
-
It works for a team. Point everyone at one server, and what one person's sessions learn, everyone's agents can retrieve. Knowledge is shared per project; personal handoffs stay personal. Multi-user auth, per-person attribution, and an audit log are built in and are not a paid tier.
-
Your memory is plain markdown. The source of truth is a git-backed wiki of ordinary
.mdfiles:grepit, open it in Obsidian, edit it by hand,rsyncit. The database is a derived index that can always be rebuilt from the files. There is no vector store to maintain and no content locked in a binary blob. -
It captures the work itself, silently. Lifecycle hooks record what happened (prompts, tool calls, session boundaries), sanitize it at a typed privacy boundary before anything is stored, and the server consolidates it into readable pages. You do not have to ask it to remember anything. The default path uses zero LLM calls: capture, search, and handoffs all work with no API key.
-
It ages memory without an LLM. Memory decays on a schedule you can tune per tier, and memory you use decays slower: opening a page, searching it, or reaching it through a link counts as use. When episodic notes go cold they can be compacted down to their durable facts (file paths, error codes, decisions) instead of dropped. Near-duplicates collapse into one, and likely contradictions get flagged, all with zero API calls. Nothing is hard-deleted: the original stays in git and the version chain (
restore-pagebrings it back). Access-weighted retention is always on because it can only keep memory longer. The parts that rewrite or drop content (compaction, dedup, per-tier curves) stay off by default until you turn them on. -
It can also "dream", if you let it. With an LLM configured, an opt-in background pass rewrites whole clusters of cold notes into single coherent pages while you are idle, and cancels as soon as you come back to work. It never deletes a source (the pre-merge versions stay reachable), it is off by default, and it has to pass a recall eval before it could become default behavior. Unless you ask for more, the zero-LLM path above is what runs.
-
It is honest about itself. It ships as one self-contained binary. Purge commands say exactly what "deleted" means. The write ceiling (~700/s) is measured, not guessed. An audit log records every mutation.
How it works
capture ──▶ consolidate ──▶ recall ──▶ handoff
hooks session-end search next agent,
observe summaries as + brief any harness
silently wiki pages injection
Agents emit sanitized observations through lifecycle hooks as you work. At session end, observations become coherent markdown pages in the project's wiki (optionally LLM-written; useful even without). The next session, in any agent on any machine, gets a bounded brief and can search everything: full-text, entities, links, and (optionally) vectors, fused into one ranking. Cross-agent handoffs pass the baton explicitly.
The full design, including the invariants that keep multi-user and
multi-session use safe, is in docs/ARCHITECTURE.md.
An optional server-rendered management console provides
user administration, session inspection and deletion, and personal MCP API keys.
Build with --features management-ui and start serve --transport http --enable-management-ui; both compile-time and runtime opt-ins are required.
Support matrix
Every row below is a first-party integration (MCP registration, lifecycle
hooks, or both) checked by CI. The full matrix with per-agent notes and
caveats is in docs/support-matrix.md.
| Area | Status |
|---|---|
| Linux | Supported |
| NixOS module | Supported |
| macOS | Supported |
| Windows via WSL2 | Supported |
| Native Windows | Experimental |
| Claude Code | Supported |
| Codex | Supported |
| Command Code | Supported |
| Devin CLI | Supported |
| OpenCode (V1/V2 auto-detected) | Supported |
OpenCode V2 compatibility aliases (opencode2, opencode-v2, open-code2) | Supported |
| Cursor | Supported |
| Gemini CLI | Supported |
| Oh My Pi / OMP | Supported |
| Pi | Supported |
| Crush | Managed-only |
| Managed workstreams | Opt-in |
| Claude Desktop | MCP-only |
| OpenClaw | Supported |
| Antigravity CLI | Supported |
| Grok Build CLI | Supported |
| Swival CLI | MCP-only |
| Zero | Supported |
| ZCode | Supported |
| Kimi Code | Supported |
| Kiro CLI | Supported |
| Pool | Hooks-only |
| GitHub Copilot CLI | Supported |
| Factory Droid | Supported |
| Meta Muse Code | Supported |
| CodeBuddy Code | Hooks-only |
| IBM Bob | Supported |
| VS Code Copilot | MCP-only |
| Zed | MCP-only |
| DeepSeek Harness (DSH) | MCP-only |
| Prime Agent | MCP-only |
| Hermes Agent | Supported |
| GrizzyBot | Supported |
| LLM/auth providers | Supported |
| Embedding providers | Supported |
Coming from another tool?
Most agent-memory tools optimize for one thing: extracting atomic facts per turn, a temporal knowledge graph, an agent-editabl
More in context-memory-knowledge

koala73 / worldmonitor
A real-time global intelligence dashboard that brings together AI-assisted news aggregation, geopolitical monitoring, and infrastructure tracking in one interface.

vectorize-io / hindsight
An agent-memory system designed to help AI agents retain and learn from useful context over time.

Tencent / WeKnora
An open-source knowledge platform that turns raw documents into a queryable RAG system, reasoning agent, and maintained wiki.