Repository navigation
Description
User need
A useful memory should be findable when a later session asks for it in different words. For example, "create some test users" should be able to find the relevant memory about "seeding fixture accounts," without requiring the user to remember the wording of the saved entry.
Proposed experience
Improve recall across aliases, synonyms, and paraphrases while retaining the ability to abstain when there is no useful match. Relevant memories should remain discoverable within the correct repository and context budget.
The desired outcome is more useful retrieval without a corresponding increase in irrelevant or misleading memories. Evaluation should include both missed relevant memories and wrong matches, along with latency and resource cost. A higher hit count alone would not demonstrate success.
Existing context
- recall: 7 of 21 curated query/gold pairs retrieve nothing, even with the gold alone in the store (needShared=2) #405 documents concrete vocabulary and keyword-threshold gaps and includes a correction distinguishing keyword-bearing from keyword-free rows. This proposal records the broader user-facing enhancement; it does not claim a new reproduction.
- P2: Retrieval ranking — IDF/BM25-lite, recency tie-break, write-time keywords #40 and Epic: Retrieval & use intelligence — evals that can fail, ranking, use telemetry, consolidation #84 cover existing ranking, keywords, and retrieval design decisions. The approach should respect those constraints unless the maintainer deliberately revisits them; no particular algorithm, embedding service, or model on the read path is requested here.
Recorded as an enhancement for consideration. Priority, design, decomposition, relationship to #405, and implementation ownership remain with the maintainer.
Activity
abogartz commentedon Nov 14, 2026
Proposal: tag-space recall via a local tagger with a growable taxonomy
Discussion summary from the maintainer thread. No commitment implied; the ticket stays
spec:incomplete-adjacent until AC0 lands.Problem. This is the classic vocabulary mismatch problem from information retrieval: the query and the memory use different words for the same concept. #405 shows it is a matching failure, not a ranking failure — 7 of 21 curated gold pairs retrieve nothing even when the gold row is the only thing in the store. No ranking or routing change fixes a matching failure; the link between "test users" and "seeding fixture accounts" has to live somewhere.
Proposal. Put the link in a shared tag space maintained by a small local classifier:
The classifier acts as a learned thesaurus: the query's words never meet the memory's words; both meet only in the label space. IDF weighting is required — without it, common tags dominate and everything matches everything.
Why mostly-correct is enough. Pair recall is roughly p², because both sides must agree. A tagger with top-3 tag recall of 0.9 per side yields about 81% pair recall; soft scoring (using the full probability distribution, not argmax labels) lifts above that floor. The bar is a small, mostly accurate model, not a frontier one.
Model class. "Jev-like" means the System One shape: typed questions with option lists supplied per request. Two consequences:
onnxruntime-nodewould run in-process with no Python daemon.Growable tag table. The taxonomy lives in the store as a table: preferred term, aliases, description (the description is prompt text), status, counts, provenance. New concepts (e.g. "aws") flow through a promotion pipeline:
kwaliases; the tagger itself cannot invent tag names because it is non-generative.Draft acceptance criteria.
kw, with anotherfallback; ≥95% of live-store rows taggable withoutother; versioned together with calibration.What this does not claim. Full recall. Concepts the taxonomy never defined cannot surface through the tag lane; containment is the
otherfallback to the lexical lane plus periodic taxonomy review driven byother-heavy queries. The promotion gate must stay cheap — a new concept should land after 3–5 rows, not 50 — or the coverage ceiling returns.Sequencing. AC0 first, then a fine-tuning spike (multi-label head on an encoder, trained on case-bank tags) before any integration decision. Relationship to existing issues: #405's keyword and threshold gaps define the lexical-lane baseline this lane must beat, and the case bank is shared; #40's write-time keywords are respected — the tagger adds one local call at read time and
kwbecomes the naming source for the taxonomy.WhollyMindless commentedon Nov 14, 2026
I support exploring a local, inspectable vocabulary bridge. The case-bank-first sequencing and lexical fallback are useful foundations. A few suggestions for the experiment and draft acceptance criteria:
These are design suggestions for the case bank and prototype; I have not benchmarked the proposed models. The part I find most promising is the auditable vocabulary bridge. I would want evidence that its categories retrieve the right memories before committing to the taxonomy-management machinery. Sequencing and implementation choices remain with the maintainer.
abogartz commentedon Nov 14, 2026
Thanks — all six points accepted, one as a genuine correction. Revised below. The phase split you proposed is adopted: prove the vocabulary bridge before building its management machinery.
Corrections accepted.
test-windowsonwindows-latest, and the runtime is Bun ≥1.3.0. The unproven part is not ONNX Runtime's Windows CPU binaries butonnxruntime-node's native bindings under Bun specifically. AC5 now names Windows and Bun, and requires measuring cold startup, warm query latency, resident memory, and download size on that runtime, per your note that the platform table is a starting point and not proof.Revisions accepted.
Revised AC set.
Phase 1:
kw, with anotherfallback; ≥95% of live-store rows taggable withoutother.Phase 2 (only if phase 1 shows the categories retrieve the right memories):
Sequencing unchanged otherwise: AC0 first, then the #405 lexical baseline experiment, then the fine-tuning spike. The auditable vocabulary bridge is the part worth the risk; the management machinery only earns its complexity after the bridge is measured.
abogartz commentedon Nov 14, 2026
POC result: the platform holds, the tag lane does not — proposing a pivot to write-side kw quality
Ran the phase-1 experiment early on a throwaway branch (
poc/409-tag-space,poc-409/RESULTS.md, commit 4ee6683) before the full case bank existed, using the audited bench fixture as the eval set. Two findings; the second one kills the read-path tag lane as proposed.Setup. MacBook Air M2, 8 GB RAM (slowest supported-class machine). Bun 1.4.3 +
@huggingface/transformers4.3.2 +onnxruntime-node1.30, q8 ONNX. No daemon, no Python, no network after model download. Eval set:bench/fixtures/recall-dataset.ts— 52 memories, 105 queries, topically adjacent distractors by design. Caveats stated up front: the lexical scorer in the POC is a toy overlap scorer, not the repo's real one, so absolute numbers are not comparable to the published bench; comparisons between lanes on the same scorer are valid. The tagger tested is zero-shot, not fine-tuned — this was a go/no-go probe, not AC2.Finding 1 — platform and speed assumptions hold.
AC5's ≤100 ms warm budget clears on this machine with room, at ≤400 MB RSS, under Bun, in-process. One real exception: zero-shot NLI scores one (text, label) pair per label, so a 13-tag taxonomy costs ~320 ms per query. Any read-path model must be single-pass (a fine-tuned head), not zero-shot.
Finding 2 — the topic-level tag lane is at chance, and so are dense embeddings.
Lanes on the same fixture and scorer (chance = 1/52 ≈ 0.019):
Every attempt to blend tag or embedding signal into the lexical lane made it worse. Rescue analysis: of 24 queries the tuned lexical lane misses at r3, 7 have gold sharing an active tag — the signal exists but is far too weak to pay for the noise it adds.
The mechanism of the failure is exactly the objection raised in review: category agreement is not relevance. The fixture's distractors are topically adjacent by design (its anti-rigging rule 2), so topic-level similarity — whether NLI tags or dense vectors — is structurally blind on the exact axis the fixture measures. bge-small ranks gold #1 on near-lexical queries and past rank 27 on strict paraphrases (bimodal rank distribution). What bridges the gap is the row-specific keyword set: it encodes the paraphrase relation ("test users" ↔ "seed fixture accounts"), not the topic.
Consequences, as I read them.
kwbridge (+14 points of r1 over content-only). The open question therefore moves to the write side: can a small fine-tuned single-pass model generate or repairkwbetter than the capture model does today? That experiment keeps the model batch, offline, and latency-free, where this POC's platform numbers clearly apply, and it targets the relation-level signal the POC says is the one that works.This falsifies the read-path half of my own proposal and I think that is the result the review asked for before committing to machinery. Sequencing and interpretation remain with the maintainer. Happy to file the kw-quality experiment as a scoped ticket once the case bank exists.
abogartz commentedon Nov 14, 2026
POC part 2: the pivot, tested — kw quality is the whole gap, and telemetry closes part of it without any model
Follow-up on the throwaway branch (
poc/409-tag-space, commit 84ad5e4,poc-409/RESULTS.md§4). Same fixture, same toy scorer and same caveats as part 1: absolute numbers are not the published bench; between-lane comparisons on the same scorer are what count.1. Headroom — is kw quality even the lever? Oracle experiment (deliberately leaky, upper bound only): append each query's own tokens to its gold row. Toy-scorer r1 goes 0.657 → 1.000. Separately, 12 of 105 queries share zero content words with gold even with today's keywords. The entire distance between today's retrieval and perfect retrieval on this fixture is a keyword-quality gap. The lever exists and it is large.
2. Can a local model generate the missing aliases without seeing the queries? Tested two cheap shapes; both fail zero-shot.
Small models fail the theory-of-mind step — "words a different person would use" — without fine-tuning, and fine-tuning needs (memory → alias) supervision that does not exist yet. Dead end as a phase-1 move.
3. The deployable shape: telemetry-learned keyword repair. Production sees real queries. When a query fails to surface gold and the session later succeeds against a specific memory, that (query → memory) pair is evidence; the query's distinctive tokens are appended to that memory's keywords. Code-only, plain text, auditable, no model, no read-path cost. Simulated with a seeded 50/50 per-query split; additions capped at 8 tokens per row; the test set restricted to queries sharing ≤2 content tokens with ANY training query (a novelty filter that kills near-duplicate memorization):
12 training misses produced the learning; generalization survives the novelty filter, which says the learned tokens encode relations rather than memorized strings. Side effects measured honestly: 4 of 51 test queries ranked worse — learned tokens can steal rank on neighbours, so a real pipeline needs a cap below 8, an IDF discount for learned tokens, and decay. Net effect positive on this fixture.
4. The structural consequence. The telemetry pairs that drive repair are exactly the (query → memory) supervision a fine-tuned generator or reranker would need. The sequence becomes: log misses → repair keywords immediately (cheap, measured) → the accumulated pairs become the AC0 case bank → optionally fine-tune a model to pre-empt phrasings the store has not yet seen. The classifier moves from phase-1 prerequisite to phase-3 upside. This also answers the review's "measure against the inexpensive #405 alternatives" point: the inexpensive alternative is not just the second-token gate — it is the failure log itself.
Caveats. Single fixture, toy scorer, one seeded split, cap untuned at 8, assumes a (query → memory) success signal that does not exist in the product yet — producing that signal honestly is itself AC0-adjacent work. A deeper stress bench (false-pair noise, token bloat, negative transfer, the repo's real scorer) is in progress; I will post results as they land.
WhollyMindless commentedon Nov 14, 2026
The telemetry direction suggests a useful next question: how do we turn an observed query-to-memory association into trustworthy, recoverable learning? A few suggestions for the proposed repair path:
The planned real-scorer and false-pair stress tests already address several of the remaining questions. These suggestions focus on the attribution and write boundaries around the experiment; I have not independently reproduced the POC results.
abogartz commentedon Nov 14, 2026
Correction to the telemetry result: the +7 novel-transfer was a toy-scorer artifact
Follow-up stress bench on the throwaway branch (commit 69fdead,
poc-409/RESULTS.md§5). I reran the telemetry experiment with the shipped scorer (src/recall/score.ts: stopword abstention, Robertson-IF, and the two-concept evidence gate) at the published store sizes, instead of the toy overlap scorer used in my previous comment. The headline number there — +7 pts r3 on novel held-out queries — does not survive that rerun, and I am correcting it so the published record is not misleading.What the shipped scorer shows (50/50 seeded split, cap 4, sizes 50/200/500):
better = 0in every arm at every sizeWhy the toy result was wrong. The shipped matcher requires a query to share at least two content tokens with a memory before it injects anything. A paraphrase, by design, does not share the training query's distinctive tokens, so a single learned token cannot clear that gate. My toy scorer had no such gate, so it rewarded exactly the near-duplicate transfer that production deliberately refuses. The +7 was measuring a matcher the project chose not to ship.
What still holds, and is worth something. Telemetry-learned keywords are a perfect repair mechanism for observed phrasings: same-query replay goes 0.63 → 1.00 at every store size, it is immune to false-pair noise at r3 (the two-concept gate itself filters wrong-row tokens), it causes no negative transfer, and it costs nothing at read time. Real user traffic is far more repetitive than a curated fixture, so production replay value is likely larger than the fixture shows. What it is not is a generalization mechanism: novel phrasings still need a relation-level bridge — the capture model's
kw(shipped) or a fine-tuned generator — and the telemetry pairs remain that generator's training corpus.The classifier question is being reopened separately with a controlled experiment; I will report that on its own thread rather than fold it in here.
abogartz commentedon Nov 14, 2026
Part 3: the classifier, tested fairly — plus the full proposal with my recommendations
Two prior comments in this thread are superseded by the correction above (the +7 novel-transfer number was a toy-scorer artifact). This comment closes the POC: a controlled classifier test built to answer the objection that my first tag experiment was set up wrong (it was), a production-shaped replay bench, and the complete build/don't-build proposal. Branch
poc/409-tag-space, commits4ee6683..ce142ae, full writeup inpoc-409/RESULTS.md.The contrived classifier test: I could not make it fail
A fully authored 8-row store. The gold's facet combination (
benchmarks+testing+documentation) is distinctive; its content deliberately shares fewer than two tokens with each query, so the lexical lane abstains. A zero-shot classifier tags both sides; tags are appended askw— the exact proposed integration — and ranked by the shipped scorer. Model:nli-deberta-v3-base(304M, q8), threshold 0.5.Breaking-point sweep: facet-sharing distractors added one at a time; gold stays inside the injection window through 11 rows (rank 2 once a
testingneighbour arrives, never out).Setup sensitivity is real and material. The same test with
nli-deberta-v3-small(144M) tags the query "how do I run the bench" as{readme, monitoring}— wrong — and returns an empty tag set for another query. My original tag POC used the small model in a standalone lane on an adversarial fixture; three handicaps stacked. The architecture was never the thing that failed.Where the boundary actually is
Re-running the real fixture with the base model separates two things I had conflated:
So: the tag lane works when the gold is facet-identifiable (real memories like "the bench lives in bench/" usually are), and is structurally blind on same-facet-different-question pairs (which the fixture deliberately is all of).
Rescue-only integration (tags select candidate rows only when the baseline abstains; the two-concept evidence gate unchanged): zero rescue, zero harm, all store sizes. Candidates without shared tokens score nothing through the gate. Respecting the gate makes the tag lane a no-op; bypassing it (tested as L5/L6 arms) scores below baseline. The gate is precisely what protects precision.
Replay-heavy stream: the surviving claim is stronger than I said
Production-shaped traffic through the shipped scorer: 262 items, every query recurs 1–3× plus deterministic near-variants; telemetry learns sequentially on misses.
Near-variants clear the two-concept gate after repair (+18 pts) because they share most tokens with the original query. Overall stream r3 ≈ 0.65 → ≈ 0.85. The curated 50/50 split understated telemetry because it forbids repetition; real traffic repeats.
The full proposal
Recommend (phase 1, no models on the read path)
kw. On a miss (gold exists but ranked outside the window, or abstention with a later-confirmed reference), append the query's distinctive non-stopword tokens to the gold row'skw. Cap 2–4 tokens, IDF-discount learned tokens, decay them over time. Measured: same-query replay r3 0.63 → 1.00; noise at eps 0.5 costs 0 pts r3; no negative transfer; zero read-path cost. This is a memorization cache of failures, not a generalizer — that is a feature: it is the one mechanism here with no downside profile.kwquality. It remains the only shipped bridge for genuinely novel phrasings, and it is where the remaining strict-paraphrase gap lives.Conditional (phase 2, only if the prerequisites land)
Discourage
kwalready is.Footguns encountered (documented so the next person does not repeat them)
@huggingface/transformersv4 zero-shot takes candidate labels positionally —pipe(text, labels, opts), not an options field. Silently wrong results otherwise.rankOfdereferenced.goldon a string (indexOf(undefined)→ 0), so every query looked already-satisfied and the learn gate never fired. Test the success signal itself, not just the outcome.abogartz commentedon Nov 15, 2026
Part 3: the scorer is a cliff, local verifiers cannot rescue it, and the free lane is the caller
POC continues on
poc/409-tag-space(poc-409/RESULTS.md§8–10,opt1-lit.ts,gate-ablate.ts,opt1-rerank*.ts,opt1-agentexp.ts). This part supersedes the "read path is closed" pessimism with a measured way through it.1. The scorer is a cliff, not a ranker
For every test miss at store sizes 50/200/500, the gold row is rank 1 or nowhere — zero misses have gold at ranks 2–8. The two-concept gate admits or executes; ranking barely happens. This kills, on this fixture, every idea whose mechanism is reordering candidates: rerankers over the lexical set, embedding lanes, tag-space rescoring. #405's "matching failure, not ranking failure" is now measured, not asserted.
2. Gate surgery and local verification: both Pareto-dominated
Gate ablation (variant scorer G0-verified byte-equal to the shipped one on all 51 test queries first):
Last read-path idea from the literature (two-stage retrieve-then-rerank, repurposed as gate rescue): bridge-admit on one kw token, verify each candidate with a tiny local model, only on queries that abstain today. Two verifiers, both fast enough to be irrelevant excuses:
Every threshold of both is Pareto-dominated by the shipped scorer. Mechanism identified: strict paraphrases share zero content words with gold content, and synonym-leap bridging is precisely what fails below 304M.
3. The free lane: the caller donates the bridge
The product already runs a large chat model in every session — the one making the tool call. If the tool description tells it to write synonyms and alias phrases into the recall query, the bridge costs nothing: zero added latency, no new dependency, no scorer change, no taxonomy.
Protocol: a fresh subagent (same model class as the session) saw only the 51 test queries — no repo access — and returned 3–6 alternative phrases per query ("why do my throttling rules never take effect" → "rate limiting config; 429 not enforced; limiter bypass debug"). Output audited for fixture-only tokens: none found. Scored with the shipped scorer against the human-kw store:
Flip audit (size 200): 13 abstain→hit, 1 wrong→hit, 1 abstain→wrong, 1 hit→wrong. +14 hits for +1 wrong — compare kw_bridge's +4 for +5. First Pareto-dominant lever in this entire POC on the ticket's own criterion.
Why it works where every local model died: the gate never needed a smarter matcher — it needed the query to arrive with a second vocabulary. The session model shares domain vocabulary with the memory author (in production, often the same model family), so its synonyms land on the words the memory actually uses.
Caveats, stated before anyone finds them
Running now, will report
Implementation shape if it survives: rewrite the
memory_recalltool description to require 3–5 synonym phrases in the query. Small prompt change, small code change, no model.abogartz commentedon Nov 15, 2026
Part 4: stress-testing the expansion lane — it leaks, and an IF floor plugs it
Part 3 promised four stress tests. Three are in, plus the capture-side audit of the competing hypothesis.
poc-409/opt1-stress{,2,3}.ts(+*-out.json), commits through89abcd9.Variance: stable
An independent second expansion draw (fresh subagent, same protocol): r1 0.941 again at all store sizes (wrongs +1 query vs draw 1). The +23 is not a lucky draw.
Harm: the naive lane leaks badly
The decisive test — most real recall calls have no useful memory. 25 no-gold queries (off-fixture domains + deliberate near-misses like "gRPC vs REST", "docker build cache", "PCI compliance"), expanded blind by the same protocol:
The near-misses caught exactly what theory predicted: "price API tiers" → rate-limiter row (the expansion's own "rate limit charges" token), "gRPC vs REST" → the fastify-vs-express row, "OpenTelemetry" → a test-suite row. Appending ~40 content tokens to every call makes two accidental agreements common. Not shippable as-is.
Gate shapes trade; they do not escape
exp2 (row must match ≥2 expansion tokens), both1 (≥1 original + ≥1 expansion token), rescue-only (expand only when the original abstains): all move along the Pareto frontier (gold r1 0.86–0.94, harm 0.28–0.44) without returning to baseline harm.
The IF floor escapes
Robertson-IF is already computed. Requiring the top-1's shared-token score ≥ F:
The mechanism matches the hypothesis from part 2: gold expansion matches ride rare tokens (timestamptz, crashloopbackoff, pagerduty); false matches ride common ones (library, choice, config). A score floor keeps the rare-token bridges and drops the common-token collisions. +20 recall points at zero measured harm increase — on the ticket's two axes, this is the shape.
Footgun, stated: F=10 was tuned on this fixture at size 200. Document frequencies scale with store size, so F must be fitted on a case bank (AC4-style), not hardcoded.
The capture-side audit of the alternative hypothesis
Was the problem memories not landing (truncation, dupe rejection)? Live store numbers: auto-capture wrote 380 rows with 16 refusals (~4%); capture lag p50 16 ms. Writes land. Meanwhile 41% of the store (461 of 1,122 rows) has never been retrieved in 30 days. Some of that is healthy aging, but it is consistent with the cliff: the gate executes rows at read time that capture did its job on. The failure is resurfacing, not capture.
Where this lands
Implementation shape:
memory_recalltool description requires 3–5 synonym phrases plus an IF-score floor on injection, fitted on a case bank. No models, no taxonomy, no cloud. Remaining proof: the end-to-end test — #316-style warm-vs-cold on new bugs in a known repo, where the memory's wording was always slightly off the new bug's. That is the bench the "autocapture doesn't help novel bugs" verdict deserves a re-run against.WhollyMindless commentedon Nov 15, 2026
Two concrete checks from an independent probe of published main (
6728d49, v0.25.0), following the expansion results above. These may be useful before integration:Exercise the actual
memory_recallhandler as a separate evaluation path. The POC description identifiessrc/recall/score.tsas the tested scorer, butmemory_recallcurrently uses its own substring-count matcher, with scope/type bonuses and a default limit of 20. It does not use the injection scorer's stopword filter, two-concept gate, or Robertson-IF score. In a synthetic store, the querywhy do my throttling rules never take effectreturned a row containingRate limiter reads Redis DB 3.with keywordsthrottlingandrate limit storethrough the actual tool handler;scoreMemoriesabstained. Adding the reported expansion made the injection scorer admit it, while the tool already returned it. A description change plus an injection-only score floor therefore would not by itself connect the tested behavior to the tool's returned results. Suggest evaluating the actual handler and checking every returned row, with any intended scorer alignment made explicit.Check ties and memory-order sensitivity before interpreting “rank 1 or nowhere.” The public
buildStoreputs authored rows before their variants, and the benchmark conversion gives every row the same timestamp. With the keyword-enabled 200-row fixture and querywhich redis db does the rate limiter use, the expectedm02(DB 3) and variantm02#105(DB 975) both score10.886856910082415. Reversing the input rows makes that conflicting variant rank first and moves the expected row to fourth. Suggest seeded memory-order permutations and explicit tie reporting; some variants are equivalent answers, but this one changes the configuration value. This check could distinguish an admission cliff from fixture ordering that hides a ranking ambiguity.Reproduction scope: Windows, Bun 1.4.4, unchanged published matcher functions and the registered recall handler; storage, host/schema, visibility and telemetry boundaries were stubbed with fictional visible rows. No live user store was accessed. I could not fetch
poc/409-tag-spaceor89abcd9, so these are observations about published code and fixtures, not a reproduction or refutation of your POC. Your experiment may already handle these distinctions. Both checks are offered as small validation steps; sequencing and implementation remain your call.abogartz commentedon Nov 15, 2026
POC lanes for #409 — retrieval without another prompt nudge
Written 2026-11-15 after reading the POC results and running the K-block smoke. This is a menu
of untried lanes, ordered by cost. Nothing here is implemented; the shipped path is unchanged
(plugin
0.25.0, branchpoc/409-tag-spaceate9be15e).Premise
The failure this ticket describes is a vocabulary gap between the asking session and the stored
row. The K-block added a second finding: when the asking model is told to bridge that gap itself,
it does not. It issued one query (
"build test commands invariants bugs", 5 words) at step 2 of a41-event run, received the
[matcher]nudge in the result, then made 18 more tool calls withoutre-querying. That is the documented norm, not a local quirk: agents re-retrieve in ~10% of cases
and return the same documents 53% of the time when they do (arXiv 2601.07711), and prompt-level
rules about tool behavior are followed "at most partly" (arXiv 2610.06191). Instructions placed in
tool output are the lowest-priority channel in the hierarchy (arXiv 2404.13208). So every lane
below removes the model's decision rather than asking the model to decide better.
Already closed — do not repeat
The untried space is: model-free corpus feedback, tokenization, write-side fields other than
aliases, structural (path) retrieval, and using signals the agent already emits.
Lane 0 — Measure usage before measuring retrieval (do this first)
Claim. If the agent ignores rows that recall already returns, no retrieval improvement can
move outcomes, and the ticket should be narrowed or closed.
Method. Offline, no model. The K-block run directories hold full transcripts
(
results10/<pass>-<task>/out.jsonl, 41 events,tool_usewith arguments). For eachmemory_recallresult, parse the returned rows, extract the paths and backticked commands theycite (the extraction already exists:
extractPathRefsinsrc/gate/resolver.ts, used bysrc/inject/attribution.ts), and test whether any latertool_usein the same transcript namesone of those paths or commands. Report three numbers per run: recalled rows, rows whose refs
appear later, rows that were the only source of a later-read path.
Why it is new.
attribution.tsalready computes this shape, but only for rows that rode theinjection block. Recall hits are recorded in the use ledger with
src: "recall"(
src/hits/ledger.ts:32, written atsrc/tools/recall.ts:83), and no caller joins them to latertool calls.
Kill criterion. If ≤20% of recalled rows are later referenced, stop optimizing retrieval and
write that finding into #409.
Cost. One afternoon, no model calls.
Lane 1 — Pseudo-relevance feedback on the abstain path
Claim. The misses are gate abstentions, not rank errors (RESULTS §9: "every miss is a gate
abstention"). On an abstain there is no evidence to rank, but there is usually a near-miss row
whose vocabulary is closer to the store's than the query's. Feed those terms back and search once
more.
Method. In
poc-409/(not insrc/), add a runner that reproduces the shipped scorer onbench/fixtures/recall-dataset.ts(105 queries, 52 memories). Baseline:scoreMemories(
src/recall/score.ts:57). Treatment: when the shipped scorer returns nothing, compute anungated IF ranking (copy the scoring loop, skip the
needSharedgate atscore.ts:66), take thetop 3 rows, harvest up to 5 content terms they use that the query does not, add them with weight
0.5, re-score. Optionally one second round only.
Falsification. Beat baseline r1 by ≥5 points at ≤2× wrongTop1 across all 105 queries, and
hold the 25 no-gold queries in
poc-409/neg-queries.txtat baseline harm. Any drift into the0.44-harm regime kills it; that is the documented failure mode of feedback expansion (SoK,
arXiv 2603.07379, semantic drift).
Why it is new. Only expansion of the query by a model was tested. Corpus feedback on your
own store was never tried, and it cannot be contaminated by an external vocabulary.
Cost. Hours. No model, no dependency. Precedent: Rocchio relevance feedback (1971); RM3,
Lavrenko & Croft, SIGIR 2001.
Lane 2 — Tokenization before semantics
Claim. A slice of the synonym wall is morphology and identifier shape, not vocabulary.
Method.
words()(src/recall/score.ts:8) lowercases and splits on non-alphanumerics, sogetUserAccountis one token,get_user_accountis another, and "deploy" never matches"deployment". In a runner, compare the shipped tokenizer against: (a) split on
_and caseboundaries before lowercasing; (b) suffix stripping (plural, -ing, -ed, -tion); (c) a small
abbreviation map (db, cfg, env, auth, repo); (d) character 4-grams as a low-weight fallback for
query terms that match nothing. Measure with the store's
kwpresent and absent, because thealias field already covers some of this.
Falsification. <3 points r1, or any rise in wrongTop1 on the no-gold set.
Why it is new. No tokenizer experiment appears in RESULTS; all vocabulary work moved to
aliases instead. Precedent for subword matching: fastText, arXiv 1607.01759.
Cost. Hours, no model. Highest certainty per unit of work on this list.
Lane 3 — Write the question, not only the answer
Claim. Question-to-question is an easier lexical match than question-to-fact.
Method. The capture prompt already asks for
kw("how a DIFFERENT session would ask forthis",
src/capture/prompt.ts:77). Add one field,asked: the single sentence a future sessionwould type to need this row, with no repo name, no session name, no "we". Index it in the
haystack. Note that this rides the shipped capture model, which is far larger than the 1.5B model
that failed in §8 arm E, so the format wall may not reproduce.
Test. Generate
askedfor the 52 fixture memories with whichever model the product runs, thenscore the 105 queries with and without the field indexed.
Watch. #329 measured that session-scoped prose gets stored back as durable rows.
askedmustbe generic or it reintroduces that leak.
Falsification. <5 points r1, or
askedtext that fails a "would this make sense in a freshrepo" audit.
Cost. 1–2 days including the audit. No extra model call at capture time.
Lane 4 — Give the model a table of contents
Claim. A 5-word query looks like not knowing what is in the store. Choosing from a list is a
different task from recalling vocabulary.
Method. Two steps, cheapest first. (a) On gate abstain, return the scopes that exist, so the
next attempt can aim. (b) A second tool,
memory_index, returning scopes plus row titles cappedby the injection budget. Before building (b), test the hypothesis offline: for each of the 105
queries, would a title list have contained the gold row's scope or title tokens? That stat costs
nothing and tells you whether (b) can possibly help.
Why it is new. No browsing affordance exists today; the agent gets either hits or silence.
Precedent: MemGPT hierarchical memory (arXiv 2310.08560) and the search/find/open toolset in
arXiv 2605.05538, where navigation is a separate action from search.
Kill criterion. If gold titles share no tokens with their queries, skip (b).
Cost. (a) is a small change to the recall return string; (b) is a new tool and a budget.
Lane 5 — Negative aliases
Claim. Expansion's blocker is harm, and harm is row-level, not score-level. The IF floor only
works with a threshold fitted per store size (RESULTS §11).
Method. Add an optional
avoidfield: words that must not bring this row back. Score effect:drop the row when an
avoidtoken is present and nokwtoken matches. Mine the initialavoidsets from the 25 no-gold queries and the wrong wins already recorded in
poc-409/neg-expansions.tsvand
expansions2.tsv.Test. Same two axes on the same sets, with the expansion lane on, so the comparison is against
the 0.44-harm regime rather than against baseline.
Falsification. Harm at or near baseline while gold r1 stays ≥0.90.
Why it is new. The store schema has no negative field; the schema is at
src/store/model/memory.ts. Precedent: Rocchio's negative feedback; negative expansion is standardIR practice and does not need a model.
Cost. ~1 day plus a fixture pass.
Lane 6 — Retrieve by reference, not by wording
Claim. When the agent is reading a file, exact-word matching is unnecessary: the memory
already names the file.
Method.
contextualPull(src/inject/pull.ts:30) fires ongrep/glob/readand scoresargText(args)lexically. Add a deterministic reference channel: rows citing the touched path, ora path in the same directory, ride alongside the lexical picks.
extractPathRefsalready exists;the store is already loaded in that path. Measure first, offline: from the K-block transcripts,
for each later-read path, was there a stored row citing it? That number is the upper bound on what
this lane can add.
Why it is new. References are used for attribution and for the CONFLICT check, never as a
retrieval key.
Falsification. Coverage stat near zero, or the added rows dominate the budget.
Cost. Hours for the measurement, ~1 day for the channel.
Lane 7 — Score the agent's tool arguments, not its prose
Claim. The model's prose query is vague; its shell and read calls carry exact paths, symbols
and commands, which is the vocabulary the matcher rewards.
Method. The injection lane scores the latest prompt only
(
src/inject/epochs.ts:195). Compose the scoring query as prompt + the last two tool calls thesession made (the call ledger already exists via
callsFor(sid)), and score at epoch freeze only.Freeze-time scoring keeps the prompt cache safe; there is no per-request churn.
Test. Offline first: replay the K-block transcript prompts and tool arguments, compare the
top-5 row sets for prompt-only versus prompt+args, and check whether the rows the agent later used
enter the set.
Falsification. No change in top-5 composition on ≥30% of turns.
Cost. Hours offline; small change if it wins.
Lane 8 — Distill a bridge classifier, do not train from scratch
Claim. The 22M cross-encoder failed at gate rescue zero-shot; it was trained for passage
relevance, not for synonym leaps between a terse memory and a terse query. That is a
distribution gap, not a capacity proof.
Method. Reuse the §10 expansion pairs as positives and the 25 no-gold queries as hard
negatives. Fine-tune
cross-encoder/ms-marco-MiniLM-L-6-v2(already measured at 2.1 ms/pair onthis machine) as a binary bridge classifier, evaluate on held-out pairs, then plug it into gate
rescue. Only worth starting if Lanes 1–2 fail to close the gap; it is the most expensive lane and
the only one needing training time on the M2.
Falsification. Held-out precision below the shipped scorer's precision at the same recall.
Cost. Days. Platform budget already verified (RESULTS §1: ≤400 MB RSS, warm 2–14 ms).
Guardrails for whoever runs these
(recall: 7 of 21 curated query/gold pairs retrieve nothing, even with the gold alone in the store (needShared=2) #405 says this explicitly).
size does not transfer.
run2-ab.ts:216-220overwrites the hidden-suite grade withtimeout, so a finished-but-slowfix is recorded as a failure. No outcome claim should be drawn from that block as configured.
bench/runners/recall-quality.tsalready ships deliberately wrong armsso the metric can fail; keep that discipline in
poc-409/.My order
Lane 0, then 1 and 2. All three are offline, model-free, and cheap enough to run several times in
one afternoon, and together they answer whether the problem is the query, the tokenizer, or the
fact that nobody uses what is already retrieved. Lane 4 is the strongest product idea if Lane 0
says recalled rows are used but the right ones are never fetched.
References
per call)
8 remaining items
abogartz commentedon Nov 15, 2026
Lane 8 result: killed without training — and §9 needs one sentence corrected
Follow-up to the Lane 3 comment. Full write-up:
poc-409/RESULTS.md§23. Script:poc-409/lane8.ts(+
lane8-out-{50,200,500}.json). No training ran.Lane 8's claim: the 22M MS MARCO cross-encoder failed as a gate verifier (§9) because it was
pretrained for passage relevance, so that is a distribution gap, not a capacity proof; fine-tune it on
§10's expansion pairs as positives and the no-gold queries as hard negatives. Cost on this machine:
days, 8 GB, no torch in the system python. Pricing it first was the cheap move.
§9 was over-read
§9 swept absolute thresholds — the gate's own question, "admit this pair or not" — and found no
separation. That is not the same as no signal. Used as a ranker inside the pool that bridge
admission already produced, where one slot is on offer, the frozen model ranks the gold above the kin
rows most of the time, including when the gold sits on the irrelevant floor:
At store 200, 11 of 13 gold pairs score below −10 — the model calls them irrelevant in absolute terms
and still puts them first inside their own pool. The lexical score that built the pool is at chance.
The prize is capped, and the frozen model already has most of it
The bridge stage's ceiling is not the 30 abstentions. It is the abstentions whose pool contains the
gold at all:
A perfect fine-tune wins 3-4 queries over a model that needs no training.
The labels do not exist
Bridge pairs are by definition the pairs the shipped gate rejects, so the positive count equals the
column above:
Training a binary classifier on 13 positives and holding out 5 is not a measurement. The lane's own
falsification — held-out precision below the shipped scorer's at the same recall — cannot be read at
n = 5 with a margin wider than the 4-query prize.
Harm forces the thing the model lacks
Top-1 admission, threshold swept, store 200 (13 of the 25 no-gold queries get a pool at all):
Same Pareto shape at every store size: harm near zero costs almost every rescue. A fine-tune would
have to supply exactly what the frozen model does not have — an absolute score separating floor-gold
from floor-kin — from 13 positives that all sit on that floor.
Compute was never the constraint: 204 new pairs in 414 ms warm, 2.0 ms/pair, matching §1. A full
matrix pass is seconds. Labels are the wall.
Verdict
Lane 8 is killed without training. Not because a 22M model cannot bridge — it can, 0.86 within-pool
AUC — but because the stage it would serve is capped at 13 of 105 queries, the frozen model already
takes 9, and the last 4 cannot be bought with 13 labels without paying 52% wrongTop1 on the no-gold
set.
Two things to carry out of this: §9's mechanism sentence should be read as "no absolute relevance
signal at ≤304M", which is what was measured; and the menu is now exhausted — Lanes 0, 2, 3, 4, 5, 6,
7, 8 closed, Lane 1 closed standalone but payable behind the dedup pass, Lane 9 (near-duplicate
suppression) shipped behind
OPENCODE_MEMORY_DEDUP. What is left is not a retrieval lane: it is anoutcome measurement with a budget where runs finish, because the 150 s K-block times out 18/18 and
cannot separate anything.
abogartz commentedon Nov 16, 2026
Case bank (AC0) is built — it kills the IF floor, retires the 0.16 baseline, and settles item 3
AC0 ("a case bank of query/gold pairs with difficult negatives and grouped splits") has been the stated blocker on every precision claim in this thread. It exists now. Two of this ticket's numbers did not survive it.
Why it was needed, in one measurement
Re-running §11's floor sweep with grouped splits — the fixture writes 2–3 phrasings per gold row, so a query-level split lets a threshold see one phrasing and get scored on another — and holding out half the 25 negatives:
Fitting on the fit half picks F=8 (harm already 0 there on 11 negatives); F=8 held out is 3 false injections above baseline. McNemar on the paired outcomes: F=8 vs F=14 is 3/0 discordant, p=0.25. A 21-percentage-point difference in false-injection rate is statistically invisible at n=14. That is what "needs a case bank" actually meant, and it is a power problem, not a modelling problem.
What the bank is
9fb43da547cba1beReal query text out of the session transcripts, each resolved against the store its own session could see (visibility from the session's directory, not an ambient reader), scored by both matchers, plus one random visible row per query that neither matcher returned. One row per distinct query, not per call — a scheduled task issued 515 of the 1,067 calls, and counting calls would measure that task instead of retrieval.
Judge. A 27B seat, temperature 0, no tools, no repo access, told explicitly that a row being returned is not evidence it belongs. Rows are shuffled with controls so it cannot learn which is which.
Calibration. Of 404 control rows — a random row that merely happened to be in the store — 8 were called relevant (2.0%) and 0 were called an answer. That is the floor every number below has to clear.
Reliability. A different model (DeepSeek V4 Flash) re-labelled a 60-case sample: kappa 0.71 on "does this query have an answer in the window", 0.75 on "is this row an answer", 0.58 on the 3-way scale. Only 2 of 284 row judgements differ by two levels. A blind third reader (me) then scored a 27-row sheet: exact kappa 0.20 against the main seat and 0.48 against the second, but 24/27 raw agreement with the main seat on answer-or-not. Read that as the scale being soft exactly where the 3-way kappa said it was soft — the useful-vs-nothing line — with me the most generous of the three, most likely because I know what each query was actually for and the other two can only read it. The answer boundary, which is what every headline below uses, holds across all three.
Data files are gitignored — they carry live query text and live memory prose. Scripts, aggregate JSON and the summary are committed on the POC branch
poc/409-tag-spaceunderpoc-409/casebank/. That branch is local only (nothing here touchessrc/); say the word and I will push it, or open a docs-only PR with the scripts andSUMMARY.mdso the instrument is reviewable.Labels on real traffic
Across all 404 queries and 1,863 labelled returned rows: 527 answer, 559 useful-but-not-an-answer, 777 irrelevant. The window the agent receives is majority filler today.
Finding 1 — the IF floor has no admissible value
Admissibility rule fixed before looking: a floor may be chosen only if, on the fit half of groups, it loses no gold at rank 1 and shows no-gold queries no extra window. The only admissible value is F=0.
Held-out exchange rate:
Every floor starts costing answers before it removes enough noise to be worth buying. §11's "F=10, +20 recall at zero harm" was read off the same 25 hand-written negatives it was then scored on. §11's escape does not hold; the floor lane is closed, not deferred.
Finding 2 — the 0.16 false-injection baseline was fiction
The whole precision framing assumed the shipped scorer abstains on ~84% of queries with nothing relevant. On real no-gold queries it does not:
The tool returned at least one row on 217 of 227 held-out queries — it almost never abstains. My synthetic negatives shared no vocabulary at all with the fixture, which is the only reason the scorer abstained on them and the only reason a floor looked free. Any future precision claim must use the real rate as its baseline.
Finding 3 — item 3 is a real win, and it is not free
The reviewer was right that
memory_recalluses its own substring matcher rather than the injection scorer. Both matchers were now run over the same 227 held-out real queries:Paired (McNemar): an answer where the other had none — tool 5, injection 17, p=0.017. But the injection scorer abstains where the tool returns something on 11 queries vs 1 (p=0.006), and rank 1 is a dead tie (55.1% vs 55.5%).
So alignment is a genuine gain in what lands in the window and a genuine cost in how often anything is returned. That is a product decision, not a benchmark result, and I am not opening a PR for it without one.
What the bank does not fix
provenance.json's store hash is what a later fit must be checked against.Reproduce
build.ts --from-snapshotrecomputes scores against the pinned snapshot and refuses to run if candidate membership moved — the judge's row numbers are positions in that order.abogartz commentedon Nov 16, 2026
Tracking: the four PRs this ticket produced
Everything measured here is now in review as four independent pull requests, each branched off
origin/main(6728d49, v0.25.0). All four are mergeable with all required checks green. None is merged.OPENCODE_MEMORY_DEDUP=0.8camelCase,_,.,-) in the matcher tokenizermemory_recallmatch must share two of the query's words once the query has threeOPENCODE_MEMORY_QUERY_GATE=1What the case bank retired from this ticket
Two numbers earlier in this thread no longer hold, and the correction is worth more than either original claim.
§11's abstention floor is dead, not deferred. "F=10 restores baseline harm at +20 r1" was fit on the same 25 negatives it was scored on. Re-run with the gold rows split by family and half the negatives held out, the only admissible value under a no-gold-loss and no-extra-window constraint is F=0. McNemar F=8 vs F=14 on the held-out negatives: 3/0 discordant, p=0.25 — a 21-point difference in false injection is invisible at n=14.
The assumed 0.16 false-injection baseline was fiction. The synthetic negatives shared no vocabulary with the store, so the tool never matched them. On real traffic the tool shows a window to 85% of queries where nothing in the store answers the query. The failure mode is not confident noise on hostile queries; it is that the tool essentially never abstains.
The instrument is 404 real recall queries from 30 days of session transcripts, scored against a pinned 1,175-row store snapshot, labelled by two unrelated reader seats (kappa 0.71 query-has-answer, 0.75 row-is-answer, 2 rows of 284 apart by two levels). Calibration: 8 of 404 control rows called relevant, 0 called an answer. Its data files are derived from the live store and are deliberately not committed; the builders are not yet landed either, so these numbers are not reproducible from the pull requests alone. That is a fair review objection and it is open.
What the four PRs do not claim
Before more than one is merged
#415, #416 and #418 all change the same returned window — one suppresses copies, one shortens it, one narrows admission — and each was measured alone. The combined effect on composition and on the no-gold axes is not yet measured, so I would not merge more than one without re-running the published bench runner and the case-bank arms against the combination. Say which order you want and I'll produce those numbers.
abogartz commentedon Nov 16, 2026
Instrument rebuild + all four PRs reworked (2026-11-16)
The labels were clipped; they have been rebuilt. The store never truncated (cap 4,000 chars, write gate rejects rather than cuts) — but the case-bank judge saw row prose clipped to 500 chars, so 83% of the original labels were partial. All 1,863 pairs were relabelled with full text; a byte-identical rerun reproduced 2,267/2,267 labels (temperature 0 is reproducible), yet changing a batch neighbour's text flips 13.6% of unchanged rows — batch context, not sampling noise. Every pair a gate moved in or out of a window (44) was re-adjudicated in isolation on two seats; the isolated seats overturned 29 of the 36 disputed ANSWER labels. RESULTS §25 is marked void; §26 documents the protocol.
Reworked, pushed, CI green, none merged:
283no longer matchesbuild2837;onno longer matchescontext), shared stopword list, env allowlist (=nois off). Adjudicated held-out: gold@1 56→57, paired 1/0 (p=1.0), rows 571→479, non-answering 438→346; flag off byte-identical 404/404.never force push mainis no longer a copy offorce push main), non-Latin floor, sub-0.5 clamp, newest copy survives. At default limit 20: 187 rows suppressed across 61/404 queries, no query lost its only answer; one disclosed failure mode (distinct commands sharing boilerplate reach 0.85).Open: the outcome run with separable arms (the only measurement that can price 0.8 dedup and the limit trade against task success), and IDF ranking for the +12-answer class.
Merge pull request #415 from abogartz/feat/409-dedupe-window
chore(release): 0.26.0 [skip ci]
fix(recall): default the memory_recall window to 5 rows, not 20 (#409)
Merge pull request #416 from abogartz/fix/409-recall-limit-5
Merge pull request #417 from abogartz/perf/409-identifier-tokenizer
chore(release): 0.26.1 [skip ci]
feat(recall): two-concept admission for memory_recall behind a flag
chore(release): 0.27.0 [skip ci]
Merge pull request #419 from abogartz/capture-symptom-first
abogartz commentedon Nov 17, 2026
Closing: the two halves of this problem that can be fixed lexically are fixed and shipped.
Shipped:
DISCOUNT_TIERS↔ "discount tiers"). Released 0.27.0.learning/blockerrows lead with the observable symptom; keywords carry the failing command / distinctive error text). Released 0.28.0. Measured on the same lesson row: surfaced 0/8 as diary prose; symptom-first it ranked 1-7 on every observed query pattern and delivered 8/8.Reframing: the reliable lever was not making the search guess the searcher's synonyms — it was making capture write down tomorrow's words, because tomorrow's searcher is staring at a symptom. The auto-alias experiment (main model generating synonym keywords) made retrieval significantly worse (gold@5 207 vs 216; McNemar p=0.004) and was killed.
Remaining gap — queries sharing no token with a row or its keywords — needs embeddings and is tracked in #420.