Skip to main content

Module confidence

Module confidence 

Source
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§

EdgeEvidence
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.
ProvenanceWeights
Evidence weight of one observation, by provenance class.

Enums§

ExtractionContext
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_reinforced or valid_from as anchor.
path_confidence
Compound confidence along a multi-hop path.
temporal_decay
Compute effective confidence after temporal decay.