After a multi-agent workflow completes, a developer wants to understand why Agent B produced unexpected output. The workflow system logs all agent inputs, outputs, tool calls, and timestamps. Which analysis approach is most effective for diagnosing the root cause?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Diagnosing an agent is like reading a black-box flight recorder — you start with what the agent received (its inputs and context), then follow each decision step-by-step through its tool calls and intermediate results until you find where the flight path went off course. Tracing inputs → tool calls → outputs in sequence is the most direct path to root cause.
Full explanation below image
Full Explanation
Post-hoc analysis of multi-agent behavior is essentially log-driven debugging. When one agent produces unexpected output, the diagnostic process follows a specific sequence through the available logs.
Step 1 — Verify inputs: Check what context Agent B actually received. Was it given the correct outputs from Agent A? Were any required fields missing or malformed? Incorrect inputs from an upstream agent are the most common cause of unexpected downstream behavior.
Step 2 — Trace tool calls: Review the sequence of tools Agent B invoked, the arguments it passed, and the responses it received. A tool returning unexpected data (e.g., a search tool returning stale results) may have caused the agent to take a wrong turn.
Step 3 — Examine intermediate outputs: If Agent B produced intermediate artifacts before its final output, compare them against expected behavior at each step to pinpoint exactly where divergence occurred.
Why B is correct: This is the canonical post-hoc analysis approach: start at inputs, trace execution path, identify divergence point. It uses the data the logging system was designed to capture.
Why A is wrong: Re-running the workflow may not reproduce the original behavior if any inputs, tool responses, or model outputs are non-deterministic. Even if it does reproduce, it only confirms the problem exists — it doesn't explain why it happened.
Why C is wrong: Starting with Agent C's output is starting at the wrong end of the causal chain. Agent C may have masked, corrected, or compounded Agent B's error, making it harder to isolate the original cause.
Why D is wrong: Reviewing the Git diff shows what Agent B changed but not why. The diff is the output artifact, not the execution trace. Without understanding the inputs and tool calls that produced the diff, you cannot determine root cause from the diff alone.