<!-- generated by build_articles.py — edit content/compare/xerj-vs-claude-mem-and-mempalace.md instead -->
---
title: "MemPalace vs claude-mem (2026): Claude Code memory compared"
canonical: "https://xerj.org/compare/xerj-vs-claude-mem-and-mempalace"
updated: "2026-11-14"
source: "content/compare/xerj-vs-claude-mem-and-mempalace.md"
---

# MemPalace vs claude-mem (and XERJ): which memory should Claude Code use?

**Short answer** (updated 2026-11-14): Should I use claude-mem, MemPalace or XERJ for Claude Code memory? Use claude-mem for automatic, model-written session summaries. Use MemPalace to keep every conversation word for word, saved by hooks. Use XERJ when you want the agent to choose what to save, and one local engine for memory, logs, docs and code.

**TL;DR** MemPalace vs claude-mem comes down to one choice: keep every word, or keep short summaries a model writes. All three tools here give Claude Code memory that lasts across sessions. claude-mem saves on its own and has a model write short summaries. MemPalace saves every word on its own and searches it by meaning. XERJ saves only what the agent chooses, through MCP tools, in a local engine that also searches your other data.

## Agent prompt

```text
Act as a coding agent. Read https://xerj.org/llms.txt, install XERJ, start a local node, run claude mcp add xerj -- xerj mcp, then in a new Claude Code session store two facts about this repo with xerj_memory_store and recall them in a third session with xerj_memory_recall, and report what came back.
```

The right pick depends on who decides what is saved, and whether a model is allowed to compress it. The sections below walk through that split, then a picker helps you choose. Numbers that follow come from each project's README, read on 2026-10-30, and from our own 75-question memory test. We did not rerun MemPalace's LongMemEval score.

*Figure: claude-mem and MemPalace save on their own through hooks; XERJ saves only when the agent calls a tool. claude-mem has a model write summaries; MemPalace and XERJ keep the original text. Read from each project's README on 2026-10-30.*

## Side by side

Read from each project's README and the XERJ source on 2026-10-30. Our [agent memory benchmark](/compare/ai-agent-memory-benchmark) has MemPalace results. It has none for claude-mem, which has no standalone store to call.

| | claude-mem | MemPalace | XERJ |
| --- | --- | --- | --- |
| How it saves | Lifecycle hooks, automatic | Hooks, periodically and before compaction | The agent calls `xerj_memory_store` |
| What it keeps | Model-written observations and summaries | Original text, word for word | The text the agent sends |
| Model on write | Yes: hosted observer, your key, or your Anthropic plan | No, in raw mode | No |
| Search | SQLite FTS5 plus Chroma | ChromaDB by default; other backends | BM25 by default; semantic or hybrid in neural mode |
| How it recalls | Context at session start, plus MCP search | MCP tools and a recall skill | MCP `xerj_memory_recall` or HTTP |
| Runtime | Bun worker | Python package | One binary |
| Other agents | Codex, OpenCode and others | Codex CLI and Cursor hooks | Any MCP client or HTTP caller |
| License | Apache 2.0 | MIT | Apache 2.0 |

## Find your fit

*Figure: Runs in your browser and sends nothing. Each answer adds a point to the tools it matches; the highest total is highlighted. It is a rule of thumb from the designs above, not a benchmark.*

## claude-mem in short

claude-mem installs hooks for every stage of a Claude Code session. A model reads what happened and writes compact observations, stored in SQLite with full-text search and in Chroma for vectors. At the next session start it adds relevant context by itself, so you do not have to ask.

That model call is the trade. The installer offers a hosted observer with a 30 day free trial, or `--provider` to use your own key or Anthropic plan. You get memory that works without the agent thinking about it, and you accept that a model decides what is worth keeping.

Pick it when you want automatic, model-written session summaries, and you are comfortable with that write-time model call.

## MemPalace in short

MemPalace keeps the conversation as written, with no summarizing. It organizes text into wings, rooms and drawers so searches can be scoped. ChromaDB is the default backend and others can be plugged in. Its README reports 96.6% R@5 on LongMemEval in raw mode with no API calls. That is the project's own number. We did not rerun LongMemEval.

Our benchmark gave every system the same 85 memories and 75 questions. MemPalace 3.11.0 at its defaults found the right memory in the top 5 for 84.0% of questions and 56% of reworded ones. XERJ semantic recall, with the same MiniLM model, found 94.7% and 84%. MemPalace's median query took 22.7 ms and XERJ's 6.3 ms. Those figures are in `benchmarks/agent-memory/out/summary.csv`.

