Memory Worth
A memory recalled 100 times but never leading to a good outcome is noise. A memory recalled three times but consistently leading to wins is gold. Frequency ≠ utility.
Memory Worth is a per-row signal that converges to the true utility of a memory over time. It’s how Mnemosyne decides what to promote, what to demote, what to merge, and what to forget.
The two counters
Every memorable row carries:
worth_success NUMERIC DEFAULT 0, -- recalled AND outcome was good
worth_failure NUMERIC DEFAULT 0, -- recalled AND outcome was badThe counters are fractional (NUMERIC), not integers — credit
propagation writes partial weights. The stored worth column is the
raw ratio success / (success + failure), defaulting to 0.5 before any
observations.
worth = worth_success / (worth_success + worth_failure) -- default 0.5A Wilson score interval lower bound is computed app-side when ranking needs a confidence-adjusted score — it handles cold-start so a memory with 1 success and 0 failures isn’t promoted above one with 10 successes and 1 failure just because the raw ratio is 1.0:
wilson ≈ (p̂ + z²/2n − z√(p̂(1−p̂)/n + z²/4n²)) / (1 + z²/n)(p̂ = success ratio, n = total observations, z = 1.96)
Decision rule
worth > 0.7 AND confidence > 0.5 → promote (boost activation, candidate to pin)
worth < 0.3 AND confidence > 0.5 → demote (lower activation, archive candidate)
confidence < 0.3 → insufficient data, neutral treatmentAfter ~10 observations the signal converges toward ground-truth utility.
How worth updates
Three sources, weighted by signal confidence:
| Source | Confidence | Trigger |
|---|---|---|
| Explicit | 0.95 | User thumbs-up/down. Agent calls session.collapse({ outcome: "resolved" }) |
| Task completion | 0.80 | Linked task moves to completed with non-empty outcome |
| Heuristic | 0.40 | Session end shape (“thanks!”, repeat questions, long without resolution, …) |
The heuristic always fires (zero cost). Explicit signals move worth in five observations; heuristic-only takes twenty-five. That’s deliberate — you need high-quality evidence to move scores fast.
Credit propagation (TD-λ)
When a memory’s outcome is recorded, the credit propagates backwards through the provenance DAG — facts that fed decisions that fed strategies that succeeded all get partial credit, decaying by λ at each hop:
Strategy succeeded → +1.0 direct
Decision that fed it → +0.7 (λ = 0.7)
Fact that derived the decision → +0.49 (λ²)This uses the existing mnemo_relation edges (derived_from, part_of).
You don’t need to track provenance separately — it’s already in the graph.
What worth feeds
- Hot tier eligibility — only worth ≥ 0.5 items get promoted to the Redis activation set.
- Consolidation gate — high-worth memories are exempt from merging (they’re useful as-is, don’t summarise them away). See Consolidation gate.
- Recall ranking — final score blends cosine × recency × worth.
- Self-edit safety —
strengthen/weakenactions cap at a few per day to prevent gaming.
Shipped in v3-alpha (Beta). The worth column and its fractional
counters ship now; the recall pipeline also exposes hit_count and
memory_strength as a Hebbian-ish proxy. Interfaces may still change before
3.0 stable.