COMPARE · COMPARISON: AGENT MEMORY

XERJ vs Mem0: which memory fits your AI agent?

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 XERJ or Mem0 for agent memory? Pick Mem0 if you want a language model to read chats and keep a tidy list of facts for you. Pick XERJ if you want the agent to store exactly what it writes, find it with keyword, vector or hybrid search, and run it all on your own machine.

Key number: Mem0's add() runs LLM fact extraction by default (infer=True); its default OpenAI model is gpt-5-mini and its default embedder is text-embedding-3-small. (as of 2026-10-30 · source: github.com/mem0ai/mem0)

TL;DR Mem0 and XERJ both give an agent memory that lasts across sessions. Mem0 asks a language model to turn chats into facts and keeps them up to date. XERJ stores what the agent writes, word for word, and finds it with keyword, vector or hybrid search on your machine.

Diagram

What happens when an agent saves a memory

Mem0 by default sends the conversation to a language model, which extracts facts and decides to add, update or delete memories in a vector store. XERJ stores the text as given, skips near duplicates, and indexes it for keyword and vector recall. Mem0, default (infer on) Chat messages add() LLM call extract facts Add, update or delete Vector store Qdrant default XERJ Text you choose POST /_memory/ns Skip near duplicate optional, 0.95 no model call One index BM25 + vectors
Mem0's add() runs a language model by default to turn messages into facts; pass infer=False to store raw messages instead. XERJ never calls a model on write: what you send is what gets stored, and an optional dedup check skips text at 0.95 similarity or above.
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, store five facts about this project with POST /_memory/project, then recall each one twice, once with words from the fact and once in other words, and tell me which recalls missed and whether hybrid or semantic recall fixed them.
RUN THIS XERJ COMMAND curl -fsSL https://xerj.org/get | sh Install the single XERJ binary.
RUN THIS XERJ COMMAND curl -s -XPOST 'http://127.0.0.1:9200/_memory/project' -H 'content-type: application/json' -d '{"text":"User prefers pnpm over npm","dedup":true}' Store one memory. With dedup on, near duplicates at 0.95 similarity or above are skipped.
RUN THIS XERJ COMMAND curl -s -XPOST 'http://127.0.0.1:9200/_memory/project/_recall' -H 'content-type: application/json' -d '{"query":"pnpm","hybrid":true,"k":5}' Recall with BM25 and vectors fused by RRF.

Side by side

Checked on 2026-10-30 against the Mem0 repository and the XERJ source.

Mem0 (open source)XERJ
What gets storedFacts a model extracts, by defaultThe exact text the agent sends
Model call on writeYes by default; off with infer=FalseNever
Default modelsgpt-5-mini, text-embedding-3-small (OpenAI)None needed; optional local MiniLM
Updates old factsYes, the model can update or deleteNo; you overwrite by id or forget
Search on recallVectors, plus BM25 and an entity boost when the store supports full-text search (Qdrant does)BM25 by default; semantic or hybrid on request
StorageVector store, Qdrant by defaultOne local index per namespace
Scopinguser_id, agent_id, run_idNamespace, plus metadata filters
Ways to runPython library, self-hosted server, cloud platformOne binary, HTTP API and MCP server
LicenseApache 2.0Apache 2.0

Try the XERJ side

This is XERJ's default recall: plain BM25 over three memories. Pick a recall and see what comes back.

Try it: default recall

What a word match can and cannot recall

Three stored memories:

  1. User prefers pnpm over npm
  2. The API runs on port 9200
  3. Deploys go out on Fridays after review
BM25 recall, top 3

    With JavaScript off, here is what a local XERJ node returned for these recalls:

    • "which package manager": no hits
    • "pnpm": memory 1 at 1.0526
    • "what port does the API use": memory 2 at 2.9425
    • "deploy day": no hits
    Runs in your browser and sends nothing. A local XERJ v1.0.0-rc.97 node returned the same hits and scores for all four recalls on 2026-10-30. "which package manager" and "deploy day" come back empty because no stored word matches; "deploy" is not "Deploys". That gap is what semantic recall is for: start the node with --embed-mode neural and send semantic or hybrid set to true.

    The empty results are the honest part. A word match cannot know that "package manager" means pnpm. You have three fixes:

    When to pick Mem0

    When to pick XERJ

    Limits to know on the XERJ side

    The memory across sessions page shows a store, restart and recall run. The agent memory tools comparison also covers Zep, Letta and Cognee.

    How to try it with XERJ

    Use the Copy the prompt button and paste it into your coding agent. It installs XERJ, stores five facts and tests which recalls miss. Or run the three commands above by hand.

    Sources checked

    All checked on 2026-10-30.

    FAQ

    What is the main difference between XERJ and Mem0?

    Mem0 calls a language model on write to extract facts and update old ones. XERJ makes no model call on write. It stores the text the agent sends and finds it later with search.

    Does Mem0 need an OpenAI key?

    Its default setup uses OpenAI: gpt-5-mini for extraction and text-embedding-3-small for embeddings. You can configure other providers, and infer=False stores raw messages with no extraction step.

    Is XERJ a drop-in replacement for Mem0?

    No. The APIs differ, and XERJ does not extract or merge facts for you. If your agent relies on Mem0 updating old facts, you would write that logic yourself.

    Which one is better for a coding agent on my laptop?

    If you want no cloud service and no model on the write path, XERJ fits. If you want automatic fact cleanup and are fine with a model call per write, Mem0 fits.

    Does XERJ separate memories per user?

    Each namespace is its own index, so recall in one namespace never sees another. There is no per-namespace password, so do not use namespaces as a security boundary.

    Was a benchmark run between the two?

    No. We did not run a head-to-head, so this page compares design, not scores.

    Related