Capsule captures every LLM call, tool use, and state change your AI agent makes — and packages it into a portable .capsule file you can replay, branch, and share.
Decompose user request into ordered subtasks.
Capsule turns a non-deterministic black box into something you can rewind, inspect, and reproduce on demand.
One decorator wraps your agent. Every LLM call, tool use, and memory write is recorded — zero code changes.
@capsule.trace
def agent(input):
...Re-run any failure deterministically from stored cassettes — no live API calls, bit-exact output.
$ capsule-trace replay \
sess_8f2aFork at any step. Swap a prompt, model, or tool response and run the alternative live.
$ capsule-trace branch \
--from-step 5Export a portable .capsule file and attach it to any bug report. Reproducible anywhere.
$ capsule-trace export \
--out bug.capsuleA single compressed archive holding every event, cassette, and snapshot. No external metadata, no database required.
SHA-256 integrity hashes guarantee the capsule replays bit-exact — the same on any machine, any Python version.
The format is fully specified and open-source. Attach a .capsule to a bug report the way you attach a screenshot today.
One pip install. Every LLM call, tool execution, and state mutation recorded automatically.
Scrub through any session with millisecond precision. Pause and inspect the exact world state.
Fork any session at any step. Swap a model or prompt, run the branch, compare outputs side-by-side.
Automatic root-cause tagging for LLM timeouts, tool errors, context overflows, and schema mismatches.
Per-session and per-step token costs by model, project, and time range. Know where budget goes.
LangChain, LlamaIndex, AutoGen, raw OpenAI/Anthropic, or custom. If it calls an LLM, Capsule captures it.
A complete CLI ships with the SDK. Capture, list, replay, branch, diff, and export — all scriptable with --json output.
# replay a failed production session $ capsule-trace replay sess_8f2a91c4 ✓ 23 steps · hash match · 0.31s # branch at the failing step $ capsule-trace branch sess_8f2a91c4 --from-step 5 ↳ branch fix-schema created # export a portable bug report $ capsule-trace export sess_8f2a91c4 --out bug.capsule ✓ wrote bug.capsule (2.4 MB)
Every capsule is a signed, immutable record — built for regulated teams in fintech, insurance, and legal AI.
Article 12 logging — signed, exportable audit trails.
Type II controls underway across security and availability.
Configurable PII redaction at capture time.
Air-gapped Docker / VPC deployment, your keys.
Capture your next production failure as a replayable .capsule — and rewind your way to the root cause.