Sub topic 2
How the agent chooses a topic for a request
This chapter explains how an Agentforce agent picks a topic for each customer message. It assumes you know what an agent, a topic, and an action are, and that you can open Agentforce Builder and preview a conversation. Once you know what the agent reads when it routes a request, you can write topic fields that route correctly.
What the agent compares
When a customer sends a message, the agent has to decide which topic handles it. It does this by reasoning over the text of the conversation and the topic fields you wrote. It is not matching keywords, and it does not run a fixed rule.
For each candidate topic, the agent sees the topic name and the classification description. The classification description is the field that says what kinds of requests the topic matches. Instructions and scope matter after a topic is selected, so they are not the main input to this first decision. Treat the name and the classification description as the routing signal.
The agent compares the meaning of the customer's request against those descriptions and picks the best fit. A request does not need to repeat the words in your description. "Has my package left yet?" can match a topic described as handling "whether an existing order has shipped."
The routing flow
The selection happens before any instruction runs. The sequence looks like this.
The "No" branch is where most routing problems come from. If two descriptions both fit, or none fits, the agent still has to choose, and it may choose badly or fall back to a general response.
What influences the choice
Several things affect which topic wins.
- Description wording. Specific descriptions that name the customer's intent separate topics best.
- Topic names. A name like "Order Status" supports its description. A name like "General Help" competes with everything.
- Conversation context. The agent considers earlier turns. If the customer was just discussing an order, a short follow-up like "and when will it arrive?" usually stays with the same topic.
- The other topics. A description is judged against its neighbors. A description that is acceptable alone can fail once a similar topic exists.
The last point is why topic design is a set-level task. You are not writing one description. You are writing a group of descriptions that must be easy to tell apart.
A worked example
Suppose an agent has these two topics.
Topic A name: Order Status
Topic A description: Answers questions about orders.
Topic B name: Order Problems
Topic B description: Helps customers with order problems.A customer writes: "My order never showed up."
Both topics could fit. "Never showed up" is a question about an order, and it is also a problem. The agent has no strong reason to prefer one, so the result can vary between test runs. That is the signal that the descriptions overlap.
Now rewrite them around different customer intents.
Topic A name: Order Status
Topic A description: Looks up the status and delivery date of an existing order.
Topic B name: Damaged or Incorrect Orders
Topic B description: Starts a return or refund for an order the customer says arrived damaged or incorrect."My order never showed up" now fits Topic A, because the customer wants to know where the order is. "The mug I got is cracked" fits Topic B, because the order arrived damaged. Each request has one clear home.
Common errors
These are the routing mistakes you will see most often.
- Overlapping descriptions. Two topics describe the same intent in different words, so requests split between them unpredictably.
- Vague descriptions. "Handles customer questions" matches nearly everything and gives the agent nothing to separate topics by.
- Putting routing rules in instructions. Instructions run after the topic is chosen. Text like "use this topic when the customer mentions refunds" belongs in the classification description.
- Testing only the obvious phrasing. A description may route "Where is my order?" correctly and still fail on "Did my stuff ship yet?"
Checking the routing yourself
In Agentforce Builder, preview a conversation and send a request. Look at which topic the agent selected, and compare that against the topic you expected. Try the same intent phrased three different ways, then try a request that belongs to no topic. If the agent picks the wrong topic, adjust the descriptions to separate the intents, then test again.
Exercise
A customer writes "Has my package left the warehouse yet?" Your agent has a topic described as "Looks up the status and delivery date of an existing order" and another described as "Starts a return or refund for an order the customer says arrived damaged or incorrect." Which topic should be selected, and which field is the agent mainly using to decide?
Show answer
The order status topic should be selected, because the customer wants to know whether an existing order has shipped. The agent mainly uses the topic name and classification description, comparing their meaning to the request. The wording does not need to match exactly.
Exercise
Two topics have the descriptions "Answers questions about orders" and "Helps customers with order problems." Test conversations route the same message to different topics on different runs. Describe how you would fix this.
Show answer
The descriptions overlap, so both fit the same requests. Rewrite each around a distinct customer intent, for example "Looks up the status and delivery date of an existing order" and "Starts a return or refund for an order the customer says arrived damaged or incorrect." Then retest with several phrasings of each intent.