Sub topic 7
Reading the reasoning trace
This chapter assumes you can build a simple agent in Agentforce Builder and know what topics, actions, and instructions are. It also assumes you can open a single conversation in review. The goal is to read the reasoning trace and find why the agent gave a poor response.
What the trace shows
A reasoning trace is the record of the steps an agent took to produce one reply. Each step shows what the agent considered and what it chose. Read it from top to bottom, because each step depends on the one before it.
A typical turn follows this order:
- The agent receives the customer's utterance.
- It picks a topic that matches the request.
- It picks an action within that topic, or decides to answer directly.
- It runs the action and gets the output.
- It writes a reply from the instructions, the action output, and any grounding data.
The exact labels in your org may differ. Treat the order as the working model, not as a fixed schema.
Read in order, stop at the first wrong step
Errors carry forward. A wrong topic leads to the wrong actions, and the reply can still sound fluent. So check each step in order and stop at the first one that is wrong. That step is your best lead on the cause.
| Step | Question to ask | What a problem looks like |
|---|---|---|
| Topic selection | Did the agent choose the topic a person would choose? | A returns request lands in the order topic |
| Action selection | Was the action in scope and the right one? | No action was called, or a similar one was used |
| Action input | Were the inputs correct and complete? | An empty or guessed order number |
| Action output | Did the action return usable data? | An error, or no record found |
| Final reply | Does the reply match the output and instructions? | A claim the output does not support |
Worked example
A customer writes: "I want to send back the shoes I bought last week." The agent replies with a delivery date.
Reading the trace in order:
- Topic selection chose Order Status. A person would choose Returns. This is the first wrong step.
- Action selection then called the order lookup action. That is correct for the topic that was chosen, so the action is not the fault.
- The reply was accurate for the data it had. It answered the wrong question.
The cause is upstream of the action. The topic description was too broad, with text such as "Handle questions about orders." A request about sending items back also concerns an order, so it matched.
Common reading errors
- Blaming the final reply. The reply is the last step, so it is the most visible. The cause is often earlier.
- Judging from one conversation. One trace shows one case. Check whether other sessions fail at the same step before you change anything.
- Ignoring action output. A fluent reply can sit on top of an error or empty result. Read the output, not only the reply.
- Assuming the trace is complete. It records what the agent did. It does not always show why one option beat another, so form a hypothesis and test it.
Write down the first wrong step and a one-line guess at the cause. The next chapter uses these notes to sort failures into categories.
Exercise
In a trace, the agent chose the correct topic, called the correct action, but the action returned "no record found." The reply then gave a confident delivery date. Which step is the first wrong one, and what does the trace suggest about the cause?
Show answer
The first wrong step is the final reply. Topic and action selection were correct, and the action output showed no record. The reply made a claim the output did not support. The likely cause is missing instruction for the no-result case, such as telling the agent to say no order was found and offer a human agent.