recall scoring: recency from day zero, neutral abandoned weight, release 6.10.0 #28

Merged
tim merged 4 commits from feat/recall-scoring-23 into develop 2026-11-02 20:16:33 +00:00
Owner

Closes #23. Lands as its own release so the ranking move can be attributed.

Benchmark first

The existing benches cannot see this change: the embedding bench measures speed and vector equivalence, and the LongMemEval harness ingests everything "now" with no outcomes (every age is ~0, nothing is abandoned), and costs about $30 per 60-question run. So the first commit adds scripts/recall_scoring_bench.py: seeded scenarios with controlled ages and recorded outcomes, the real RecallPipeline, a throwaway valkey-search and the real model. docs/recall-scoring.md has the method and how to run it.

Upstream's 7.0.3 notes give no numbers, so I read the Rust (recall.rs at v7.0.5) for the exact change: recency declines linearly from 1.0 at day 0 to 0.9 at the cliff, then continues at the old rate; abandoned weight 0.1 -> 1.0; no auto-suppression on abandonment.

Results (6.9.4 vs this branch, 3 paired seeds, mean; range is the per-seed change)

Metric before after change
newer of two statements ranks first, both inside the cliff 48% 88% +40 pts (+33 .. +45)
same, straddling / past the cliff 100% 100% 0
dead end in top 3, task query 0% 99% +99 pts
dead end in top 3, query names it 0% 100% +100 pts
dead end missing from top 10 97% 0% -97 pts
topics auto-suppressed (40 recordings) 20 0 -20
cost: working approach still above its dead end 100% 96% -4 pts (-5 .. -2.5)
cost: exact source memory, MRR 0.551 0.527 -0.024 (-0.045 .. -0.006)
cost: exact source memory, hit@5 75.0% 71.1% -3.9 pts (-6.7 .. -0.8)
cost: mean age of the top result 35.7 d 24.0 d -11.6 d

Things the numbers say that I did not expect:

  • The keyword fast path already warns 100% of the time when the query names the dead end, and 0% when the query only describes the task. The abandoned-weight change matters for the second case, so it is not redundant with the fast path.
  • The bench has run-to-run noise (same code and seed gave 0.85 and 1.0 on one metric, most likely HNSW approximate search), which is why compare takes several seeds and shows the per-seed range. A single-run first look suggested a regression in one band that disappeared on repeat.
  • The age cost is real and consistent in sign on all seeds. The corpus is templated (many near-duplicates), so a newer near-duplicate displacing an older exact match is common there; the benchmark does not show how large the effect is on distinct memories, so I state it as a cost.

Changes

  • recency_weight() replaces the two inline copies in memory/recall.py. RECENCY_DECAY_DAYS <= 0 keeps the old behaviour (old rate from day zero).
  • compute_experience_weight: abandoned 1.0 (effort still never amplifies it).
  • Migration needed and included: recall reads the stored experience_weight, so changing the formula alone would leave every existing dead end at 0.1. migrate_abandoned_weight runs at startup, idempotent, does not touch updated_at (the skill compiler reads that as "source changed").
  • record_experience: auto-suppression removed, auto_suppressed key gone from the result. Suppressions made by earlier versions stay (a set cannot tell them from manual ones): CHANGELOG tells the operator to review with list_suppressions().
  • Two existing tests encoded the old behaviour and were updated: test_abandoned_weight_ignores_effort (0.1 -> 1.0) and test_no_ranking_effect (two identical memories written milliseconds apart no longer tie exactly because recency counts from day zero; the test now pins created_at, the provenance assertion is unchanged).
  • Docs: new docs/recall-scoring.md; memory-episodic.md, configuration.md, features.md, CLAUDE.md updated. Version 6.10.0 (minor: behaviour change) + CHANGELOG.

Checks

ruff check, ruff format --check, ASCII check, bandit on the changed files (no findings, no suppressions added), pytest: 2086 passed, 1 skipped (was 2071).

🤖 Generated with Claude Code

