Skip to content

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, DecisionSnapshot
from 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"]
  1. Your function is called
  2. The @capture decorator intercepts the call
  3. A DecisionSnapshot is created with all inputs, outputs, and metadata
  4. The snapshot is persisted to your configured storage backend
  5. 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.