Sub topic 11
Testing with Realistic Utterances and Refining Wording
This chapter assumes you can open Agentforce Builder, preview a conversation, and that your topic already has a classification description, a scope, and instructions. You will learn how to test the topic, read what the preview shows, and change one piece of wording at a time.
Why test with utterances
An utterance is a message a customer might type. Topic wording looks fine when you read it. The only way to learn whether the agent follows it is to send messages and watch what happens.
Two things can go wrong, and they need different fixes:
- Routing: the agent picks the wrong topic. Fix the classification description or scope.
- Behavior: the agent picks the right topic but ignores or misorders a step. Fix the instructions.
Find out which one failed before you edit anything.
Build a small test set
Write the test messages before you start editing. Cover four kinds of input.
| Kind | Example for an Order Status topic | What you check |
|---|---|---|
| Typical | "Where is my order 10482?" | Correct topic, action runs |
| Phrased differently | "Has my package shipped yet?" | Same topic without keyword matches |
| Missing detail | "Where's my stuff?" | Agent asks for the order number |
| Out of scope | "Cancel my order 10482." | Agent declines and offers a human |
Add a near-neighbor request that belongs to another topic, such as "My order arrived damaged." This shows whether two descriptions overlap. Use wording real customers use, including typos and short messages. Messages you invent in tidy language tend to pass too easily.
Run the conversation and read the result
In Agentforce Builder, send each utterance in the preview panel. For each one, check these points in order:
- Which topic was selected?
- Which action, if any, ran, and with what input?
- Did the reply follow the steps in your instructions, in that order?
- Did the agent avoid anything the scope excludes?
Record the result in a simple list: utterance, expected topic, actual topic, pass or fail. A written record lets you re-run the same messages after each edit.
The flow below shows the loop.
Refine one change at a time
When a test fails, make one edit, then re-run the whole set. If you change three things at once, you cannot tell which change helped. A single edit can also fix one utterance and break another, so the full re-run matters.
Typical fixes:
- Wrong topic chosen: make the classification description describe the customer's intent more precisely, and add what the topic excludes to the scope.
- Step skipped: number the steps and state the observable behavior.
- Action not called: name the action exactly and attach a condition to it.
- Agent guesses: add an explicit rule for the failure case.
Here is a vague instruction and a revision after a test showed the agent inventing a status:
Before:
Help the customer find their order.
After:
1. If the customer has not given an order number, ask for it.
2. Use the Get Order Status action with the order number before describing the status.
3. If the order cannot be found, say so and ask the customer to check the number. Do not guess a status.The revision turns a goal into steps you can check in the preview.
Know when wording is not enough
Language model output can vary between runs. Send an important utterance several times. If a rule holds most of the time but not always, and a failure is costly, such as a refund limit or an identity check, the instruction is the wrong tool. Move that rule into a Flow or Apex action so it runs the same way every time.
Exercise
Exercise
In preview, a customer writes "My package never showed up and I want my money back." The agent answers from the Order Status topic and tries to look up the order. Which part of the topic should you edit first, and what should you do after the edit?
Show answer
This is a routing failure, because the wrong topic was selected. Edit the classification description and scope, starting with the Order Status topic. Make its description focus on looking up status and delivery dates, and state in the scope that it does not handle refunds. Check that the return or refund topic describes this intent distinctly. Then re-run the whole test set, not only this utterance, to confirm nothing else broke.