Salesforce Agent¶
Salesforce Agent
is a third-party agent hosted on the Salesforce platform. These specialized cloud-hosted agents handle tasks such as routing incoming support cases, providing order details, extending databases, managing calendars, and intuitively responding to queries based on custom knowledge.
Our AI Refinery SDK allows seamless integration with a user's customized Salesforce Agent
using the SalesforceAgent
class. This integration brings the full power of the Salesforce Agent
to applications, enhancing performance and capabilities on our AI Refinery platform.
Workflow Overview¶
The workflow of the SalesforceAgent
class consists of four components:
- Initialization: An agent is created in the Salesforce AI agent platform named Agentforce and registered in AI Refinery with the specified configuration.
- Sending a Query: A user query is forwarded from AI Refinery to the
Salesforce Agent
running on the Salesforce platform. - Salesforce-Side Processing: The
Salesforce Agent
decides whether to use predefined tools, knowledge bases, or other resources and processes the query in the Salesforce platform. - Receiving and Parsing the Response: The
Salesforce Agent
returns the processed results to AI Refinery, where they are then parsed to extract the final answer.
Usage and Quickstart¶
To quickly set up an AI Refinery project with a SalesforceAgent
, the user should first create their own Salesforce Agent
in Agentforce. Once the agent is ready, use the YAML configuration template below to integrate it into the AI Refinery project.
Specifically, ensure the following configurations are included:
- Add a utility agent with
agent_class: SalesforceAgent
underutility_agents
. - Ensure the
agent_name
you chose for yourSalesforceAgent
is listed in theagent_list
underorchestrator
.
Salesforce Agent Setup ¶
Users can customize an Salesforce Agent
through the Agentforce platform. To create an agent, follow these steps:
- Sign Up for a developer's account on Agentforce.
- Log in to your new developer's account.
- Create Agents and obtain their identifiers following the steps shown in the tutorial video.
- Once created and set up, you can optionally ground your agents in your data by following the steps below:
- Enable Data Cloud
- Upload files to your Agentforce Data Library
After that, the library will handle the offline data preparation for you, including the content chunking, vectorization, and indexing. This process might take from several minutes to hours depending on the size of your knowledge base.
Template YAML Configuration of SalesforceAgent
¶
See the YAML template below for the SalesforceAgent
configuration.
orchestrator:
agent_list:
- agent_name: "KnowledgeAgent"
utility_agents:
- agent_class: SalesforceAgent
agent_name: "KnowledgeAgent"
agent_description: "The KnowledgeAgent can answer questions based on its knowledge library."
config:
client_key: "SALESFORCE_CLIENT_KEY" # Required Client Key
client_secret: "SALESFORCE_CLIENT_SECRET" # Required Client Secret
domain: "your-organization-domain-url.develop.my.salesforce.com" # Required Salesforce oraganization URL
agent_id: "YOUR_AGENT_IDENTIFIER" # Required agent ID
contexts: # Optional additional agent contexts
- "date"
- "chat_history"
In this template:
client_key
andclient_secret
are a mapping to the names of the environment variables that hold your actual Salesforce client key and client secret.domain
is your Salesforce organization domain URL and is an identifier of your developer workspace where your Salesforce agents live.agent_id
is a unique identifier assigned to each agent within your Salesforce domain.contexts
: allows for the provision of additional information during communication with theSalesforce Agent
.
For instructions on how to obtain the client key and secret, domain URl, and agent ID, please see the video tutorial in the link above (step 3 in Salesforce Agent Setup).