StateJar

Exact memory for AI agents: StateJar matches Mem0 on user facts at about a sixth of the storage cost

On 300 sealed BEAM questions, StateJar and Mem0 2.2.1 scored 51.9 against 51.9 on questions about what the user said and were statistically level overall, and StateJar stored each message for about a sixth of the cost.

StateJar Team6 min read
StateJar: exact memory for AI agents, message to facts to handle to version to audit

AI agents forget what users told them, or remember it wrong. StateJar is a memory layer that keeps each user's facts as exact, versioned and checkable state, and recalls what users said in their own words when a question needs it. On 300 sealed questions from the public BEAM benchmark, StateJar and Mem0 2.2.1 scored exactly the same on questions about what the user said, came out statistically level overall, and StateJar stored each message for about a sixth of the cost.

Why do AI agents forget or misremember?

A language model keeps nothing between requests. Most apps either send the whole conversation back on every turn, which grows in cost and leaves old and new values side by side, or keep model-written summaries, which nobody can check afterwards.

So an agent asks for your budget again, or uses the city you moved away from, and nobody can say what it knew when it answered.

What does StateJar do differently?

StateJar stores facts, not transcripts, and makes every step after extraction deterministic.

  • Deterministic handles. Each version of a user's state is written in one canonical form and hashed with SHA-256. The result, shm_ followed by 64 hex characters, is a content address: the same facts give the same handle on any machine. Restoring a handle re-derives the hash and refuses if it does not match.
  • Audit and replay. Every disclosure to a model is written to an audit log with the handle that was used, and can be replayed later to show exactly what the model was given.
  • Versions, never overwrites. A change writes a new version that points to the one before it. You can see what was true yesterday and what is true now.
  • Conflicts kept. When two statements contradict each other, the contradiction is kept as a record instead of being silently resolved.
  • Typed refusals. A value that does not fit its field is declined with a reason, not guessed. Assistant replies and full transcripts are not stored; the recall layer keeps the user's own messages as short excerpts.

The recall layer adds one thing on top: when a question needs it, StateJar also hands the model short excerpts of what the user said, found by search and ranked by a model. Those excerpts are labelled as unverified in what the model receives, kept apart from the checked state. The recall layer is live for every account since 14 November 2026.

Extraction is checked before anything is stored: on the release-gate set of 345 messages, StateJar's extraction measured 96.4% precision. How StateJar extracts facts with 96% precision explains the checks.

How does StateJar compare with Mem0?

We used BEAM, a public benchmark for long-term memory in chat assistants by Tavakoli et al., licensed CC BY-SA 4.0. Scores are BEAM's mean score on a 0 to 100 scale.

Mean BEAM score on 300 sealed questions: StateJar 51.6 (48.2 to 54.9), Mem0 2.2.1 54.3 (52.0 to 56.7); difference not significant, p = 0.32.

Source: BEAM sealed set, 15 conversations, 12 Nov 2026.

  • Questions about what the user said: 51.9 against 51.9, an exact tie on 240 questions.
  • Overall: StateJar 51.6 (95% interval 48.2 to 54.9), Mem0 2.2.1 54.3 (52.0 to 56.7). The difference, −2.7 points (−6.3 to +1.4), is not significant: an exact McNemar test gives p = 0.32. Statistically level.
  • Cost to store a message: $0.00017 for StateJar against $0.00111 for Mem0, over 8,391 stored messages each, about 6.5 times lower. StateJar's recall layer then spends $0.00017 per question on retrieval.
  • Context handed to the answer model: 924 tokens per question for StateJar against 1,607 for Mem0.
Cost to store one message: StateJar 0.00017 and Mem0 2.2.1 0.00111 US dollars. Tokens per question: StateJar 924, Mem0 2.2.1 1,607.

Source: BEAM sealed set, 15 conversations, 12 Nov 2026; 8,391 stored messages per system.

User-side questions (240): StateJar 51.9, Mem0 2.2.1 51.9. Assistant-side questions (60): StateJar 50.5, Mem0 2.2.1 63.9.

Source: BEAM sealed set, 15 conversations, 12 Nov 2026; questions split by BEAM's own task definitions.

Mem0 scores higher on questions about what the assistant said; StateJar is built for exact, provable facts about the user.

Is StateJar a Mem0 alternative with an audit trail?

On what the user said, the data supports "matches": the two scored the same. What StateJar adds is what happens around the memory: a verifiable handle for every state, an append-only history, kept conflicts, typed refusals, and an audit log you can replay. Why AI agents need an audit trail for memory shows what that makes possible.

How did we test?

  • Data: BEAM's 500K tier, 15 whole conversations and 300 questions, 30 for each of ten abilities.
  • Sealed, one run: the test questions were sealed and read for the first time in this run. StateJar's configuration was chosen beforehand on a separate development split, and nothing was tuned on the test questions.
  • Same answer model and judge: every answer was written by the same answer model from the memory each system returned, and graded by the same judge with BEAM's own scoring.
  • Isolation: each conversation was its own account in StateJar and its own fresh store in Mem0 2.2.1 (its open-source package).
  • Statistics: 95% intervals come from resampling whole conversations, 2,000 resamples. Significance is an exact McNemar test on fully correct answers.

How do I start?

pip install statejar        # or: npm install statejar
statejar login
from statejar import StateJar
sj = StateJar(session_tag="user-42")
sj.ingest("I'm Meera from Pune and I prefer email.")
print(sj.recall("How should I contact Meera?", audit=True)["memory_context"])

The step-by-step guide, with JavaScript and MCP for Claude Code and Cursor, is Add memory to your agent in 5 minutes. The full reference is in the docs, and plans are on the pricing page.

Try free or Talk to us.

Frequently asked questions

What is the best memory layer for AI agents?

On 300 sealed BEAM questions, StateJar and Mem0 2.2.1 were statistically level overall (51.6 against 54.3, p = 0.32) and exactly level on questions about what the user said (51.9 against 51.9). Choose StateJar if you need exact, versioned facts about the user with an audit trail.

Is StateJar a Mem0 alternative?

Yes. It matched Mem0 2.2.1 on user-side questions (51.9 against 51.9) on the BEAM benchmark, stored each message for $0.00017 against $0.00111, and adds deterministic handles, append-only versions and a replayable audit log.

Does StateJar store chat transcripts?

No. StateJar does not store assistant replies or full transcripts. It keeps the user's facts as versioned state, and short excerpts of the user's own messages for the recall layer.

← All posts