ai-memory is an open-source long-term memory layer for agent coding CLIs. Its core promise is practical: stop losing context when you quit Claude Code, switch to Codex, or hand off a repository to another agent. Instead of asking every new assistant to rediscover the architecture, failed attempts, open questions, and prior decisions, ai-memory stores session context and exposes it back through CLI, MCP, hooks, and managed run commands.
The project is written in Rust and targets builders who already use AI coding agents across real codebases. The README documents support for Linux, macOS, WSL2, native Windows experiments, Claude Code, Codex, Command Code, Kiro, and other MCP-speaking clients. That makes it especially relevant for teams with mixed agent vendors or developers who alternate between tools during a long task. The repository also describes lifecycle hooks, final-session summaries, capture exclusions, session-aware MCP setup, and portable handoff flows.
A typical workflow starts by installing the binary or Docker wrapper, initializing a data directory and config file, enabling a local service where appropriate, and installing MCP or hooks for the target agent. From there, commands such as ai-memory run, ai-memory continue, ai-memory show, install-mcp, install-hooks, and finalize-session help manage the memory lifecycle. The project is explicit that some platforms have different capabilities, so the support matrix matters before rollout.
The main benefit is continuity. Agent work often fails because the useful context is scattered across terminal output, chat windows, git diffs, and partial experiments. ai-memory gives that context a local system of record that can be reused by multiple clients. It is not a replacement for source control or documentation, but it can reduce repeated explanations and make a clean handoff between models or vendors less painful.
ai-memory is MIT-licensed and free to use, with costs limited to your own compute, storage, Docker runtime, and any AI tools you connect. It is best for power users and teams already comfortable with local services and CLI configuration. Casual users may find the setup heavier than a built-in chat history, but serious agent-coding workflows benefit from the explicit memory and handoff model.
For evaluation, install it on one test repository first and verify what gets captured, what is excluded, and how each agent client reads the memory back. Teams should document their retention policy before using memory tools on sensitive code. Once those rules are clear, ai-memory can become a practical shared context layer for longer agent tasks.