Keep coding agents from losing context between sessions
You can maintain the context of previous work while switching between multiple AI coding tools. This system automatically stores what an agent learns and the solutions it finds during a session, allowing you to retrieve that information later in a different tool. It runs locally after installation and provides core search functionality without requiring an API key.
Memory that persists across sessions
The tool automatically records events from various coding agents, including Claude Code, Cursor, and Codex CLI. It collects the tasks performed and decisions made by the agent in the background, so users do not need to write manual notes. This data is aggregated into a single repository, ensuring that the same memory is shared regardless of which tool is used. The process also includes automatically removing secret values, such as passwords, to prevent sensitive information from being stored.
Search and restoration methods
Retrieving stored memory uses both keyword search and semantic search. Keyword search via the BM25 algorithm works even without an API key, while enabling a local embedding model allows for more precise semantic search. The retrieved memory is injected into the agent's context, allowing it to reference past mistakes or solutions. You can also view stored content in real time through a browser-based viewer and manage the data by deleting unnecessary memories or exporting them.
Performance and cost comparison
According to official benchmarks, the system achieved a 95.2% retrieval accuracy (R@5) on the LongMemEval-S dataset. This figure is higher than methods using only BM25 and reduces annual token usage by approximately 170K compared to pasting the entire context every time, significantly lowering costs. Using a local embedding model enables semantic search at no additional cost. This efficiency is a significant advantage when maintaining agent memory for long-term projects.
Installation and getting started
Run the npx -y @agentmemory/agentmemory@latest command in a Node.js 20 or higher environment to begin installation. During this process, you select the agent to use and decide whether to use an API key or operate in keyless mode. Once installation is complete, the API server runs on local port 3111 and the live viewer on port 3113. Running the demo command generates a sample session, allowing you to immediately verify that the search functionality is working correctly.
Pre-use considerations
The tool runs locally, and data is stored by default in a specified directory outside the repository. Windows users must use WSL2 or follow native installation instructions, while macOS and Linux require curl and tar. Integrating with specific agents may require additional plugin installation or MCP configuration, so you should refer to the guide for your specific tool. You should also be aware of data backup and upgrade precautions, and it is recommended to specify a separate data storage location for sensitive projects.