retrace

// record

Record every run with one decorator

Wrap your agent once and Retrace captures the entire execution (every model call, tool call, decision, and error) as a structured timeline you can scrub, search, replay, and share.

Start freeRead the docs →

One decorator

Add @retrace.record in Python or wrap a function with trace() in TypeScript. Your agent code stays exactly the same, there's no manual span plumbing to write.

Automatic capture

Calls to the major model providers are instrumented for you: prompts, responses, token usage, latency, and cost all land on the timeline with no extra code.

Spans & timeline

Every model call, tool call, and error becomes a typed span on an interactive timeline you can play back, pause, and scrub step by step.

Resilient by design

An offline buffer queues events and flushes them on reconnect, with automatic transport fallback. Typed errors surface problems without ever crashing your agent.

Privacy built in

Sensitive values like emails, phone numbers, keys, and tokens are redacted before anything is stored, on every plan.

Sampling & replay-ready

A sample rate keeps high-volume agents affordable while keeping full fidelity on the runs you record. Mark a run resumable to unlock fork & replay later.

agent.py
import retrace

retrace.configure(api_key="rt_...")

@retrace.record(name="support-agent", resumable=True)
def run_agent(prompt: str) -> str:
    return agent.invoke(prompt)

run_agent("Where is my order?")

Python, one decorator records the whole run.

agent.ts
import { configure, trace } from "retrace-sdk";

configure({ apiKey: "rt_..." });

const runAgent = trace(
  async (prompt: string) => agent.invoke(prompt),
  { name: "support-agent", resumable: true },
);

TypeScript, wrap any async function with trace().

REST API

  • POST /api/v1/traces: ingest a trace
  • GET /api/v1/traces/:id: fetch a run and its spans
  • GET /api/v1/traces: list and filter runs

More of the platform

// fork & replayFork & ReplayFork the failed step and re-run, debug the cause, not the symptom// prove the fixProve the FixRe-run a fix and get a verdict before you ship// eval gatesEval GatesFail the build when agent behavior regresses// guardrailsGuardrailsHalt a run when it blows a budget, loops, or stalls// enforcementEnforcementBlock a bad action before it runs, not diagnose it after// failure taxonomyFailure TaxonomyAuto-classify failures so you fix patterns, not one-offs// sessionsSessionsTrace multi-agent hand-offs so failures aren't a black box