Skip to content

Quickstart

Install

Install
pip install briefcase-ai

The base package is enough for live observability. Persistence and replay use a separate path — see Persist & Replay when you need that.

Record a decision

@capture wraps a function and records inputs, outputs, and timing. observe() wires where those records go. Use "memory" to collect them in a list, "console" to print them, or a .jsonl path to append to a file.

  1. Wire an exporter and decorate a function

    Because @capture exports in a background thread by default, pass async_capture=False when you want to read the record immediately after the call.

    import briefcase
    mem = briefcase.observe("memory")
    @briefcase.capture(decision_type="ticket-classification", async_capture=False)
    def classify_ticket(text: str) -> str:
    # call your model here
    return "billing"
    classify_ticket("My invoice is wrong")
    print(mem.records[0])
  2. Read the record

    {
    "decision_id": "a6863737-deaa-4491-aaa7-fa4702926529",
    "decision_type": "ticket-classification",
    "function_name": "classify_ticket",
    "inputs": {"args": "('My invoice is wrong',)"},
    "outputs": {"result": "'billing'"},
    "started_at": "2026-08-13T23:15:56.468795+00:00",
    "ended_at": "2026-08-13T23:15:56.468926+00:00",
    "execution_time_ms": 0.002
    }

    Every exporter receives this shape. Arguments and return values are stored as their repr, so a record stays JSON-serializable whatever your function returns. This is the live-observability path: lightweight logging, not a reloadable snapshot.

What’s next

You watched a decision as it happened. Continue with persistence when you need to reload, replay, or audit after the process ends.