Memory Worth
A memory recalled a hundred times that never helped is noise. A memory recalled three times that helped each time is valuable. Worth is the number that tells them apart: an estimate, between 0 and 1, of how often a memory was useful when it was served.
The model
Each fact carries two counters and a generated column
(packages/core/src/cognitive/worth.ts):
worth_alpha NUMERIC DEFAULT 2.0, -- evidence that the fact helped
worth_beta NUMERIC DEFAULT 2.0, -- evidence that it did not
worth GENERATED AS (worth_alpha / (worth_alpha + worth_beta))This is a Beta-Bernoulli model. A new fact starts at Beta(2, 2), a worth of
0.5 with little confidence, and moves toward its real success rate only as
evidence arrives. The counters are fractional because credit can be partial.
worth_success and worth_failure also exist as legacy counters; they do not
drive worth.
Confidence is the Wilson lower bound of the same counters (z = 1.96). It is computed when a memory is served, not stored. It keeps one lucky success from ranking above ten successes and one failure.
The serving gate
Recall serves a fact with evidence only when its worth is above 0.5 and its
Wilson lower bound is at least 0.3 (passesWorthGate). A fact that has never
been rated, still at Beta(2, 2), is exempt: no evidence is not bad evidence.
Send includeLowWorth: true on POST /recall to turn the gate off. Kinds other
than facts are not gated.
How worth changes
| Source | How |
|---|---|
| Session collapse | The collapse rates the session and updates the facts it produced |
| Session feedback | POST /session/{id}/feedback with {"rating": "up"} or "down" updates every fact recalled in that session |
| Strategy rating | POST /strategies/{id}/rate with {"outcome": "success"} or "failure" |
| Reasoning feedback | POST /reasoning/feedback with {"reasoning_id": "...", "outcome": "success"} or "fail" |
| Self-edit | memory_self_edit with strengthen or weaken, limited per day |
Session feedback finds the recalled facts through the recall log, so the recall
calls must carry the session’s id in sessionId.
A collapse outcome maps to evidence like this (OUTCOME_WEIGHTS in
packages/core/src/cognitive/outcome.ts):
| Outcome | Success | Failure |
|---|---|---|
resolved | 1.0 | 0.0 |
partial | 0.7 | 0.3 |
abandoned | 0.3 | 0.7 |
failed | 0.0 | 1.0 |
delegated | 0.5 | 0.5 |
The outcome itself combines up to three signals, weighted by confidence
(computeOutcome in outcome-signal.ts): an explicit rating (confidence
0.95), the completion of linked tasks (0.6 to 0.8) and the shape of the session
(0.4), for example whether it ended with thanks or with a repeated question.
While a workspace is in learning mode, a collapse does not update worth.
Credit for earlier recalls
When an outcome is recorded, earlier recalls in the same session get partial
credit. The weight falls with each step back (λ, default 0.7) and with elapsed
time (a one-day constant). After a rated collapse, credit also walks the
provenance graph backward, at most five hops, decayed by λ at each hop
(propagateGovernanceForSession).
Decay
A daily job relaxes the evidence of unused memories back toward neutral, with a half-life of 58 days for facts, 90 days for reasoning chains and 173 days for strategies, workflows and skills.
Governance actions
A daily job (mnemo.governance.propagate, 02:00 UTC) classifies each active
fact (classifyGovernance in governance.ts) and acts:
| Class | Rule | Action |
|---|---|---|
canonical | worth above 0.8 and lower bound above 0.7 | Marked canonical (exempt from consolidation) and pinned |
promote | worth above 0.7 and lower bound above 0.5 | Pinned, and raised in the hot tier |
demote | Wilson upper bound below 0.3 | Lowered in the hot tier and queued once for review as an archive candidate |
neutral | anything else | Nothing |
The upper bound says how sure the system is that a fact is worth little. From the neutral starting point, a fact needs about 17 recalls without reinforcement before it demotes, and a single failure never demotes it. A fact that already waits for review as an archive candidate is not queued again.
# Worth, Wilson lower bound and class of each fact
curl "http://localhost:3939/governance/worth?action=demote" \
-H "Authorization: Bearer mns_live_..."
# Operator override: exempt a fact from consolidation, or release it
curl -X POST http://localhost:3939/governance/gate \
-H "Authorization: Bearer mns_live_..." \
-H "Content-Type: application/json" \
-d '{"factId": "FACT_ID", "gate": "canonical", "reason": "Reviewed by the fleet team"}'What worth feeds
- The serving gate, above.
- Recall ranking, as a prior. In the cold tier the score is multiplied by
1 + 0.1 × (worth − 0.5), that is, 0.95 to 1.05. Relevance decides the order; worth breaks near-ties. In the pointer tier the score iscosine × worth. - The consolidation gate. Only clusters whose members all have a worth below 0.5 can be merged, and canonical facts are never merged. See Consolidation gate.
- The self-model. Meta-cognition averages worth per entity.
POST /recall does not return worth on its hits. POST /recall/explain does,
with the Wilson lower bound.
Beta in docs/STATUS.md. Mnemosyne is alpha, on the 3.6.x line, and the API
can still change within 3.x.