Skip to content

Freeze the Mem0 and LangGraph stores v0.1.2, v0.1.4 and v0.3.0 wrote and read them with the current readers (#271) - #321

Merged
memtomem merged 3 commits into
mainfrom
test/frozen-memory-backends-271
Nov 19, 2026
Merged

memtomem merged 3 commits into
mainfrom
test/frozen-memory-backends-271

Conversation

@memtomem

Copy link
Copy Markdown
Owner

Refs #271 (Memory family, part 2a). Follows #317 and #319, which froze the memtomem stores. Mem0 and LangGraph migration artifacts are part 2b.

What this freezes

The stores v0.1.2, v0.1.4 and v0.3.0 wrote through their optional backends, Mem0 (Qdrant local: pickled points with dense and bm25 sparse vectors, plus history.db) and LangGraph (one SQLite file of JSON values and content embeddings). Each release's own CLI and backend code wrote two stores per backend:

  • a scenario store running the memtomem family's scenarios (run under every strategy, a failed run, Unicode with CRLF, ### headings, a long prompt, a finished board run, room apply), then rows the SDK holds that syncmill never wrote, and last a board run SIGKILLed in its second stage;
  • a bulk store whose finished board run's scratch namespace and shared each pass one 100-row page.

Release differences are frozen as written. v0.1.2 shares every result straight into shared, tagged task-result and the agent: no private row, no later-phase kind, no plan row, no search_multi, and its Mem0 reader returns no tags. v0.1.x bodies open with a ## heading, and v0.1.x rooms write no memory. v0.1.x's board GC collects the finished run's scratch namespace when the next run claims; index.json records those rows as vanished.

v0.2.0 was generated once and is not frozen: its four stores equal v0.3.0's row for row (generated ids aside). Its adapters, SDK lock and memory.py are the same apart from one docstring.

How the tests hold HEAD to them

  • Default suite, no SDK: the stored rows against the scenario definitions, read with a restricted unpickler and JSON; every syncmill Mem0 point carries its bm25 vector; the foreign rows' shapes; LangGraphBackend._row over every stored item; no stored path; the killed run's lease.
  • Real SDKs (SYNCMILL_TEST_MEMORY_BACKENDS_REAL=1, new CI job memory-backends-real on ubuntu and macOS): HEAD's adapters and everything above them, run over copies. That covers get/count, search, kind filters, search_multi, status, share_chunk, search_context, the shared readers and gateway (refused on a board-scoped view), each strategy's recall, a run and a room round, and the board GC.
  • Search oracle. LangGraph searches by dense embedding only, so a scenario token is not a query whose first hit is known. Measured: 18 of 30 token queries put another row first. Every row is therefore searched by its own content and must come first. The release's ranking is compared only where scores differ by more than 1e-4 (smallest measured margin 2.3e-4). Mem0's hybrid search is also held to ranking a scenario's token first through BM25.
  • Models. The stores were embedded with exact FastEmbed files. models.json records each file's revision and sha256, and fetch_models.py fetches them. Each test engine checks, on exit, that every model FastEmbed actually loaded is that snapshot with those bytes. A cache whose ref FastEmbed cannot resolve makes it fall back to another directory, and that case fails.

Findings

  • Mem0 backend: delete_namespace reports success but leaves rows on disk that come back on reopen #320 (filed): HEAD's Mem0 delete_namespace reports success but leaves rows on disk that return on reopen. mem0 2.0.11's delete_all deletes concurrently over Qdrant local's one SQLite connection. The board GC tombstones such a namespace anyway. The on-disk check is xfail(strict=False).
  • LangGraph's dense search cannot rank a scenario by its token.
  • v0.1.2's later-phase recall finds no released row.
  • A later recall of the same filter can be filled by the run's own rows: relevance search, not delivery. Only the first recall per filter must return released rows.

Verification

  • suite-run: CLEAN. 27 default tests pass. Real SDKs: 114 passed, 3 skipped (BM25 test on LangGraph), 3 xfailed (Mem0 backend: delete_namespace reports success but leaves rows on disk that come back on reopen #320), locally with a freshly fetched cache.
  • 18 mutations of HEAD readers (row mapping, filters, merge order and cut, LangGraph paging, Mem0 delete loop and exact count, shared-reader guards, scoped union, GC fallback) each fail a test with an assertion. The model check fails on a changed model file and on a cache that falls back to another directory.
  • Review: design 2 rounds (the scope split and CI job came from round 1). Implementation: round 1, 5 findings fixed; round 2, 1 finding that came from a round-1 fix, so the approach was replaced (ask the loaded model instead of mirroring cache resolution); a final unprimed round, SHIP.
  • gitleaks: clean. models.json stores {name, sha256} entries, because a "tokenizer.json": "<hex>" line reads to secret scanners as a key.
  • Not verified locally: Linux reading the macOS-written stores with equal scores. The new CI job shows it.

🤖 Generated with Claude Code

memtomem and others added 3 commits November 19, 2026 18:06
…and read them with the current readers (#271)

Each release's own CLI and backend code wrote two stores per optional
backend: one running every scenario of the memtomem family plus rows the SDK
holds that syncmill never wrote and a SIGKILLed board run, and one whose
scratch namespace and shared namespace each pass a 100-row page. The default
suite reads them with the standard library; the real tests
(SYNCMILL_TEST_MEMORY_BACKENDS_REAL=1, new CI job memory-backends-real) run
HEAD's adapters and everything above them over copies, with the exact
FastEmbed model files recorded in models.json.

v0.2.0 was generated once and measured equal to v0.3.0 row for row.
HEAD's Mem0 delete_namespace leaves rows on disk (#320); that check is xfail.

Refs #271

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n Mem0 and LangGraph tests (#271)

Each engine checks, on exit, that every FastEmbed model it loaded is the
recorded revision's snapshot with the recorded bytes, instead of mirroring how
the cache resolves a revision. The generator's unchanged-row check now covers
the vector values (Mem0 dense and BM25, each LangGraph embedding), so all three
releases were regenerated with it. The room recall must come before the task
text, search_multi keeps its best-first order, and the killed run's row is
checked for its heading and task.

Refs #271

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rd pool (#271)

Mem0 adds a row's BM25 score only when the keyword search ranks it among its
first max(4 * top_k, 60) hits. The bulk store's 106 shared rows tie there, so
which of them get it depends on the store's order of ties: CI's ubuntu job
ranked the second and third hits of three bulk rows differently from the macOS
release read. LangGraph's dense ranking matched on both.

Refs #271

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant