Confidence scoring (SNUG-126)

Explainable confidence on retrieval hits and evidence-backed responses. Implemented in brain/src/hippo_brain/confidence_scoring.py.

Output shape

Each hit carries a confidence object:

FieldMeaning
levelhigh, medium, low, or insufficient
scoreBounded composite in [0, 1] from named factors
factorsWeighted factor breakdown (name, weight, score, contribution, detail)
explanationAgent-readable one-liner summarizing top factors
withheldtrue when level is insufficient

Factors

FactorWeightInputs
evidence0.30Inspectable evidence packet count
source_diversity0.15Distinct source_kind families
recency0.15Hit captured_at age
retrieval_match0.20Hybrid/semantic/lexical retrieval score
capture_health0.15Inline evidence[].freshness.status
context_alignment0.05cwd / git_branch present

Limitations — when confidence is withheld or capped

Surfaces