Expand description
Bayesian confidence model for relationship edges.
Uses a Beta-Binomial conjugate prior. The pseudo-counts (alpha, beta)
are persisted on the edge, so evidence accumulates: the posterior after
fifty corroborations is a different distribution from the posterior after
five, and its variance is smaller. The stored confidence field is the
posterior mean — a derived value kept in sync with the counts on every
write, so read paths can keep scoring on the mean alone.
A new edge (or an edge from a store predating evidence persistence) starts
at PRIOR_CONCENTRATION: the mean is preserved and the concentration is
honestly low.
Structs§
- Edge
Evidence - Everything one edge persists about why it is believed: the Beta counts that move confidence, and the coherence counter that must not.
- Evidence
- The accumulated evidence for one relationship: the pseudo-counts of its Beta posterior.
- Provenance
Weights - Evidence weight of one observation, by provenance class.
Enums§
- Extraction
Context - How a relationship was established — determines initial confidence prior.
- Provenance
- The authorship class of an episode, and of every confidence-moving observation drawn from it.
Constants§
- DECAY_
FLOOR - Minimum effective confidence floor — decay never goes below this.
- DEFAULT_
EVIDENCE_ WEIGHT - Evidence weight of a single observation whose provenance is not modelled: one observation, one count.
- DEFAULT_
HALF_ LIFE_ DAYS - Default half-life for temporal decay (days). At 90 days without reinforcement, effective confidence halves.
- DEFAULT_
WEIGHT_ EXTERNAL - Default evidence weight of an observation from an independent source.
- DEFAULT_
WEIGHT_ SELF - Default evidence weight of the agent restating itself.
- DEFAULT_
WEIGHT_ USER - Default evidence weight of an observation authored by the human.
- PRIOR_
CONCENTRATION - Total pseudo-count of the Beta prior an edge starts from. ~10 observations to overwhelm the prior.
Functions§
- effective_
confidence - Compute effective confidence for a relationship, using
last_reinforcedorvalid_fromas anchor. - path_
confidence - Compound confidence along a multi-hop path.
- temporal_
decay - Compute effective confidence after temporal decay.