Building an Agentforce agent is iterative. Define the agent purpose, map topics, configure actions, ground with data, test against realistic conversations, and refine the topic and action descriptions until the agent picks the right path consistently. The work is more like prompt engineering than traditional Salesforce configuration; expect significant iteration time.
- Define the agent purpose and audience
What is the agent for, who will use it, what kinds of conversations should it handle, what is out of scope. A clear scope helps you decide topic boundaries and avoid agents that try to do everything badly.
- Open Agent Studio and create the agent
Setup > Agent Studio > New Agent. Provide a name, description, and instructions. Pick the agent type (Service, Sales, Custom). Save and proceed to topic definition.
- Define topics with clear descriptions
For each major job the agent does, create a topic. Write a description that explains when this topic applies. The reasoning engine uses topic descriptions to route user input, so be specific about scope.
- Add actions to each topic
For each topic, add the actions the agent can invoke: Apex methods, Flows, Prompt Templates, API calls, sub-agents. Configure input parameters and write description text that explains when to invoke the action.
- Ground the agent with Salesforce data
Configure grounding rules so the agent reads relevant data before responding. Common patterns: ground on the current record (the user is viewing an Opportunity), ground on related records, ground on Knowledge articles, ground on Data Cloud objects.
- Test the agent in the Conversation Playground
Agent Studio includes a playground for testing. Type realistic user inputs, observe which topic the engine picks, which actions fire, and how the response reads. Iterate on topic descriptions until routing matches expectation.
- Configure the channels the agent surfaces in
Embed the agent in Slack, Experience Cloud, Salesforce Mobile, or other channels. Each channel has its own configuration but they share the agent definition.
- Monitor usage, accuracy, and credit consumption
Agent Studio > Usage shows interaction counts, credit consumption, and conversation logs. Review failed or low-quality conversations and refine the agent definition. Plan for ongoing tuning; agents are not "deploy and forget" artifacts.
Categorical mental model of agent jobs. Topic descriptions drive the reasoning engine''s routing decisions.
What the agent can do. Each action has a description that guides when the engine invokes it.
Salesforce records, Knowledge, Data Cloud objects, and other data the agent reads before responding to keep answers accurate.
- Agent quality depends heavily on topic and action descriptions. Vague descriptions produce inconsistent routing; clear descriptions produce reliable behavior. Plan multiple iteration cycles on the descriptions.
- Ungrounded responses hallucinate. The LLM confidently states facts that are not in your data unless you ground the conversation. Always configure grounding for any agent answering data-specific questions.
- Einstein Credits consume per interaction. High-volume agent deployments produce significant credit consumption. Monitor usage and set budget alerts to avoid surprise overage charges.
- Agents can take action autonomously. Audit Trail logs everything, but unintended actions are harder to roll back than human-driven mistakes. Constrain agent action scope carefully during initial deployment.
- Salesforce''s AI features evolve rapidly. Agentforce is a fast-moving platform with frequent capability changes. Plan for iteration; documented best practices today may be outdated in 6 months.