Sub topic 1
What an Agentforce Agent Is
Prerequisites
This chapter assumes you know basic Salesforce concepts such as objects, records, and Setup. It also assumes you have a high-level familiarity with Flow or Apex and a general idea of what a large language model (LLM) does. You do not need to have built an agent before.
The short definition
An Agentforce agent is a Salesforce AI agent. It reads a user's request in natural language, decides what the user is asking for, and carries the request out by running actions you have configured. It differs from a fixed chatbot script because an LLM-based reasoning engine makes those decisions at run time, not a hard-coded decision tree.
You do not program the agent's every step. You define its areas of responsibility and the tools it may use. The agent decides, for each request, which of them applies.
The parts of an agent
An agent is built from a small set of parts. Later chapters cover each one in detail, so this section only names them and shows how they fit.
- Reasoning engine. The component that uses an LLM to interpret the request, choose what to do, and write the reply.
- Topics. Areas of responsibility, such as order support or appointment booking. A topic groups the work the agent can do for one kind of request.
- Instructions. Natural-language rules inside a topic that tell the agent how to behave and where its scope ends.
- Actions. The things the agent can actually do, such as looking up a record. An action can be backed by a Flow, an Apex invocable method, a prompt template, or another supported type.
The key relationship is that topics contain instructions and actions. The agent never sees a flat list of every action you own. It first narrows the request to a topic, then chooses among the actions in that topic.
A topic written out
A topic is described by a classification description, a scope, instructions, and a list of actions. The agent uses these to decide whether the topic fits a request and what to do inside it. Here is one written in plain text.
Topic: Order Support
Classification description: Handles customer questions about the status of an existing order, such as where it is or when it will arrive.
Scope: Look up order status and explain it. Does not process returns, refunds, or changes to an order.
Instructions:
- Ask for the order number if the customer has not given one.
- Use the order status action to look up the order before answering.
- If the order cannot be found, say so and do not guess.
Actions: Get Order StatusThe classification description helps the agent decide that a message belongs here. The scope says what is out of bounds. The instructions shape behavior, and the action list is the only set of tools available inside this topic.
What happens on one request
At a high level, a request moves through these steps:
- The user sends a message through a channel.
- The reasoning engine matches the message to a topic.
- Inside that topic, it reads the instructions and the action descriptions.
- It selects and runs an action, or asks the user for missing input.
- It uses the result to write a response.
The agent may repeat steps 3 to 5 before it answers. Chapter details on this loop come later in the tutorial.
Common mistakes
- Treating the agent as a script. The LLM interprets text, so vague or overlapping descriptions lead to unpredictable choices.
- Putting everything in one topic. A broad topic gives the agent too many actions to choose from, which makes wrong choices more likely.
- Assuming the agent knows your data. It only reaches Salesforce data through the actions and grounding you provide.
Exercise
In what order does an agent narrow down its choices, and why does it not pick from all your actions at once?
Show answer
It first matches the request to a topic, then chooses among the actions in that topic. Limiting the choice to one topic's actions reduces the number of options, so the agent is less likely to pick an unrelated action.
Exercise
Name the four parts of an agent introduced in this chapter and give one sentence on what each does.
Show answer
The reasoning engine uses an LLM to interpret requests and decide what to do. Topics group an area of responsibility. Instructions tell the agent how to behave and where its scope ends. Actions are the tasks the agent can run, backed by Flow, Apex, prompt templates, or other types.