Sub topic 4
Naming a Topic and Writing Its Classification Description
This chapter assumes you know basic Salesforce concepts (objects, fields, records), can navigate Setup, and have a general idea of what a large language model (LLM) does. You do not need to write code here. You will write short pieces of text, and those pieces control whether an agent picks the right topic.
Why the name and description matter
An Agentforce agent does not read all of its topics in full before it answers. It first has to decide which topic fits the customer's request. For that decision it relies on two fields from each topic: the name and the classification description.
The classification description is the text the agent's reasoning engine uses to match a request to a topic. If it is vague, the agent picks the wrong topic or no topic. A wrong topic means the agent then follows the wrong instructions and offers the wrong actions. Errors made here carry through everything that follows.
The topic's instructions and actions do not take part in this first choice. Only after a topic is selected does the agent read its instructions. This is why the two fields deserve careful writing even though they are short.
Naming a topic
A topic name is a short label. Salesforce also uses it as a reference in places such as the Builder canvas and test traces, so people read it as well as the agent.
Good names follow a few habits:
- Name the job, not the department. "Order Status" describes a task. "Customer Service" describes a whole area and overlaps with everything.
- Use plain words a customer might use. The agent compares the request with your text, so shared vocabulary helps.
- Keep it short. Two to four words is usually enough.
- Make each name different from its neighbors. "Order Status" and "Order Help" are too close. "Order Status" and "Returns" are not.
| Weak name | Problem | Better name |
|---|---|---|
| General Help | Matches almost any request | Account Password Reset |
| Orders | Covers status, changes, and new orders | Order Status |
| Billing Stuff | Informal and unclear | Invoice Questions |
| Customer Issues | Overlaps every other topic | Product Defect Reports |
The name alone is not enough to route requests. Treat it as a label for people and a hint for the agent. The classification description does the real work.
Writing the classification description
The classification description tells the agent what kinds of requests belong to the topic. Think of it as a rule for sorting incoming requests into the right bin.
A useful description answers two questions:
- What requests should this topic handle?
- What similar requests should it leave alone?
The second question is the one people skip. Without it, a topic called "Order Status" may also grab "I want to return my order," because both mention an order.
Here is the example from the plan for this tutorial:
Topic name: Order Status
Classification description:
Handle customer questions about where an existing order is and what its current status is. Do not use for returns, refunds, or new orders.
Scope:
Your job is to look up the status of an existing order and report it. You cannot change or cancel orders.Look at how the classification description is built:
- It starts with a verb: "Handle".
- It names the customer's goal: "where an existing order is and what its current status is".
- It states a boundary: "Do not use for returns, refunds, or new orders."
The boundary sentence points at the neighboring topics. If you also have topics named "Returns" and "New Orders," the exclusions send those requests to them.
Guidelines for the description
- Write one to three sentences. A long description gives the agent more chances to match unrelated requests.
- Describe the customer's intent. Write what the customer wants, not how your system works. "Where is my package" is intent. "Queries the Order object" is implementation.
- Include the exclusions. Name the nearby topics' jobs so requests do not leak between topics.
- Avoid steps. Ordered steps belong in the instructions, which a later chapter covers.
- Avoid scope limits here. Statements about what the agent can and cannot do belong in the scope field, which the next chapter covers.
Classification description versus scope
These two fields look similar, so people mix them up. They do different jobs at different times.
| Field | Answers | Used when |
|---|---|---|
| Classification description | Does this request belong to this topic? | Choosing a topic |
| Scope | What is this topic's job and its limits? | After the topic is chosen |
In the example, "Do not use for returns, refunds, or new orders" is routing guidance, so it sits in the description. "You cannot change or cancel orders" describes what the agent may do once inside the topic, so it sits in scope.
A worked example: fixing an overlap
Suppose you have two topics with these descriptions.
Topic name: Orders
Classification description:
Help with orders.
Topic name: Returns
Classification description:
Help customers who want to send items back.A customer writes: "My order hasn't arrived and I want to send it back if it doesn't come this week."
This request contains both ideas. "Help with orders" matches almost anything that mentions an order, so the agent may choose "Orders" even though the main intent could be a return. The result depends on chance, not on design.
Rewrite both so each one claims a clear area:
Topic name: Order Status
Classification description:
Handle customer questions about where an existing order is and what its current status is. Do not use for returns, refunds, or new orders.
Topic name: Returns
Classification description:
Handle requests to return an item or get a refund for an order that has already been delivered. Do not use for questions about where an order is.Now the delivery question goes to "Order Status." The mention of a future return is a second intent. The agent handles the first question, and you can plan a handoff later. A request that is only about sending an item back goes to "Returns."
Notice that "already been delivered" in the Returns description draws a line at a business event. Lines like this are easier to apply than lines based on tone or wording.
Common errors
- Overlapping descriptions. Two topics both say "handle order questions." The agent cannot tell them apart. Fix by splitting along the customer's goal and adding exclusions.
- A catch-all topic. A topic such as "General Questions" attracts requests that belong elsewhere. Avoid it unless you need a deliberate fallback.
- Descriptions that describe actions. "Uses the Get Order Status action" tells the agent nothing about what customers say. Describe the request instead.
- Missing exclusions. The description says what to handle but never what to leave out.
- Jargon. Internal terms such as "RMA" or "fulfillment exception" do not appear in customer messages. Use the words customers use, and add internal terms only if customers also use them.
- Too many topics with narrow differences. Ten near-identical topics make selection harder. Merge topics that share one job and one set of instructions.
Checking your description
Before you save a topic, run these checks:
- Read the description aloud. Does it say what the customer wants, in the customer's words?
- Write three sample requests that should match. Does the description cover all three?
- Write three sample requests from neighboring topics. Does an exclusion keep them out?
- Compare it with every other topic's description. Could any request fit two of them?
You will use these same sample requests when you test in Agentforce Builder in a later chapter. Keep them in a list. A set of ten to twenty realistic requests, labeled with the topic each should reach, is a simple regression test that you can run again after each edit.
Exercise
A "Billing" topic has the classification description "Help with billing." A "Refunds" topic has the description "Help with refunds." A customer writes, "Why was I charged twice? I want my money back." The agent sometimes picks Billing and sometimes Refunds. Rewrite both classification descriptions so the routing is predictable, and state which topic should handle this request and why.
Show answer
Possible rewrite. Billing: "Handle questions about charges, invoices, and payment methods on an account, such as unexpected or duplicate charges. Do not use for requests to return a product or to be repaid for a returned item." Refunds: "Handle requests to get money back for a returned item or a cancelled order after the charge is already confirmed as correct. Do not use for questions about why a charge appeared." The request should go to Billing first, because the customer's main question is why they were charged twice. The refund is a second intent that follows once the duplicate charge is confirmed. Any answer is acceptable if each description states the customer's goal and has an exclusion that points at the other topic.
Exercise
Which of these sentences belongs in a classification description, and which belongs in the scope? (a) "Do not use for new orders." (b) "You cannot cancel orders."
Show answer
(a) belongs in the classification description, because it helps decide whether a request goes to this topic. (b) belongs in the scope, because it limits what the agent does after the topic is chosen.