Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
An agent trace is a structured per-step log of every LLM call, tool call, timing, token, and cost in one task run, captured by tools like Langfuse, LangSmith, or Arize Phoenix.
Imagine your agent is a detective solving a case across a whole city in one afternoon. It interviews witnesses, checks records, drives to addresses, makes phone calls. At the end of the day the case is either solved or not. If it failed, you want to know exactly where it went wrong. Was it the second interview? The wrong address on the fourth stop? Tracing is a body camera plus a notebook strapped to the detective. Every conversation, every street it walked, every call it made, every minute that passed, is recorded as a separate timestamped entry. When the case fails, you can scrub back to step seventeen and see what the detective heard, what it said, and what it decided to do next.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Define a trace as a tree of spans for one task. Spell out the per-span payload for LLM and tool calls. Explain why tree shape beats flat logs in a recursive agent. Name two or three production tracing tools and what they integrate with. Close on tracing as the load-bearing primitive that makes a non-deterministic loop debuggable.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating tracing as a logging concern. A trace is structured: each step is a typed span with its parent, its inputs, its outputs, and its timing. Plain print statements lose the tree shape and the per-step inputs.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.