Back to notes
ObservabilityGuide5 min

Trace agent workflows for debugging

A guide to making multi-step AI behavior inspectable enough to fix when something goes wrong.

Open source doc
Real example

Example: debug why a proposal was marked low fit

A proposal manager disputes an AI recommendation. The output says low fit, but the team believes the tender is relevant.

Open the workflow trace: source document, extraction output, tool calls, qualification criteria, model response id, validation result, and reviewer notes. The trace shows the model missed one certificate from an appendix.

The fix is clear: improve document parsing for appendices. Without the trace, the team might have rewritten the prompt blindly.

Tutorial path

How to implement it

Step 01
Create a workflow run ID before the first model request.
Step 02
Attach every response, tool call, validation result, and approval decision to that run.
Step 03
Store safe summaries and IDs instead of full sensitive payloads where possible.
Step 04
Render an internal timeline for failed or disputed AI actions.
Step 05
Use traces to choose whether to change prompts, tools, data, or UX.
Checklist

Ready when these are true

Workflow run ID
Tool calls attached
Validation results stored
Sensitive data minimized
Debug timeline available
Field notes

What matters in practice

01
Debugging needs the request, tool calls, intermediate outputs, and final user-visible result.
02
Logs should explain behavior without exposing secrets or unnecessary personal data.
03
A trace is useful when a support or engineering person can replay the decision path.
Avoid these mistakes

Common failure modes

01
Do not log sensitive raw data everywhere just to debug.
02
Do not keep only the final answer.
03
Do not merge multiple workflow runs under one vague log entry.
Practical tip
A good trace helps you decide whether the bug is prompt, data, tool, model, or UI.
Apply this to a build
Contact
Bring the workflow, deadline, and constraints.
Send the desired outcome, current bottleneck, users, and timeline. I will respond with a practical path for the build.