MentisDB Blog

Durable memory for AI agents

MentisDB 0.10.9.54 — Security, reliability and retrieval

October 21, 2026

0.10.9.54 is the result of an exhaustive audit of the whole codebase: server, dashboard, storage, search, dependencies and CI. The work ran as parallel agent workstreams that coordinated through MentisDB itself — plans, findings, checkpoints and hand-offs were appended to the project's own chain, so each agent picked up where another left off. The audit found a serious authorization bug, fixed the memory blow-up reported in issue #23, repaired reranking, and made ranked search faster and more accurate.

Security notice — upgrade recommended. If your daemon has bearer-token access enabled and issues chain-scoped tokens, versions up to and including 0.10.8.53 let such a token escape its scope through the legacy MCP /tools/execute endpoint. Upgrade with cargo install mentisdb --locked --force and restart the daemon.

1. A chain-scoped token could act outside its chain

MentisDB supports bearer tokens scoped to one or more chains, so an agent can be given its own memory and nothing else. Through the legacy MCP /tools/execute route, a chain-scoped token could act outside its scope: reading and writing other chains, calling global-only tools such as listing every chain with its storage path, and merging or deleting chains it was never granted. This affects 0.10.8.53 and earlier whenever bearer-token access is enabled.

The fix follows a simple rule: authorization must inspect exactly the fields the executor consumes, and every operation on both REST and MCP is now checked against one shared authorization table.

The same review produced a set of smaller hardening fixes:

2. Issue #23: memory blow-up after upgrading

takver reported a daemon growing to 28.8 GiB and getting OOM-killed after upgrading a data directory with many chains. The report was accurate. Every chain loaded its own FastEmbed ONNX session, about 100 MB each and never released, and opening a chain without a fresh vector sidecar embedded its whole history in one unbounded batch on the request path. Our reproduction with 13 chains and 2,704 thoughts blew through a 6 GB cap.

Now one model is shared per process, inference runs in small bounded chunks, and missing sidecars are rebuilt by a single background worker while the chain keeps serving lexical and graph results. The same reproduction peaks at about 1.7 GB. The model cache moved from the working directory to <MENTISDB_DIR>/.fastembed_cache, and MENTISDB_EMBEDDINGS=off|local-text|fastembed lets you opt out of ONNX entirely.

3. Reranking works again, and default retrieval improved

enable_reranking=true had been quietly broken: the raw Reciprocal Rank Fusion total, a number around 0.05, replaced the additive score, so LoCoMo R@5 fell to 3.6%. RRF is now a scaled consensus bonus added on top of the score. The thesaurus is keyed by stem so inflected words expand, and its weight was damped after benchmarks showed that more frequent expansion was displacing literal matches.

                          BEFORE (b4372ff)   0.10.9.54
LoCoMo default R@5/R@10       63.8 / 72.7    63.9 / 73.5
LoCoMo rerank  R@5/R@10        3.6 /  5.9    66.0 / 74.1
LME default R@5/R@10/R@20  66.8/72.0/78.2  68.0/72.8/78.8
LME rerank  R@5                    2.8           68.6
Query q/s (LoCoMo / LME)       206 / 159      384 / 385

One finding is worth sharing. An interim build was slower on queries, and the cause was not our code: fastembed 7 brings an ONNX Runtime release that always registers the CoreML execution provider on macOS, which made query embeddings about 2.5x slower. Only sampling the live process revealed it. fastembed stays on 5.x, with a test that guards the pin.

4. Durability and speed

Upgrade notes

cargo install mentisdb --locked --force

Full details: release notes. Thanks again to takver for #23.