Skip to main content

BrainState

BrainState is the app-facing output. Key fields: Use BrainState.to_dict() for JSON-friendly export (brain_state_version is currently 1).

Trial gate vs adapt recommendation

These are different signals: recommend_adapt is a thin mean-shift helper against a user-supplied tau (L0 stay vs L1 stream update only). It does not auto-escalate to affine maps or full fine-tune. Optional session metadata:
After Personalizer.load, pass X_ref= (calibration embeddings are not serialized).

Decision presets

Uncertainty fusion: BrainState.uncertainty is max(normalized_entropy, upstream) when upstream is set. Gating checks entropy and upstream thresholds independently. Optional mc_samples>=2 on Personalizer draws posterior samples and sets normalized epistemic uncertainty (BALD / log2 K) as Prediction.uncertainty. MAP intent and confidence still use closed-form predict_proba. Breakdown bits land in BrainState.extras (total_entropy_bits, aleatoric_bits, epistemic_bits).

Dual API & bridges

Upstream probabilities only (no head required):
See also Python Streaming Inference for the streaming bridge in context.

Next Read

Encoder contract

Evidence

Overview

Streaming