Agentforce is transforming the Salesforce ecosystem, helping teams activate and implement their digital workforce. With a suite of out-of-the-box sales agents, customer service agents, commerce agents, and personal shopper agents, teams can use AI to complete repetitive tasks, troubleshoot customer queries and even support the sales team with real-time call coaching.
But what’s the process of building an agent, and then how do you make sure it’s ready to go for your end users? In this post, we’ll run through the steps you need to build an agent in Salesforce and then show you how to easily deploy your agent, and its dependencies, using Gearset.
What is Agentforce?
Agentforce is an AI-powered suite of virtual agents that have been built to make life easier for all teams using and building on Salesforce. These agents find the right information faster, automate responses to common questions, and improve the overall customer experience by preempting customer pains and queries.
By pulling in relevant structured and unstructured data from multiple data sources, including other platforms you integrate with, agents make sure that users (and customers) get the most accurate answer without a team member having to dig through the information manually. This not only helps manage internal processes more effectively but also streamlines workflows across teams.
TDX 2025
Meet with our product team at TDX 2025
Who can benefit from using Agentforce?
Agentforce can help with a range of customer interactions and internal business tasks. It’s especially useful for:
- Customer service teams to speed up response times and reduce repetitive work by efficiently handling customer inquiries.
- Support teams to provide instant access to troubleshooting guides and case histories.
- Sales teams to help surface relevant customer insights during live sales calls.
- Operations teams to automate workflows and reduce manual data entry.
- Development teams to automate repetitive tasks and free up developers to focus on solving other challenges and delivering high-quality solutions to their end-users faster.
Key components of an Agent
Every Agentforce agent comes with built-in parameters that define its job and available actions.
- Topic: An agent’s purpose. This defines the job to be done and the broader goals the agent should achieve on your team.
- Knowledge: The data an agent needs to be successful. This could include company knowledge articles, CRM data, external data via Data Cloud, public websites, and so on.
- Actions: The goals an agent can fulfill. This is the predefined task an agent can execute to do its job based on a trigger or instruction. For example, it could run a Flow, prompt template, or Apex. These actions can be configured using the Agent Builder tool to ensure the agent performs its tasks accurately.
- Guardrails: The guidelines an agent can operate under. These can be natural-language instructions telling the agent what it can and can’t do, when to escalate to a human, or could come from built-in security features in the Einstein Trust Layer.
- Channels: The applications where an agent gets work done. This can be your website, CRM, mobile app, Slack, etc.
Where does Agentforce pull data from?
Agentforce connects to different parts of your Salesforce setup, and third-party integrations, to deliver helpful, real-time responses. Here’s where it gets its information:
- Salesforce Knowledge Base: Gives the agent access to company information and FAQs stored in Salesforce, making it easier to provide detailed, accurate answers to customer questions. (e.g. What is your HQ address?)
- CRM Records: Pulls in customer account details like order history, contact information, and open cases so the agent can provide personalized responses. (e.g. Can I reorder the same product as previously?)
- Data Cloud (optional): If you’re using Salesforce Data Cloud, Agentforce can use real-time customer insights — like recent interactions or purchases — to make its responses even more relevant. (e.g. What address do you have on file for me?)
- Custom Integrations: Need data from another system? You can connect Agentforce to external tools using APIs or pre-built connectors to pull in whatever extra info your agents need. Plus, you can incorporate custom AI models to enhance functionality and provide more intelligent responses. (e.g. When is my parcel expected?)
What are the Agentforce metadata types?
Agentforce is built on a structured metadata framework that enables the agents to function. Salesforce introduced Agentforce (GenAi) metadata types in the Winter ’25 release — these metadata types are supported by version 60 or higher of the Metadata API. These metadata types define how agents reason, retrieve data, and interact with users:
- GenAi Planner (Agent): Defines an AI agent’s reasoning strategy, breaking tasks into subtasks and determining the best actions to execute.
- GenAi Plugin (Topic): Topics are the related actions and instructions that guide the agents on their own specific subjects or job function.
- GenAi Function (Agent Action): Specifies individual actions AI agents can perform, including data retrieval, record updates, and external service calls.
- GenAi Prompt Template (Prompt Template): Structures AI-generated prompts to ensure consistency and relevance in agent responses.

How to enable Agentforce in your orgs
Setting up Agentforce in your Salesforce org is pretty simple. There are just a couple of settings we need to make sure are on before we start building our agents.
Enable Agentforce in Setup
- From Setup search for Generative AI and select Einstein Setup.
- Click the Turn on Einstein toggle.
- Return to Setup and refresh the page — you may need to refresh a few times before Agent Studio appears.
- Click Agents under Agents Studio and toggle on Agentforce.
Option to activate custom AI models: Navigate to the Model Builder section and register your custom AI models to enhance the intelligence of your agents. This allows you to incorporate large language models and custom configurations, tailoring your solutions to specific needs.
How to build an agent using Agent Builder in Salesforce
Before you start, it’s important to build your Agent in a sandbox first, test it, and then deploy it to your production org. There are many different settings available to finetune your agents, but the high level steps are similar for any agent creation.
Let’s build a Service Agent using Agent Builder — the agent will be responsible for troubleshooting a range of queries.
Select the type of agent
From Setup navigate to Agents. Click New Agent and then choose the type of agent you want to create. In the below example, Service Agent has been selected.


