mixle.substrate.belief module¶
Calibrated belief store: harvest claims from model output and assimilate them as CREDENCES.
A model’s output is a paragraph of assertions – some grounded, some not. This module turns each
assertion into a tracked belief with a probability (not a binary “fact” flag) that moves with the
STRENGTH of its evidence: a verifiable source (a document, an executable check, a held-out truth, a
real measurement) moves it strongly; the model’s own say-so moves it weakly and is capped low. Every
belief carries its full evidence_history so the current credence is always reproducible by
replaying it, and evidence can be revised or retract()-ed, cascading to whatever depended on it.
Anti-laundering is the load-bearing property: evidence that resolves back to the claim itself, or to another belief that has no independent (non-model-assertion) support of its own, contributes ZERO – a claim cannot bootstrap high credence by citing itself or an equally ungrounded peer.
This is the write side of the knowledge substrate: harvest, credence
assimilation, and traceable history. The retrieval side is
mixle.substrate.retrieve.
- class Claim(text, produced_by=<factory>, quantity=None)[source]
Bases:
objectOne atomic proposition (or typed quantity) pulled from a model’s output.
- class EvidenceEntry(source_id, tier, direction='+', weight=1.0, time=<factory>)[source]
Bases:
objectOne piece of evidence that moved a belief’s credence, in the order it was applied.
- class BeliefItem(id, claim, credence, evidence_history=<factory>, scope='local')[source]
Bases:
objectA claim’s current credence plus the full evidence trail that produced it.
- harvest_knowledge(model_output, *, source, extract=None)[source]
Split
model_outputinto atomic claims, each stamped withsource(which model produced it, its confidence, etc). Default extraction is sentence-level (mixle.reason.llm.sentence_claims()); passextractfor a different atomic-proposition splitter.
- credence_from_history(evidence_history)[source]
The credence implied by an evidence history alone – a pure function, so replaying a belief’s stored
evidence_historythrough this always reproduces its currentcredenceexactly.
- assimilate(sub, claim, evidence, *, scope='local')[source]
Bayesian-ish update of the belief in
claimfromevidence– never a binary write.Finds or creates the belief item (keyed on normalized claim text) and appends each evidence entry (
{"source_id", "tier", "direction": "+"/"-", "weight"});tiermust be one of_TIER_STRENGTH("model_assertion"plusmixle.doe.oracle.VERIFIABILITY_TIERS).Anti-laundering: an entry whose
source_idresolves back to THIS belief (a cycle) or to another belief item with no independent (non-model-assertion) support of its own is stored with an effective weight of zero – it cannot move the credence, though it stays in the trail for audit.
- retract(sub, source_id, *, scope=None)[source]
Remove every evidence entry citing
source_id, recomputing credence, and CASCADE: if that removal causes a belief to lose its only independent support, also strip citations of THAT belief from whatever cited it, recursively. Returns every belief item touched by the cascade.
- retrieve_beliefs(sub, query, *, k=8, min_credence=None, scope=None)[source]
Beliefs relevant to
query, optionally thresholded onmin_credenceand re-ranked byrelevance * credence– so a caller can weight by, or hard-filter on, how much the store actually believes each item (never a “fact” vs “non-fact” partition, only credence).