Pick it when you never want a model to decide what to forget, and you want every word kept.

## XERJ in short

XERJ is a local search engine with a memory API. The agent stores a memory by calling a tool and recalls it the same way. Recall is BM25 by default, with semantic and hybrid modes. Because it is a full search engine, the same node can index your logs, docs, code and [past Claude Code sessions](/answers/search-claude-code-past-sessions).

Limits to know: it saves nothing unless the agent asks, it runs on one node with no replication, and namespaces isolate by name, not by credential. For the broader idea, see [what an MCP memory server is](/answers/what-is-an-mcp-memory-server), [what agentic memory is](/answers/what-is-agentic-memory), and [Claude Code memory](/answers/claude-code-memory) for the built-in options that come first.

Pick it when you want the agent to choose what to save, and one local engine for memory and the rest of your data.

## How to try it with XERJ

Use the Copy the prompt button and paste it into Claude Code. It installs XERJ, adds it as an MCP tool and tests store and recall across sessions. To add it by hand:

```bash
curl -fsSL https://xerj.org/get | sh
claude mcp add xerj -- xerj mcp
```

## Sources checked

All checked on 2026-10-30.

- claude-mem README, [thedotmack/claude-mem](https://github.com/thedotmack/claude-mem): hooks, worker, SQLite FTS5, Chroma, observer and provider options. License Apache 2.0.
- MemPalace README, [MemPalace/mempalace](https://github.com/MemPalace/mempalace): verbatim storage, ChromaDB default, pluggable backends, hooks, LongMemEval R@5. License MIT.
- XERJ: `engine/crates/xerj-api/src/memory_api.rs` and `engine/crates/xerj-mcp/src/lib.rs`.

## FAQ

### What is the difference between claude-mem and MemPalace?

claude-mem has a model compress each session into short observations and adds them at the next session start. MemPalace stores the conversation word for word and finds it with search, with no summary step.

### Does claude-mem need a paid service?

Its installer offers a hosted observer with a 30 day free trial. You can instead pass a --provider flag to use your own OpenRouter or Gemini key, or your Anthropic plan.

### Is MemPalace's 96.6% score independent?

No. MemPalace reports 96.6% R@5 on LongMemEval in raw mode in its own README. We did not rerun LongMemEval. On our own 75 question test at default settings, MemPalace 3.11.0 found the right memory in the top 5 for 84.0% of questions.

### How is XERJ different from both?

XERJ has no hooks. The agent saves and recalls through MCP tools when it decides to. The same local engine also searches logs, docs, code and past session files.

### Can I use more than one?

Yes. They are separate tools or plugins. Running two memory systems means two places to check, so start with one.

### Which is the best MCP memory server for Claude Code?

It depends on what you want saved and who decides. Use the picker on this page, then try your choice for a week.

## Evidence

- MemPalace 3.11.0 at defaults: top 5 84.0%, reworded questions 56%. XERJ semantic: 94.7%, reworded 84%. Source: `benchmarks/agent-memory/out/summary.csv`
- The MemPalace README reports 96.6% R@5 raw on LongMemEval with zero API calls. Source: [https://github.com/MemPalace/mempalace](https://github.com/MemPalace/mempalace)

## Related

- [AI agent memory benchmark 2026: real tests on 7 open-source projects](/compare/ai-agent-memory-benchmark)
- [What is an MCP memory server?](/answers/what-is-an-mcp-memory-server)
- [Claude Code memory: CLAUDE.md, auto memory, or an MCP memory server?](/answers/claude-code-memory)
- [Claude Code search conversation history](/answers/search-claude-code-past-sessions)
- [How to use agentic memory in XERJ](/answers/what-is-agentic-memory)
- [XERJ vs Mem0: which memory fits your AI agent?](/compare/xerj-vs-mem0)
- [How do people store user preferences so an agent can recall them next week?](/answers/coding-agent-memory-across-sessions)
- [Best MCP memory servers for Claude Code in 2026: 8 compared, with install lines](/compare/best-mcp-memory-servers-claude-code-2026) (same intent: agent memory)
- [Mem0 vs Zep vs Letta vs Cognee: which agent memory framework fits in 2026?](/compare/xerj-vs-agent-memory-tools) (same intent: agent memory)
- [XERJ vs mcp-memory-service: two MCP memory servers, tested](/compare/xerj-vs-mcp-memory-service) (same intent: agent memory)