Closes #23. Lands as its own release so the ranking move can be attributed. ## Benchmark first The existing benches cannot see this change: the embedding bench measures speed and vector equivalence, and the LongMemEval harness ingests everything "now" with no outcomes (every age is ~0, nothing is abandoned), and costs about $30 per 60-question run. So the first commit adds `scripts/recall_scoring_bench.py`: seeded scenarios with controlled ages and recorded outcomes, the real `RecallPipeline`, a throwaway valkey-search and the real model. `docs/recall-scoring.md` has the method and how to run it. Upstream's 7.0.3 notes give no numbers, so I read the Rust (`recall.rs` at v7.0.5) for the exact change: recency declines linearly from 1.0 at day 0 to 0.9 at the cliff, then continues at the old rate; abandoned weight 0.1 -> 1.0; no auto-suppression on abandonment. ## Results (6.9.4 vs this branch, 3 paired seeds, mean; range is the per-seed change) | Metric | before | after | change | |---|---|---|---| | newer of two statements ranks first, both inside the cliff | 48% | 88% | +40 pts (+33 .. +45) | | same, straddling / past the cliff | 100% | 100% | 0 | | dead end in top 3, task query | 0% | 99% | +99 pts | | dead end in top 3, query names it | 0% | 100% | +100 pts | | dead end missing from top 10 | 97% | 0% | -97 pts | | topics auto-suppressed (40 recordings) | 20 | 0 | -20 | | **cost:** working approach still above its dead end | 100% | 96% | -4 pts (-5 .. -2.5) | | **cost:** exact source memory, MRR | 0.551 | 0.527 | -0.024 (-0.045 .. -0.006) | | **cost:** exact source memory, hit@5 | 75.0% | 71.1% | -3.9 pts (-6.7 .. -0.8) | | **cost:** mean age of the top result | 35.7 d | 24.0 d | -11.6 d | Things the numbers say that I did not expect: - The keyword fast path already warns 100% of the time when the query *names* the dead end, and 0% when the query only describes the task. The abandoned-weight change matters for the second case, so it is not redundant with the fast path. - The bench has run-to-run noise (same code and seed gave 0.85 and 1.0 on one metric, most likely HNSW approximate search), which is why compare takes several seeds and shows the per-seed range. A single-run first look suggested a regression in one band that disappeared on repeat. - The age cost is real and consistent in sign on all seeds. The corpus is templated (many near-duplicates), so a newer near-duplicate displacing an older exact match is common there; the benchmark does not show how large the effect is on distinct memories, so I state it as a cost. ## Changes - `recency_weight()` replaces the two inline copies in `memory/recall.py`. `RECENCY_DECAY_DAYS <= 0` keeps the old behaviour (old rate from day zero). - `compute_experience_weight`: abandoned 1.0 (effort still never amplifies it). - **Migration needed and included:** recall reads the *stored* `experience_weight`, so changing the formula alone would leave every existing dead end at 0.1. `migrate_abandoned_weight` runs at startup, idempotent, does not touch `updated_at` (the skill compiler reads that as "source changed"). - `record_experience`: auto-suppression removed, `auto_suppressed` key gone from the result. Suppressions made by earlier versions stay (a set cannot tell them from manual ones): CHANGELOG tells the operator to review with `list_suppressions()`. - Two existing tests encoded the old behaviour and were updated: `test_abandoned_weight_ignores_effort` (0.1 -> 1.0) and `test_no_ranking_effect` (two identical memories written milliseconds apart no longer tie exactly because recency counts from day zero; the test now pins `created_at`, the provenance assertion is unchanged). - Docs: new `docs/recall-scoring.md`; `memory-episodic.md`, `configuration.md`, `features.md`, `CLAUDE.md` updated. Version 6.10.0 (minor: behaviour change) + CHANGELOG. ## Checks `ruff check`, `ruff format --check`, ASCII check, bandit on the changed files (no findings, no suppressions added), `pytest`: 2086 passed, 1 skipped (was 2071). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The embedding bench measures speed and vector equivalence and the
LongMemEval harness ingests everything "now" with no outcomes, so
neither can see a change to how age or an abandoned outcome weighs into
the ranking. Add a seeded benchmark with controlled ages and recorded
outcomes (age_spread, stale_fresh, dead_end) that runs the real pipeline
against a real valkey-search, plus a paired multi-seed compare, because
HNSW search is approximate and a single run carries noise.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adopted from the Rust upstream (7.0.3) after measuring it with the new
recall scoring benchmark (three paired seeds, real valkey-search and
model):
- recency falls from 1.0 at birth to 0.9 at RECENCY_DECAY_DAYS, then at
  the old rate; newer-of-two-statements ranks first 48% -> 88%
- abandoned weight 0.1 -> 1.0; the dead end goes from missing in the top
  10 in 97% of cases to the top 3 in 99%
- record_experience no longer auto-suppresses abandoned approach names
- migrate_abandoned_weight resets the stored weight on existing memories,
  since recall reads the stored field

Costs, also measured: exact-source MRR -0.024, working approach above its
dead end 100% -> 96%. See docs/recall-scoring.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
release 6.10.0: recall scoring change
All checks were successful
Lint / Ruff (pull_request) Successful in 10s
Lint / ASCII only (pull_request) Successful in 2s
Security Scans / Bandit, dependency audit, secret scan (pull_request) Successful in 1m37s
Security Scans / Test Coverage (pull_request) Successful in 1m23s
cf64bc7c62
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
test: cover malformed and missing weights in migrate_abandoned_weight
All checks were successful
Lint / Ruff (pull_request) Successful in 9s
Lint / ASCII only (pull_request) Successful in 2s
Security Scans / Bandit, dependency audit, secret scan (pull_request) Successful in 1m34s
Security Scans / Test Coverage (pull_request) Successful in 1m20s
263f28e438
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tim merged commit 5d321d56ec into develop 2026-11-02 20:16:33 +00:00
tim deleted branch feat/recall-scoring-23 2026-11-02 20:16:33 +00:00
Sign in to join this conversation.
No reviewers
No labels
upstream-feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
tim/omnimem!28
No description provided.