MentisDB 0.12.0.57 — One copy of every vector, derived-state backlog, large signed requests
A short release that closes the open ends of 0.11.0.56. That release moved the implicit-edge scan off the write lock and said what it cost: a second copy of every vector (about 150 MB at 100,000 thoughts) and a queue with no cap. Both costs are gone, operators can now see how far derived state is behind, and signed requests are no longer capped at 1 MiB.
1. One copy of every vector
The background scanner now shares the sidecar's vectors instead of copying them, and its queue stores positions instead of vectors. Heap growth while appending fell from 239.2 MiB to 56.3 MiB at 100,000 thoughts and from 46.4 MiB to 11.9 MiB at 20,000. The shared store described below then removed another 143 MiB of live heap at 100,000 thoughts, compared with the 0.12 code before it. A backlog now costs a few bytes however long it grows, never blocks an append and never drops an edge.
2. See what is still catching up
GET /v1/chains and the MCP chain listing report a
derived_backlog per chain: embeddings in flight, parked or missing, and
implicit edges not yet in the overlay. All zeros means healthy. A growing embedding
count points at a stalling provider. A growing edge count means appends are faster
than the scan (about 155 per second at 100,000 thoughts); the edges for the newest
thoughts then arrive late and catch up when appends slow down.
3. Large signed requests
0.11 could not import a large MEMORY.md into a private chain, because
signed requests were capped at 1 MiB: to check a read proof, the daemon had to read
the whole body first. A client can now send the body's SHA-256 (the same digest the
proof already signs) in X-Mentis-Content-Sha256. The daemon verifies
the proof first, then hashes the body as it streams, and a body that does not match
fails with 400 before anything acts on it. The mentisdb
CLI and pymentisdb 0.10.1 send the header automatically, so large
imports just work. Without the header nothing changes, and existing clients,
mentischat included, need no update.
Accepting bigger bodies is only safe if the daemon decides who may send them before it reads any of the body, so 0.12 adds a body-admission layer:
- The bearer token is checked from the headers first. A caller without a valid token is refused without a byte of its body being read.
- Ordinary routes, and every MCP request, take at most 2 MiB. Only the three import routes take up to
MENTISDB_MAX_BODY_BYTES(64 MiB), and only from an authenticated caller. - Imports, ordinary requests and anonymous requests draw on three separate budgets, so none can starve another. Each peer has a share: 32 MiB of the 64 MiB ordinary pool, and 8 MiB of a 16 MiB pool for anonymous callers.
- Every body must keep up at least 64 KiB/s (
MENTISDB_MIN_BODY_BYTES_PER_SEC,0turns it off), judged window by window after a 60-second grace period, and small and anonymous bodies have a total deadline, so a slow drip cannot hold a slot. A body that is too slow gets408; an exhausted budget gets503withRetry-After, on every route.
If a reverse proxy sits in front of MentisDB, raise its body limit on the import routes to match.
4. Verified
Recall did not move: five LoCoMo and LongMemEval runs on the final code matched 0.11.0.56 exactly (LoCoMo R@10 76.7, LongMemEval R@5 69.8), and the LoCoMo results were byte-identical.
The same work went further than the scanner. The sidecar, the exact index, the HNSW graph and the scanner now share one flat, aligned vector store, so every vector is in memory once: the exact index's own copy is gone too (143 MiB less live heap at 100,000 thoughts). Exact search over that store uses a lane-parallel dot product that the compiler turns into NEON or SSE2, with the same results on every platform, and top-10 search over 100,000 vectors went from about 65 ms to 14.2 ms, 4.3x faster.
Why 0.12
Public library types changed. VectorSidecarEntry::vector is now a
VectorRow, a handle into the shared store that reads as a slice; code
that needs a Vec calls .to_vec(), and
VectorSidecar is built with VectorSidecar::build. MentisDbServiceConfig is now
#[non_exhaustive], so build it with new() and the
with_* methods instead of a struct literal. The
release notes
list every signature change and have before-and-after snippets. The file format and the proof format are unchanged,
and no migration runs. mentisdb --help also stopped listing "supported
agents": any agent works over MCP, REST or the CLI.
cargo install mentisdb --locked --force
# or
docker pull ghcr.io/cloudllm-ai/mentisdb:0.12.0.57
pip install -U 'pymentisdb[signing]' # 0.10.1