Add agent topics
Consider what you want the agent to handle and identify the main topics or categories of questions it will answer (e.g., Case Management, Delivery Issues, FAQs). Click Next.
You can also use the Prompt Builder to create tailored prompts that guide the agent’s responses to specific topics. The Atlas Reasoning Engine then evaluates the available actions based on the prompt and determines the next best step.

Define agent settings
Configure the basic settings of your agent including a name, description, the role of the agent, and some basic company details. These settings allow you to deploy AI agents tailored to your specific needs.

Select your data
Connect your agent to relevant data sources. Ensure all data sources are securely connected and apply filters to retrieve only relevant information for specific queries.

Test your agent
In AgentBuilder, go to the Preview Window. Start a conversation by typing sample customer questions to see how the Agent responds. Test various scenarios to ensure your agent provides accurate answers. When you’re testing is complete, click Activate.

The new agent will have a user profile associated with it, but it will need additional permissions added to ensure it can access the data it needs while keeping sensitive information secure. You can do this by going back to your org and using the Quick Find box to search Users and then selecting your agent.
Once you’re finished building your agent, it’s time to deploy it from your sandbox to your production environment.
How to deploy an agent using Gearset
Deploying Agents doesn’t need to be difficult — Gearset makes the process easy. Log in, or sign up to your 30-day free trial to follow along with this Service Agent deployment.
Select your source and target
Select your source and target and click Compare now. You can select the default Agentforce comparison filter or select your metadata on demand.

Compare your environments
Gearset will analyze the differences between your source and target org, highlighting all new, changed and deleted metadata items you’ve chosen in your filter. If you want to add any more types to the filter, you can choose them in the left-hand panel.

Build your Agentforce deployment package
Simply select the changes you want to include in your deployment and click Next. In this example, the package includes the:
- Agent (
GenAi planner
) - Action (
GenAi function
) - Topic (
GenAi plugin
) - Einstein bot
- Bot version
You can also include any prompt templates in your deployment. Then click Next.

Check your package
Gearset runs problem analysis on every deployment package to look for issues that are likely to cause a deployment failure. You can accept recommended fixes to your package in one click, such as adding missing dependencies.
On the deployment summary page you can give the package a friendly name for easy identification, include any deployment notes, and add the relevant user stories.

Deploy your agent
Validate your deployment, schedule it for later, or deploy it immediately — whichever fits your workflow. If you’re ready, hit Deploy now to complete your Agentforce deployment.

Troubleshooting common deployment gotchas
There are a couple of things to remember when deploying Agentforce metadata types:
- API version. You must make sure to use at least version 60 of the Metadata API for the comparison. Read the prerequisite section of the How to deploy GenAi metadata guide to find out how to do this.
- Bots and bot versions. The Einstein bot and bot version associated with your agent must exist in the target org otherwise the agent will not be visible. If the GenAiPlanner is new then the associated Einstein bot and Bot version will also need to be deployed to the target org. If not, the deployed GenAiPlanner will not be visible on the target org.
Monitoring and optimizing the performance of your agents
Keeping your Agentforce agents running smoothly is key to delivering a great customer experience. Here’s how to monitor and optimize their performance:
- Track key metrics. Keep an eye on response accuracy, customer satisfaction, and conversation completion rates. These insights help you understand how well your agents are performing and where they can improve.
- Analyze conversation data. Dig into conversation logs to spot trends and identify areas for improvement. Fine-tuning responses based on real interactions helps your agents better meet customer needs.
- Adjust configurations as needed. Optimize your agents by refining their knowledge base, actions, and guardrails. Small tweaks can make a big difference in their effectiveness.
- Continuously test and refine. Regular testing ensures your agents stay aligned with business goals and deliver a seamless experience. Catching and fixing issues early keeps performance on track and minimises cost to the business.
- Leverage Agentforce analytics. Use built-in analytics to gain deeper insights into agent performance and customer behavior enabling you to make data-driven decisions about how to optimize your agents.
By following these steps, you can keep your Agentforce agents performing at their best — delivering accurate, helpful, and efficient customer interactions.
Effortlessly deploy Agentforce metadata with Gearset
Building your agent is just the first step — by using DevOps processes to deploy your Agentforce metadata you’re able to deliver agents quickly without compromising security. With Gearset, you can confidently move your Agentforce agents from sandbox to production in just a few clicks, delivering value to users and customers rapidly and safely. Want to give it a try? Sign up for a free 30-day trial now.