Memory Quality Score (MQS)
The Memory Quality Score is a composite 0–100 score memledger computes per record. It is explainable by construction — every score decomposes into a fixed formula you can trace.
The components
| Component | Max | Source |
|---|---|---|
| Confidence | 60 | effective_confidence × 60 (after weakest-link bounding) |
| Usage | 25 | Laplace-smoothed success_rate × 25 from record_outcome() |
| Access | 15 | min(access_count, 10) × 1.5 |
Plus penalties applied to the sum:
- Conflict:
−10per recorded conflict - Hedged:
−5ifhedged=True
The result is clamped to [0, 100].
Why this shape?
- Confidence dominates — a memory's trust starts with its declared confidence and the weakest link in its chain. That's 60% of the headroom.
- Usage rewards what works — Laplace smoothing means a single success doesn't pin you at 100%, and a single failure doesn't tank you to 0%.
- Access caps quickly — diminishing returns past 10 retrievals; we don't want a popular-but-stale record to coast on usage alone.
- Conflicts and hedging are subtractive — they're costs, not weights. A heavily-conflicting record can score below zero before the clamp.
Reading the score
record = await ml.get(memory_id)
print(record.quality_score) # 0..100
The composite score is exposed on every MemoryRecord. The per-component decomposition is not exposed at the API level today — only the composite. See compute_mqs() in source for the full formula; future versions will surface a structured breakdown.
Calibration
The constants above are calibrated against the 30-record hand-labeled dataset shipped with memledger[eval] (evaluators/calibration/dataset.jsonl). Lane-1 changes to the formula re-run that calibration as a unit test.