MentisDB 0.12.1.58 — Lean search, live memories, agent key pairs
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.
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:
- Results are minified JSON, sent once. The MCP library used to pretty-print each result and repeat it as
structuredContent. - Ranked, federated and lexical search and context bundles are compact by default. Pass
compact: falsefor hashes, signatures and score components. - Defaults are left out. No
rolemeansMemory, noimportancemeans 0.5, nochain_keymeans the chain you searched, and noprovenancemeans public and unsigned, which each response states once indefault_provenance. Signatures, private segments and verified writers are always shown. - Version status, successors and the current version are always kept, so an agent can still tell when a memory has been replaced or contested.
mentisdb_standing_contextsends its prompt once. Theentriesarray, a second copy of the same memories, needsinclude_entries: true.
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 call | 0.12.0.57 | 0.12.1.58 |
|---|---|---|
mentisdb_ranked_search | 23,657 | 5,948 |
mentisdb_lexical_search | 18,743 | 6,341 |
mentisdb_federated_search | 23,511 | 6,025 |
mentisdb_context_bundles | 9,993 | 3,562 |
mentisdb_standing_context | 36,191 | 13,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.
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