Skip to the content.

Does memshelf actually pay for itself? — a measured demo

The README explains the mechanism — offload closed topics as digest-indexed episodes, keep only INDEX.md in context, recall one section when needed. This page measures whether the mechanism pays off, on the real dogfood shelf: sqst-memshelf, the private working-memory shelf that ran the whole M0 experiment (protocol) — Case A (retro-import of months of course work) and Case B (a week of live shelve-at-close, 2026-07-13 → 22).

Unlike docshelf’s demo shelves, a memory shelf is private by design, so you can’t clone this one — but every number below comes from memshelf stats / memshelf doctor, which you can point at your own shelf unchanged.

Visual version: the same numbers as a one-page infographic — assets/case-b-week-report.html (self-contained, no external resources, light + dark).

The numbers

Shelf state Episodes INDEX.md Standing cost (INDEX + digests) Shelved mass Ratio
Case A close (2026-07-13) 17 1,370 tok ~2.7K tok ~76K conversational (raw sessions far larger) ~97% cheaper than the source
Today (2026-07-22, memshelf stats) 34 2,704 tok 8,638 tok 1,924,800 tok 222.8 : 1

Two things stand out, same shape as docshelf’s result:

What the doctor found (first run on the live shelf)

The M1 tools were pointed at the dogfood shelf the day they were built. memshelf doctor returned healthy: false — correctly:

The headline stays the accidental one

The strongest M0 finding needed no benchmark: the actual homework-review-season transcript (April–June) no longer exists anywhere — not in the chat export, not in rotated session logs. The only trace is what was hand-copied in time. “Memory that isn’t shelved while the context exists is memory lost” stopped being a slogan on day one (M0.md); Case B then ran a full week of real work without losing an episode.

Methodology — and what is honestly not measured

M2 check-in (2026-09-28)

Two of M2’s three exit criteria, measured on the same dogfood shelf, now well past the Case A/B numbers above (method: memshelf doctor, plain INDEX navigation; no owner input).

(a) INDEX budget — flat per-line price holds at scale. At 174 live entries (273 rows in ledger.tsv, 101 archived): INDEX ~13,486 tokens (chars/4) against a budget of 14,120 (200 + 80×174) — under budget, no index-bloat, ~76.4 tokens/entry against the 80 allowance. At 113 entries (measurement recorded under “Changed” in the CHANGELOG, 2026-08-21): ~81.1 tokens/entry. The per-line price went down slightly as entries grew +54%, not up — the exit criterion holds both by construction and on this measurement.

(b) Recall — the literal M0 set no longer applies; a same-rule check on live episodes does. M0’s five known-answer questions target Case A episodes that have since passed through two rollup generations (2026-07-27-rollup, itself later absorbed into 2026-08-09-rollup) and carry no keyword into the live INDEX’s one-line rollup entries — 0/5 resolve via plain INDEX-then-fetch navigation today. That is a rollup-depth effect (rollup doing its job since #145), not a measured accuracy regression: replaying identical questions against deliberately-archived answers isn’t a like-for-like test of recall at scale. A substitute pair of known-answer questions against currently-live episodes, same INDEX-first-then-fetch rule, resolved 2/2 — one unambiguous INDEX match each out of 174 entries, with the specific answer found only in the fetched episode body, not the INDEX line. No nested test agent was available in the session that ran this check; both passes were self-answered with the M0.md answer key already known — flagged here as contamination rather than left implicit.

(c) is untouched: the advisor-proposals-accepted-in-dogfood measurement is the owner’s call, not a tool run.

Reproduce it

On any shelf (a docshelf shelf with topics/research/sessions and a ledger.tsv):

git clone https://github.com/ignatenkofi/memshelf-mcp && pip install -e memshelf-mcp
memshelf stats  --shelf /path/to/shelf
memshelf doctor --shelf /path/to/shelf   # exit 1 on contract violations

Or run the full loop on a scratch shelf:

python3 -c "from docshelf_mcp import Shelf; \
  Shelf('demo-shelf').init(name='demo', default_categories=['topics','research','sessions'])"
git -C demo-shelf init

memshelf shelve --shelf demo-shelf --slug 2026-07-22-demo --kind topic \
  --digest "The demo chose a local shelf; a cloud store was rejected for portability. Open: nothing." \
  --section "Decisions=local shelf over cloud store" --approx-tokens 30000

memshelf recall --shelf demo-shelf --id 2026-07-22-demo --section Decisions --log
memshelf stats  --shelf demo-shelf     # realized_savings is now non-zero
memshelf doctor --shelf demo-shelf

Try shelving a digest that starts with “We decided…” — the tool rejects it with the exact fix and writes nothing. That, plus the two over-cap digests the doctor caught above, is the difference between a convention and a contract.


Back to the README · M0 protocol & results · ROADMAP.