Sub topic 2
What Agentforce records about a conversation
This chapter assumes you have built a simple agent in Agentforce Builder and know what topics, actions, and instructions are. You should also know that an LLM prompt is grounded with data. Here you learn how a conversation is stored, so you know what evidence exists when you review it later.
Three levels of data
Agentforce organizes a conversation into three levels.
- Session: One continuous conversation between a user and an agent. It has a start, an end, and metadata such as which agent handled it.
- Interaction (turn): One user request and the agent's response to it. A session holds many of these.
- Step: One piece of work the agent did inside a turn. Examples are choosing a topic, running an action, or generating a reply.
Messages are the text the user and agent exchanged. They are tied to the turn they belong to.
Why steps matter
Messages show what the agent said. Steps show why. A step can record which topic the agent picked, which action it ran, what went into that action, and what came back. When a reply is wrong, the transcript alone usually cannot tell you whether the cause was the wrong topic, the wrong action, or bad data. The steps can.
Where the data lives
You can read individual conversations in the Agentforce tools in Setup and Builder. For analysis across many sessions, Agentforce can write session data to Data 360, where it is stored as records for sessions, interactions, steps, and messages. Dashboards and your own queries read from there. Object names and the setup needed to turn on this capture differ by release, so check the current documentation for your org before you rely on a specific name.
Because of this, "what was recorded" depends on your configuration. If session data is not enabled, you will have less to analyze, and you cannot recover turns that were never captured.
What to do with it
For now, treat each field as a column you can count or group. Resolution rate, escalation rate, and escalations per topic all come from grouping session records. The snippet below uses invented field names, not an Agentforce schema.
from collections import Counter
# Hypothetical export of reviewed sessions. Field names are illustrative,
# not an Agentforce schema.
sessions = [
{"id": "s1", "topic": "Order Status", "resolved": True, "escalated": False},
{"id": "s2", "topic": "Returns", "resolved": False, "escalated": True},
{"id": "s3", "topic": "Returns", "resolved": False, "escalated": True},
{"id": "s4", "topic": "Order Status", "resolved": True, "escalated": False},
]
total = len(sessions)
resolution_rate = sum(s["resolved"] for s in sessions) / total
escalation_rate = sum(s["escalated"] for s in sessions) / total
escalations_by_topic = Counter(s["topic"] for s in sessions if s["escalated"])
print(f"Resolution rate: {resolution_rate:.0%}")
print(f"Escalation rate: {escalation_rate:.0%}")
print("Escalations by topic:", escalations_by_topic.most_common())The output is a 50% resolution rate, a 50% escalation rate, and [('Returns', 2)]. Both escalations come from Returns, so that topic is the first one to review.
Common errors
- Reading only the transcript. You miss the steps that explain the choice of topic or action.
- Assuming everything is captured. Check that capture is enabled and covers the agent you are studying.
- Mixing levels. A session count and a turn count are different. Say which one a metric uses.
Exercise
A customer asked about a return, and the agent replied with a delivery date. Which level of recorded data would you check first to learn why, and what would you look for?
Show answer
Check the steps of that turn. Look at which topic was selected and which action ran. If the Order Status topic was chosen for a returns request, the cause is topic selection, not the reply text.