MentisDB Blog

Durable memory for AI agents

MentisDB 0.12.1.58 — Lean search, live memories, agent key pairs

November 8, 2026

A user whose chain has grown past 3,500 thoughts since April told us their agent's searches were filling its context window. Two things were going on. Search results carried far more text than an agent needs, and a fact rewritten many times could take up most of a page by itself. This release fixes both. On a generated 3,500-thought chain, a default 10-hit ranked search over MCP went from 23,657 to 5,948 characters, and standing context from 36,191 to 13,050. Giving an agent a signing key also became one step, from the command line or the dashboard.

Security notice. Before this release, the dashboard's agent-key registration could replace an agent's existing key, including a revoked one, so anyone able to reach the dashboard API could register a key that verifies as that agent. Key ids are now never reused or overwritten, and adding or deleting an agent key on the dashboard requires a dashboard PIN. If your dashboard was reachable by untrusted local processes or users, review each agent's registered keys and revoke any you did not register. Upgrade recommended.

1. Superseded memories no longer starve results

When a memory is superseded, ranked search shows its live successor in its place. But it picked candidates from a fixed window of twice the page size, and superseded versions counted against that window. A decision rewritten 30 times, each version superseding the last, filled the window on its own: a search for 5 results returned 1, while total said 21 had matched.

Now only live memories compete for the page. Every match is scored once, a superseded match nominates its live successor, and the walk stops when the page holds as many distinct live memories as you asked for. Context bundles and duplicate collapsing use the same walk. When collapsing leaves a page short, the walk picks up where it stopped instead of starting again: the worst case we measured at 100,000 thoughts fell from 32.5 ms to 3.5 ms.

2. Lean output for agents

REST responses are read by programs; MCP tool results are read by language models, one token at a time. So the MCP surface now shapes its results for them, and REST and the CLI keep their full shape:

This builds on compact search, which Austin Faulkner-Pearce contributed in 0.11.0.56.

3. Measured

cargo run --release --example token_diet builds a 3,500-thought chain with superseded lineages and corrections, calls every agent-facing tool, and counts the characters the model reads:

Tool call0.12.0.570.12.1.58
mentisdb_ranked_search23,6575,948
mentisdb_lexical_search18,7436,341
mentisdb_federated_search23,5116,025
mentisdb_context_bundles9,9933,562
mentisdb_standing_context36,19113,050

4. Agent key pairs in one step

An agent needs a registered Ed25519 key to sign its thoughts or read a private chain. That used to take two commands, and the dashboard's Add Key button never worked. Now one command makes the pair and registers the public key:

mentisdb agent key generate builder --key-id builder-1 --chain vault --pin 123456

The private key goes to an owner-only file on macOS and Linux (by default under ~/.mentisdb/keys) and is never printed. A wrong PIN, a stopped daemon or a key id that is already taken is caught before anything is written, and if the registration fails afterwards the file is kept and the error tells you how to register it.

On a dashboard protected by a PIN, an agent's page has a Generate key pair button. Your browser makes the pair and registers only the public key, then shows the private key once, with a download button. It stays open until you tick I have saved this key, and reminds you to chmod 600 the downloaded file. Add Key now works too, for keys made elsewhere.

MentisDB keeps only the public key. The key file is the only copy of the private key: back it up, chmod 600 a downloaded copy, and never paste it into a chat or give it to an AI agent.

5. Fixed in review

Paged REST search no longer repeats or skips hits around contested memories, and a replacement on another chain no longer shrinks a page. Lean output marks a thought with no provenance as unknown instead of letting it pass as public, keeps the kind of a replaced link (successor_kind), keeps full-precision timestamps so they work as as_of, and refuses a compact that is not a boolean, so an agent's "false" is never read as true.

Upgrading

There is no migration and no library break. If your MCP client reads structuredContent or standing context's entries, switch to the text content or pass include_entries: true. lme-benches/full_bench.sh no longer kills every MentisDB process on the machine; it refuses to run if a daemon is already up. Every CI run now reports test coverage (about 74% of lines today), with floors that only go up, toward 90%. The release notes list every change.

cargo install mentisdb --locked --force
# or
docker pull ghcr.io/cloudllm-ai/mentisdb:0.12.1.58