AgentMemory
An open long-term memory system for AI agents that preserves context between sessions.
Overview
AgentMemory — an open long-term memory system for AI agents that solves the fundamental problem of context loss between sessions. Instead of re-explaining the same details to the agent every time — for example, which authorization middleware you use and why — you set up the environment once, and the agent remembers it forever.
In the second session, the agent already knows that you work with jose, where the tests are located, and what reasons led to choosing this particular library. No copy-paste from previous chats or re-entering context. All necessary information is saved automatically.
How agent memory works
The system is built on hybrid search combining three approaches: BM25, vector search, and a knowledge graph with RRF fusion of results. This allows quickly and accurately finding the needed information in accumulated memory. On the LongMemEval-S benchmark, which includes 500 questions, the system demonstrates high results: R@5 = 95.2% and MRR = 88.2%, while pure BM25 shows 86.2%.
Automatic context capture
Context capture happens through hooks without manual calls and without needing to add anything to prompts. The system itself determines when and what information to save. This is a fully automated process.
AgentMemory Characteristics
| Characteristic | Value |
|---|---|
| Type | Open long-term memory system for AI agents |
| Search mechanisms | BM25 + vector search + knowledge graph with RRF fusion |
| Accuracy (LongMemEval-S, 500 questions) | R@5 = 95.2%, MRR = 88.2% |
| Context capture method | Automatic, via hooks |
| Integration methods | MCP, native plugins, REST API |
| Supported agents | Claude Code, Cursor, Copilot CLI, Codex, Gemini CLI, Aider, Windsurf and others |
| Token savings | 170K tokens per year ($10) vs 19.5M+ with manual approach |
| Local mode | Possible ($0) with all-MiniLM-L6-v2 embeddings |
| Installation | One command via npm or npx |
| Distribution model | Free |
Who is AgentMemory suitable for?
AgentMemory is aimed at developers and teams that actively use AI assistants in their daily work. The tool will be especially useful for those who spend significant time re-explaining context in each new session.
Developers working with AI assistants
If you use Claude Code, Cursor, Copilot CLI, Codex, or other similar tools, AgentMemory will save you from having to describe the project structure, technologies used, and decisions made every time. One server, one memory — shared across all tools at once.
Teams working on long-term projects
In projects where consistency of actions and preserving decision history matter, shared memory becomes critical. AgentMemory preserves context between sessions for all team members working with AI agents.
How to use AgentMemory?
Installation and connection
Installation takes one command via npm or npx. After that, the agent independently downloads instructions, starts the memory server, and connects to it.
Setting up authorization and integration
The tool connects to most popular agents via MCP, native plugins, or REST API. After setting up JWT authorization in the first session, the agent will remember it in all subsequent ones.
Using in local mode
For full autonomy and zero cost, you can use local embeddings based on all-MiniLM-L6-v2. This allows working without external token costs.
Key Features of AgentMemory
Hybrid search. Combining BM25, vector search, and a knowledge graph with RRF fusion ensures high accuracy in finding information in memory.
Automatic context capture. Hooks automatically intercept and save important context without manual calls or prompt changes.
Multi-agent integration. One installation works with all major AI tools simultaneously through different connection protocols.
Persistent storage. Memory is not reset when a new session starts, allowing the agent to use accumulated knowledge.
Advantages of AgentMemory
Token savings. The "paste all context manually" approach consumes 19.5M+ tokens per year and often exceeds the context window. AgentMemory fits in roughly 170K tokens at a cost of about $10 per year — or $0 at all when using local embeddings.
Automated memorization. No need to manually save context or add instructions to prompts — the system does it itself.
Unified storage for all tools. One memory server serves all AI assistants simultaneously, creating a unified knowledge space.
Openness and reproducibility. The project is fully open, benchmarks are reproducible locally, and comparisons with competitors are available in the repository.
Disadvantages of AgentMemory
The main limitation is that full use requires technical skills: you need to configure JWT authorization, understand how hooks work, and how to integrate via MCP or REST API. This is a tool for developers, not end users.
It is also worth noting that accurate performance data on real-world tasks is currently limited to benchmarks — information about behavior in production environments is insufficient in open sources.
What problems does AgentMemory solve?
Eliminating repeated context explanation. The agent remembers all agreements, settings, and decisions between sessions, saving developer time.
Reducing token consumption. Instead of 19.5M+ tokens per year, the system consumes about 170K — 100 times less.
Preventing context window overflow. Manually pasting all context often causes window overflow. AgentMemory stores information efficiently.
Preserving decision history. The knowledge graph stores not only facts but also the connections between them, including the reasons behind decisions.
AgentMemory Pricing
The distribution model is free. This means the tool itself is free of charge. When using built-in embeddings based on all-MiniLM-L6-v2, costs are zero. If you use external APIs for embeddings, the estimated cost is about $10 per year with consumption of approximately 170K tokens — significantly cheaper than the standard approach of manually pasting context.
AgentMemory Terms of Use
The project is distributed as open-source software. Developers can freely study the source code, reproduce benchmarks locally, and compare performance with competing solutions. Comparative data is available in the project repository.
AgentMemory Availability
The tool is available for installation via npm or npx with a single command. It integrates with the following AI agents: Claude Code, Cursor, Copilot CLI, Codex, Gemini CLI, Aider, Windsurf, and others. Connection is done via MCP, native plugins, or REST API — this ensures broad compatibility with existing developer tools.
How AgentMemory differs from alternatives
The key difference is the combination of hybrid search and automatic context capture. Many solutions offer either vector search only or simple databases. AgentMemory combines three approaches (BM25, vector search, knowledge graph), which improves information retrieval accuracy.
The second important difference is versatility. One memory server works with most popular AI agents simultaneously. This eliminates the need to set up separate memory for each tool.
The third difference is cost efficiency. 170K tokens per year vs 19.5M+ with the manual approach — an order-of-magnitude difference. The ability to use local embeddings makes the system completely free.
Finally, the openness of the project allows verifying claimed metrics independently through reproducible benchmarks.
Conclusion
AgentMemory is a practical solution to the problem of context loss in AI agents. It saves developers from having to re-explain project details, automatically preserves context through hooks, and significantly reduces token consumption — about 100 times compared to the manual approach. Hybrid search combining BM25, vector embeddings, and a knowledge graph ensures high accuracy in finding information, confirmed by benchmarks. The open distribution model, support for most popular agents, and the ability to work fully locally make the tool accessible to a wide range of developers. The project looks like a compelling alternative to manual context management and closed solutions.
Frequently asked questions
See also

AI-based platform for creating and editing product images and videos for e-commerce sellers.

Diagram and chart generator from uploaded data based on a natural language text description.

Browser extension and web service with AI assistant features: answering queries, summarizing videos and documents, and translating text.

AI assistant for creating short summaries of videos, PDF documents, and web pages.

A platform for automating software development using a visual builder for AI agents.

Service for generating short vertical videos using a neural network via API or mobile app.

AI assistant for real-time hints during online interviews.

An add-in for Microsoft Word that uses neural networks to automate the creation, editing, and analysis of legal contracts.