COMPARE · COMPARISON: AGENT MEMORY

XERJ vs memvid: one memory file or one local server?

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

XERJ or memvid? memvid keeps memory in one portable file with almost no dependencies and answered queries in 0.3 ms. In our test its default lexical search found 1 of 75 answers, because full questions must match every word. XERJ found 73.3% with BM25 and 94.7% with semantic recall.

Key number: memvid packages data, embeddings, search structure and metadata into a single .mv2 file. Its lex feature is full-text search with BM25 ranking through Tantivy. (as of 2026-10-31 · source: github.com/memvid/memvid)

TL;DR memvid stores agent memory in one portable .mv2 file. XERJ runs memory as a local server you call over HTTP or MCP. memvid's queries were the fastest we measured. But its default search needs every word of a question to match, so natural questions mostly came back empty.

Diagram

One file vs one server

memvid

A single .mv2 file

Data, search index and metadata live in one portable file. You open it from your code with the SDK. Lexical search is BM25 through Tantivy. Vector search is a build feature.

XERJ

A local search server

One binary serves memory over HTTP and MCP, next to logs, docs and code. BM25 by default. Semantic and hybrid recall in neural mode, with MiniLM built in.

memvid details are from its README on 2026-10-31. In our run we used memvid-sdk 2.0.160 from PyPI.
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 with --embed-mode neural, store five facts about this project with POST /_memory/project, then recall each one twice, once with key words and once as a full question, using hybrid recall, and tell me which recalls missed.
RUN THIS XERJ COMMAND curl -fsSL https://xerj.org/get | sh Install the single XERJ binary.
RUN THIS XERJ COMMAND xerj --embed-mode neural Start a local node with the built-in MiniLM embedder.
RUN THIS XERJ COMMAND curl -s -XPOST 'http://127.0.0.1:9200/_memory/project/_recall' -H 'content-type: application/json' -d '{"query":"What is the main database for this project?","hybrid":true,"k":5}' A full question works: hybrid recall ranks by any shared word and by meaning.

Tested side by side

Same 85 memories, same 75 questions. Top 5 is the share of questions where the right memory came back in the first five.

memvid-sdk 2.0.160XERJ v1.0.0-rc.100
Top 5, default settings1.3% (lexical)73.3% (BM25)
Top 5, questions that reuse the memory's words4%100%
Top 5, semantic with MiniLMNot tested94.7%
New value first, changed facts0%13.3%; 93.3% with recency weight
Median write67.3 ms11.3 ms
Median query0.3 ms3.8 ms
LLM calls per write00
What you install2 Python packagesOne binary
StorageOne .mv2 fileIndex per namespace on a local node
LicenseApache 2.0Apache 2.0

Why full questions missed

Type a question or pick one. The left side keeps only lines that hold every word. The right side ranks any shared word, like BM25 in XERJ.

Try it: all words vs any word

Why a full question can find nothing

Four stored memories:

  1. The main database for Lark is PostgreSQL 16.
  2. The Lark API listens on port 8443 in production.
  3. Dana prefers pnpm over npm for JavaScript projects.
  4. Error tracking for Lark goes to Sentry.
Every word must match
    Any word, ranked by BM25

      With JavaScript off, here is what memvid-sdk 2.0.160 returned on our 85 memories:

      • "What is the main database for Lark?": no hits
      • "main database Lark": 1 hit, the PostgreSQL memory
      • "What port does the Lark API listen on in production?": no hits
      • "Lark API port": 2 hits
      Runs in your browser and sends nothing. It is a small model of the two query styles, not memvid's code. The recorded memvid results are in probes/memvid_and_probe.json in benchmarks/agent-memory: full questions returned nothing, and the same key words found the memory.

      If you use memvid, search with key words, not full questions, or strip question words first.

      When to pick memvid

      When to pick XERJ

      Limits on the XERJ side

      See the full AI agent memory benchmark for all seven projects.

      Try it with XERJ

      Use the Copy the prompt button and paste it into your coding agent. It stores five facts and checks both key word and full question recall.

      Sources checked

      All checked on 2026-10-31.

      FAQ

      Why did memvid score so low?

      Our questions are full sentences. memvid's lexical search returned nothing when a question held words that were not in the memory. The same key words with no question words did find the memory. We recorded both in a probe.

      Is that a fair test of memvid?

      It is a fair test of its default lexical search on natural questions, the same ones every system got. It is not a test of memvid's vector search, which we could not get working in the PyPI package.

      Why was vector search not tested?

      In memvid-sdk 2.0.160 the local embedding option returned error MV015, and a custom embedder stored no vectors, error MV011. So we report only lexical search.

      Where does memvid win?

      Queries took 0.3 ms median, the fastest in our test, and the SDK installs only 2 Python packages. The whole memory is one file you can copy.

      Where does XERJ win?

      Recall on natural questions, semantic and hybrid search with a built-in model, and writes: 11.3 ms median for XERJ BM25 against 67.3 ms for memvid.

      Evidence

      Related