Documentation

tracellm replay

Replay a recorded execution timeline.

Overview

The tracellm replay command fetches a saved trace from MongoDB and re-executes its timeline step by step in the terminal. Each step is rendered with a tree visualization showing the execution order, status, input, and output.

Syntax

terminalCopy
bash
tracellm replay [OPTIONS] TRACE_ID
ArgumentTypeRequiredDescription
TRACE_IDstringYesThe trace ID to replay (e.g. tr_2kf9q3m1)
OptionTypeDefaultDescription
--speedfloat1.0Replay speed multiplier (min 0.1)
--show-responseflagfalsePrint the full saved response after replay

What Happens Internally

  1. Fetches the trace from MongoDB by ID via fetch_trace.
  2. Renders metadata — trace ID, status, latency, retry count, and step count in a replay header panel.
  3. Iterates steps using Rich Live display. For each step it renders an execution tree showing which steps are completed (✓), active (▶), and pending, alongside a detail panel with tool name, duration, status, input (clipped to 200 chars), and output (clipped to 200 chars).
  4. Throttles timing — waits duration / 1000 / speed seconds between steps, clamped between 80ms and 550ms.
  5. Prints final report — a summary table plus a response preview (up to 600 chars). If --show-response is set, the full response is printed.

Example Output

Terminal outputCopy
text
  Replaying execution timeline...

  ╭── Replay ────────────────────────────────────────────────╮
  │                                                          │
  │  trace_id   tr_2kf9q3m1                                  │
  │  status     SUCCESS                                      │
  │  latency    3420.00 ms                                   │
  │  retries    1                                            │
  │  steps      9                                            │
  │                                                          │
  ╰──────────────────────────────────────────────────────────╯

  ╭── Replaying step 3/9 ────────────────────────────────────╮
  │                                                          │
  │  ╭── Execution Timeline ─────────────────────────────╮   │
  │  │                                                    │   │
  │  │  ✓ query.embed                                     │   │
  │  │  ✓ vector.search                                   │   │
  │  │  ▶ context.rerank                                  │   │
  │  │  ○ agent.plan                                      │   │
  │  │  ○ context.allocate                                │   │
  │  │  ○ tool.chain                                      │   │
  │  │  ○ llm.generate                                    │   │
  │  │                                                    │   │
  │  ╰────────────────────────────────────────────────────╯   │
  │                                                          │
  │  ╭── Step Detail ────────────────────────────────────╮   │
  │  │                                                    │   │
  │  │  step       3/9                                    │   │
  │  │  tool       context.rerank                         │   │
  │  │  duration   340 ms                                 │   │
  │  │  status     OK                                     │   │
  │  │  input      {"query": "Explain transformers",...}  │   │
  │  │  output     {"reranked": true, "matches": 5}       │   │
  │  │                                                    │   │
  │  ╰────────────────────────────────────────────────────╯   │
  │                                                          │
  ╰──────────────────────────────────────────────────────────╯

  Replay complete

Common Errors

ErrorCauseFix
Trace not foundInvalid trace ID or trace was deletedVerify the trace ID with tracellm export or the dashboard
No steps to replayTrace exists but has no recorded stepsSome traces may be empty — check the trace in the dashboard
MongoDB connection failedDatabase is unreachableEnsure MongoDB is running and MONGO_URL is correct

Troubleshooting

Tip

Use --speed 2 to replay twice as fast for quick debugging, or --speed 0.5 to watch each step in slow motion.