What Happened Inside the Workflow?
In Lesson 7.1, we evaluated whether our research system met its execution, quality, and governance requirements.
But when an evaluation fails, how do we find out what went wrong?
Consider a research workflow that ends without producing a finding. Was the Evidence Agent never called? Did its tool fail? Did the application reject incomplete results?
To investigate, we need to examine what happened during execution.
Understanding Traces
A trace is a record of events that occurred during a system’s execution. It helps us reconstruct the sequence of operations and identify where problems arose.
For our multi-agent research system, useful events include:
- Agent delegation: The Coordinator selects a specialist.
- Tool execution: A tool succeeds or returns an error.
- State changes: The application records or updates information.
- Validation: The application accepts or rejects the recorded state.
- Approval and persistence: A reviewer approves a finding, or a save operation occurs.
Traces can also record timing, identifiers, and error details, helping us understand execution paths and investigate performance problems.
Importantly, a trace shows observable events, not the model’s private reasoning. It records what the system exposes through instrumentation.
Reading an Execution Trace
Labs 6.4 and 6.5 printed numbered traces of the same kinds of events. Consider this simplified trace from our research workflow:
01 Coordinator delegate Evidence specialist selected
02 Evidence tool error Simulated timeout
03 Application state_update Evidence error recorded
04 Application validation_fail No usable evidence assessment
05 Application stop Workflow stopped without save
The trace shows that the Evidence specialist was selected, its tool failed, and the application stopped after rejecting incomplete evidence.
The tool failed, but the application appears to have handled the failure correctly.
Now consider a different trace:
01 Application validation_pass Required records present
02 Application synthesis Qualified summary created
03 MCP save tool save_success Save acknowledged
The trace records persistence without an earlier approval event.
This should be flagged for investigation. However, the missing event does not prove that approval never occurred. The approval might not have been captured by the logging system.
This illustrates an important limitation: traces are only as complete and reliable as the events being recorded.
Observability and Evaluation
Observability and evaluation serve different purposes.
| Observability | Evaluation |
|---|---|
| What happened during execution? | Did the system meet expectations? |
| Records events, errors, and state changes | Applies criteria and checks |
| Helps diagnose behavior | Identifies acceptable and unacceptable outcomes |
For example, a trace might show that an evidence tool timed out and the application stopped. Evaluation determines whether stopping was the expected behavior under those conditions.
Both are necessary for understanding agent reliability.
Hands-On Lab: Experiment 7.2
We’ll examine three synthetic execution traces from our multi-agent research workflow.
Run:
python3 lab7_2_execution_traces.py
The script prints numbered events for three scenarios:
- A completed workflow with recorded approval.
- An evidence tool failure followed by a safe stop.
- A save operation without recorded approval.
Observe: Why is Case 2 considered correct failure handling, while Case 3 raises a governance concern?
Try it: Find the synthetic trace for Case 3 and add an approval event before the save. Rerun the script and observe whether the warning changes.
What Traces Cannot Tell Us
Even a complete execution trace cannot establish whether a research conclusion is factually correct.
A successful tool call tells us that an operation completed, not that its result was trustworthy.
To evaluate the quality of research findings, we need to examine the evidence and the conclusions drawn from it.
That is the focus of Lesson 7.3.
Test Your Understanding
Question 1 of 3
What information can an execution trace reveal about a multi-agent workflow?