Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Agent Topic entry
How-to guide

How to build an Agent Topic the reasoning engine actually picks correctly

Building a topic is two-thirds writing the classification description, one-third wiring actions. Start with three to five sample user messages you want the topic to handle and three to five sample messages it should reject. Write the classification description against those samples, then validate in the Conversation Preview before adding actions.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 18, 2026

Building a topic is two-thirds writing the classification description, one-third wiring actions. Start with three to five sample user messages you want the topic to handle and three to five sample messages it should reject. Write the classification description against those samples, then validate in the Conversation Preview before adding actions.

  1. Collect sample user messages

    Write three to five messages this topic should handle and three to five messages it should reject. Pull from real chat logs or support tickets if you have them. Make sure the rejected messages are close in phrasing to accepted ones, not obviously different.

  2. Open Agent Builder and create the topic

    Setup, Agent Builder, pick the agent, Topics panel, New Topic. Give the topic a name agents and admins recognize without context, like "Returns and Refunds" rather than "RR-2026-v3".

  3. Write the classification description with positives and negatives

    Name the user phrases the topic should match. Then call out two or three phrases it should reject and where those belong. Negative cases bind hard, so they matter as much as positives.

  4. Write the topic instruction for response style

    Set tone, length, confirmation requirements, and escalation rules. Keep this short. A two-sentence instruction is usually plenty; verbosity here makes the agent verbose.

  5. Attach the three to seven actions this topic needs

    Click Add Action and pick from the Agent Action library or build new actions inline. Keep the list short. Twenty actions on one topic is a signal the topic needs to be split.

  6. Test in Conversation Preview and read the Plan Trace

    Send each sample message. The Plan Trace shows which topic the engine picked. Iterate on the classification description until accepted messages map to this topic and rejected ones map elsewhere or to no topic.

  7. Save the test set to Agentforce Testing Center

    Capture the sample messages and expected topic classifications. Testing Center runs the set on every change and flags regressions before they reach users.

Topic nameremember

The label that appears in Agent Builder and in the Plan Trace. Use a phrase admins and supervisors will recognize without explanation.

Classification descriptionremember

Natural-language description the reasoning engine uses to decide if this topic applies to the current message. The single most important field on the record.

Topic instructionremember

Response-style guidance that runs after the topic is picked. Tone, length, confirmations, escalations.

Attached actionsremember

The set of Agent Actions the engine can invoke while this topic is active. Typically three to seven actions.

Active flagremember

Toggles the topic on or off without deleting it. Useful for staged rollout and emergency rollback.

Gotchas
  • A weak classification description is the single most common cause of wrong topic routing. Vague descriptions match almost anything and trigger the wrong actions.
  • Topic edits go live the moment you save. There is no draft mode at the topic level. Clone the agent to a draft for safe editing.
  • State does not carry across topics automatically. If Topic B needs values from Topic A, write an action that reads conversation history or use session variables.
  • Two topics with overlapping classification descriptions confuse the engine. Run a confusion check by sending the same message and seeing which topic wins; revise descriptions until each message has one clear home.
  • Removing an action from a topic does not delete the action itself. The action stays in the Agent Action library. This is by design so other topics or agents can still use it.

See the full Agent Topic entry

Agent Topic includes the definition, worked example, deep dive, related terms, and a quiz.