COMPARE · COMPARISON: AGENT MEMORY

claude-mem vs MemPalace vs XERJ: which memory should Claude Code use?

AUTHOR · XERJ documentation team · REVIEWED BY · XERJ engineering team · PUBLISHED · 2026-10-30 · UPDATED · 2026-10-30
SHORT ANSWER · UPDATED 2026-10-30

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 All three 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.

Diagram

Three designs for a coding agent's memory

claude-mem captures session events with hooks, has a model write observations, stores them in SQLite and Chroma, and adds context at the next session start. MemPalace saves transcripts word for word through hooks into ChromaDB and recalls by search. XERJ waits for the agent to call store or recall over MCP and keeps memories in a local index. claude-mem Hooks capture Model summarizes SQLite + Chroma Context at next start MemPalace Hooks save Word for word ChromaDB MCP search XERJ Agent calls store Text as sent Local index MCP recall BM25 / hybrid
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.
PASTE THIS TO YOUR AI AGENT — IT DOES THE REST 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.

Side by side

Read from each project's README and the XERJ source on 2026-10-30. We did not run a head-to-head benchmark.

claude-memMemPalaceXERJ
How it savesLifecycle hooks, automaticHooks, periodically and before compactionThe agent calls xerj_memory_store
What it keepsModel-written observations and summariesOriginal text, word for wordThe text the agent sends
Model on writeYes: hosted observer, your key, or your Anthropic planNo, in raw modeNo
SearchSQLite FTS5 plus ChromaChromaDB by default; other backendsBM25, semantic or hybrid in one index
How it recallsContext at session start, plus MCP searchMCP tools and a recall skillMCP xerj_memory_recall or HTTP
RuntimeBun worker servicePython packageOne binary
Other agentsCodex, OpenCode and othersCodex CLI and Cursor hooksAny MCP client or HTTP caller
LicenseApache 2.0MITApache 2.0

Find your fit

Try it: which one fits you

Answer four questions

What should memory keep?
How should saving happen?
A language model writing your memories?
What else should it search?

Pick

claude-mem

You want Claude Code to remember on its own and start each session with a short, model-written recap.

Pick

MemPalace

You want every conversation kept word for word, saved by hooks, searched by meaning, with no summaries.

Pick

XERJ

You want the agent to decide what to save, and one local engine that also searches your logs, docs and code.

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.

Pick it when you want memory that works without the agent thinking about it.

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.

Pick it when you never want a model to decide what to forget.

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.

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.

See what an MCP memory server is for the general idea, and Claude Code memory for the built-in options that come first.

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 server and tests store and recall across sessions. To add it by hand:

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

Sources checked

All checked on 2026-10-30.

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 it.

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 MCP servers 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.

Related