Sub topic 1
How an Agent Turns a Request into a Response
Prerequisites
This chapter assumes that you know basic Salesforce concepts such as objects, fields, and records. You should also know that a large language model generates responses from user input and available instructions.
How an Agent Turns a Request into a Response
An Agentforce agent uses several parts of its configuration to handle a request:
- It reads the user's message and identifies the user's goal.
- It selects a topic whose classification matches that goal.
- It follows that topic's instructions.
- It gathers any missing information.
- It calls an action when it needs to read data, change data, or perform another operation.
- It uses the result to form a response.
For example, a customer asks, “Where is order 10045?” The agent should select an order-status topic, obtain the order number, call a status action, and report the result.
Finding Your Way Around Agentforce Builder
Agentforce Builder is the workspace where you configure and test an agent. The exact labels can vary by Salesforce release, but the main areas have related purposes:
| Builder area | Purpose |
|---|---|
| Topics | Group related customer goals |
| Instructions | Define how the agent should handle a topic |
| Actions | Let the agent perform approved operations |
| Preview or test panel | Try requests and inspect responses |
Use the preview panel after each meaningful change. A response can reveal whether the agent selected the wrong topic, missed an instruction, or used an action incorrectly.
> callout note > Treat the preview conversation as a test case. Record the user message, expected topic, expected action, and expected response. > ```
What a Topic Is and Why Agents Need Them
A topic is a defined area of work for an agent. It combines a classification description, a scope, instructions, and often one or more actions. Topics help separate different jobs, such as checking an order from requesting a refund.
A topic should have a narrow responsibility. If two topics cover the same requests, the agent may choose inconsistently. If one topic covers unrelated jobs, its instructions become difficult to follow and test.
Naming a Topic and Writing Its Classification Description
Give the topic a short name that states the user's goal, such as Order Status. Its classification description should explain which requests belong to the topic and which do not.
For example:
- Name: Order Status
- Description: Handle questions about the status or location of an existing order. Do not use for returns, refunds, or new orders.
Use concrete boundaries. “Help customers with orders” is too broad because it does not distinguish status questions from cancellations or refunds.
Exercise
A user asks, “Can I return order 10045?” Should the Order Status topic handle this request?
Show answer
No. The classification description excludes returns, so the request should go to a returns topic.