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.
Creating Salesforce Agent ¶
Users can customize a 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.
Onboarding Salesforce Agent¶
To use the Salesforce agents through our AI Refinery SDK, users need the following parameters:
| Variable | Description |
|---|---|
client_key |
Mapping to the name of the environment variable that holds your actual Salesforce client key. |
client_secret |
Mapping to the name of the environment variable that holds your actual Salesforce client secret. |
domain |
Your Salesforce organization domain URL, which is an identifier of your developer workspace where your Salesforce agents live. |
agent_id |
Unique identifier assigned to each agent within your Salesforce domain. |
contexts |
Allows for the provision of additional information during communication with the Salesforce 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 Creating Salesforce Agent).
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 Agentrunning on the Salesforce platform. - Salesforce-Side Processing: The
Salesforce Agentdecides 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 Agentreturns 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: SalesforceAgentunderutility_agents. - Ensure the
agent_nameyou chose for yourSalesforceAgentis listed in theagent_listunderorchestrator.
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"