Skip to main content

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

ComponentMaxSource
Confidence60effective_confidence × 60 (after weakest-link bounding)
Usage25Laplace-smoothed success_rate × 25 from record_outcome()
Access15min(access_count, 10) × 1.5

Plus penalties applied to the sum:

  • Conflict: −10 per recorded conflict
  • Hedged: −5 if hedged=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.

Where MQS shows up

  • UI Console — the homepage screenshot shows MQS rendered as a bar chart per record.
  • Eval span attributes — every search() span carries the top-result MQS so you can chart trust over time in Phoenix.
  • MAI rubric — MQS is one of several inputs into MAI scoring. See MAI.