Core Concepts
DecisionSnapshot
A DecisionSnapshot is the immutable record of a single AI decision. It contains:
- Input — the data sent to the model
- Output — the model’s response
- ModelParameters — temperature, top_p, model name, etc.
- ExecutionContext — timestamps, latency, caller metadata
from briefcase import capture, DecisionSnapshotfrom briefcase.storage import SQLiteBackend
backend = SQLiteBackend("./decisions.db")snapshot: DecisionSnapshot = backend.load("snapshot-id")print(snapshot.input)print(snapshot.output)print(snapshot.model_parameters.model_name)print(snapshot.execution_context.latency_ms)Decision Flow
graph LR
A["Function Call"] --> B["@capture decorator"]
B --> C["DecisionSnapshot created"]
C --> D["Storage Backend"]
D --> E["Query / Replay / Audit"]
- Your function is called
- The
@capturedecorator intercepts the call - A
DecisionSnapshotis created with all inputs, outputs, and metadata - The snapshot is persisted to your configured storage backend
- Snapshots can be queried, replayed, or audited later
Input and Output
Input and Output are typed wrappers that serialize any Python object into a reproducible format.
ModelParameters
Captures the model configuration at call time: model name, temperature, top_p, max_tokens, and any provider-specific settings.
ExecutionContext
Records when the decision was made, how long it took, which environment it ran in, and the correlation ID for multi-agent workflows.