Get Started with Agents

Bring the power of conversational AI to your business with agents. Build a trusted and customizable AI assistant that empowers your users to get more done in Salesforce.

Communicate with AI agents using the Agent API. Build custom actions for agents from Apex code. Also, some Agentforce functionality is available through our Metadata API and Tooling API.

Use the Agent API to communicate with AI agents directly from an API. Start sessions, send messages to the AI agent, receive messages, and end sessions with the API.

You can also access an invocable action to chat with an agent. See Calling an Agent from a Flow or Apex Class in Salesforce Help.

With Agent Builder, developers can enhance agent capabilities by creating custom actions using Apex, flows, or prompt templates. This unique extensibility empowers developers to tailor agents to their business needs. To use your Apex code in a custom action, you must annotate your method with @InvocableMethod. This annotation makes the action available for configuration in Agent Builder. The following sample code shows an Apex class that uses this annotation.

To learn how to turn an invocable Apex method into a custom agent action, check out these resources.

Manage actions and customize the planner service using the Metadata API.

  • GenAiFunction: Represents an action that can be added to agents.
  • GenAiPlanner: Represents a planner that uses a large language model (LLM) and a reasoning strategy to decompose a given task into smaller subtasks, identify the most suitable actions for each subtask, and invoke them.

Manage actions and customize the planner service using the Tooling API.

  • GenAiFunctionDefinition: Represents an action that can be added to agents.
  • GenAiPlannerDefinition: Represents a planner that uses an LLM and a reasoning strategy to decompose a given task into smaller subtasks, identify the most suitable actions for each subtask, and invoke them.