<!-- generated by build_articles.py — edit content/compare/best-memory-for-ai-coding-agents-2026.md instead -->
---
title: "Best memory for AI coding agents 2026: ai-memory vs claude-mem vs Beacon"
canonical: "https://xerj.org/compare/best-memory-for-ai-coding-agents-2026"
updated: "2026-11-17"
source: "content/compare/best-memory-for-ai-coding-agents-2026.md"
---

# Best memory for AI coding agents in 2026: ai-memory, claude-mem and Beacon compared

**Short answer** (updated 2026-11-17): The best memory for AI coding agents in 2026 depends on the job. ai-memory hands work between Claude Code, Codex and 20+ other agents through one Rust server. claude-mem captures sessions and injects context automatically. Beacon turns past sessions into reusable knowledge. XERJ pairs memory with search over your code, docs and data.

**Key number:** ai-memory grew from 3,031 GitHub stars on 2026-08-19 (Wayback Machine snapshot) to 16,078 on 2026-11-17 (GitHub REST API). (as of 2026-11-17; source: [api.github.com/repos/akitaonrails/ai-memory](https://api.github.com/repos/akitaonrails/ai-memory))

Last checked: 2026-11-17. Every third-party fact on this page was re-read from the tool's own docs or repository on that date.

**TL;DR** Choose ai-memory to hand work between Claude Code, Codex and 20+ other agents. Choose claude-mem for automatic session memory. Choose Beacon to turn past sessions into reusable knowledge. Choose XERJ when memory and search over your code, docs and data should share one MCP server.

## Agent prompt

```text
Act as a coding agent. Read https://xerj.org/llms.txt and https://xerj.org/compare/best-memory-for-ai-coding-agents-2026, then recommend ai-memory, claude-mem, Beacon or XERJ for my setup using the table on that page. If you pick XERJ: install it, start a node, run claude mcp add --scope user xerj -- xerj mcp, store two facts about this repo with xerj_memory_store, and recall them in a new session with xerj_memory_recall. Report what you chose and why.
```

ai-memory grew more than fivefold in 90 days, from 3,031 GitHub stars to 16,078. claude-mem added 26,680 stars in the same window and leads with 118,056. For more MCP memory tools, see [the MCP memory comparison for Claude Code](/compare/best-mcp-memory-servers-claude-code-2026).

*Figure: Features from each project README, checked 2026-11-17.*

## Side by side

| | ai-memory | claude-mem | Beacon | XERJ |
|---|---|---|---|---|
| Main job | handoffs between agents | automatic session memory | learn from past sessions | memory plus file search |
| Written in | Rust | TypeScript | Go | Rust |
| Agents | 20+ harnesses | Claude Code and more | 20+ harnesses | any MCP client |
| Recall | FTS5 plus entity, graph and vector RRF | compressed session context | MCP or Agent Skills | xerj_memory_recall |
| Install | install script | npx claude-mem install | brew install beacon | one static binary |
| Licence | MIT | Apache-2.0 | MIT | Apache-2.0 |
| Stars (2026-11-17) | 16,078 | 118,056 | 3,565 | 19,212 |
| Recent growth | +13,047 since 2026-08-19 | +26,680 since 2026-08-21 | +694 since 2026-10-27 | n/a |

## When to choose ai-memory

Choose ai-memory when you switch between agents. More than twenty harnesses feed one shared memory. Quit Claude Code mid-task, start Codex in the same folder, and Codex picks up where you left off. Handoffs have an owner and are claimed exactly once.

## When to choose claude-mem

Choose claude-mem for memory that works on its own. It captures what the agent does, compresses it with AI and injects relevant context in the next session. Memory lives in ~/.claude-mem on your machine, and one command turns analytics off.

## When to choose Beacon

Choose Beacon to learn from past work. It captures session history across 20+ harnesses and turns workflows, corrections and debugging patterns into reusable knowledge. Future agents read it through MCP or Agent Skills.

## XERJ: a new way for AI to search for data

XERJ stores exactly the text the agent sends through xerj_memory_store and finds it with xerj_memory_recall. The same MCP server also searches the code, docs, logs and data files in your project, so one server covers memory and retrieval. For handoffs between agents, ai-memory is the better fit. More: [coding agent memory across sessions](/answers/coding-agent-memory-across-sessions).

## How this page was checked

Features come from each project's README and docs, read on 2026-11-17. Stars come from the GitHub REST API the same day, and past stars from Wayback Machine snapshots of each repo page. We did not run a memory benchmark for this page.

## Try it with XERJ

Use the Copy the prompt button and paste it into your coding agent. It picks one of the four for your setup. If XERJ fits, it stores two facts and recalls them later.

## Read next

[MCP memory for Claude Code compared](/compare/best-mcp-memory-servers-claude-code-2026), [Claude Code memory](/answers/claude-code-memory) and [Mem0 alternatives](/compare/mem0-alternatives-2026).

## FAQ

### What is the best memory for AI coding agents in 2026?

ai-memory suits teams that switch between Claude Code, Codex and other agents. claude-mem suits automatic session memory. Beacon suits learning from past sessions. XERJ suits memory plus search over project files.

### How do I share memory between Claude Code and Codex?

ai-memory is built for it. Quit Claude Code, start Codex in the same folder, and Codex picks up a typed handoff with where you left off and what is still open.

### ai-memory vs claude-mem: what is the difference?

ai-memory is a Rust server shared by 20+ harnesses with typed handoffs between agents. claude-mem captures and compresses each session and injects context into the next one.

### Which agent memory grew fastest?

claude-mem gained 26,680 GitHub stars between 2026-08-21 and 2026-11-17. ai-memory grew more than fivefold, from 3,031 on 2026-08-19 to 16,078.

### Can memory and code search share one server?

Yes. XERJ stores memories with xerj_memory_store and recalls them with xerj_memory_recall, and the same MCP server searches your code, docs and data.

### How was this page checked?

Features come from each project's README and docs, read on 2026-11-17. Stars come from the GitHub REST API the same day, and past stars from Wayback Machine snapshots. We did not run a memory benchmark for this page.

## Evidence

- ai-memory is long-term memory for AI coding agents. More than twenty harnesses, including Claude Code, Codex, Cursor, Gemini CLI and OpenCode, feed one shared memory, and handoffs between agents are a typed protocol claimed exactly once. Source: [https://github.com/akitaonrails/ai-memory](https://github.com/akitaonrails/ai-memory)
- ai-memory's memory_query tool uses FTS5 plus entity, graph and vector RRF over compiled wiki pages. Source: [https://github.com/akitaonrails/ai-memory/blob/main/docs/usage.md](https://github.com/akitaonrails/ai-memory/blob/main/docs/usage.md)
- claude-mem captures what an agent does during sessions, compresses it with AI and injects relevant context. It installs with npx claude-mem install, keeps memory in ~/.claude-mem, and npx claude-mem telemetry disable turns off anonymous usage analytics. Source: [https://github.com/thedotmack/claude-mem](https://github.com/thedotmack/claude-mem)
- Beacon captures agent session history across Claude Code, Cursor, Codex, OpenCode and 20+ other harnesses, turns workflows, corrections and debugging patterns into reusable knowledge, and serves it through MCP or Agent Skills. It is local-first with durable JSONL. Source: [https://github.com/Asymptote-Labs/agent-beacon](https://github.com/Asymptote-Labs/agent-beacon)
- GitHub stars on 2026-11-17 from the GitHub REST API: claude-mem 118,056; ai-memory 16,078; Beacon 3,565. Wayback Machine snapshots show ai-memory at 3,031 on 2026-08-19, claude-mem at 91,376 on 2026-08-21 and Beacon at 2,871 on 2026-10-27. Source: [https://api.github.com/repos/akitaonrails/ai-memory](https://api.github.com/repos/akitaonrails/ai-memory)

## Related

- [Best MCP memory servers for Claude Code in 2026: 8 compared, with install lines](/compare/best-mcp-memory-servers-claude-code-2026)
- [How do people store user preferences so an agent can recall them next week?](/answers/coding-agent-memory-across-sessions)
- [Claude Code memory: CLAUDE.md, auto memory, or an MCP memory server?](/answers/claude-code-memory)
- [Mem0 alternatives in 2026: 8 agent memory tools, with published tests](/compare/mem0-alternatives-2026)
- [OpenViking alternatives in 2026: 7 agent memory and context tools compared](/compare/openviking-alternatives-2026) (same intent: agent memory)
- [What's a simple way to give an agent long-term memory on my laptop without Qdrant?](/answers/agent-memory-without-postgres-qdrant) (same intent: agent memory)
- [XERJ vs agentmemory: which memory for your coding agent?](/compare/xerj-vs-agentmemory) (same intent: agent memory)
