Multi-Surface Example: Ground an Agent with an Agentforce Data Library
This Page
All Documentation
In this example, you develop an agent, ground it with an Agentforce data library, test, and activate it. This multi-surface example shows you how to complete the steps using Headless or the Salesforce UI by choosing the tab for your preferred method.
Use your preferred AI assistant, such as Claude Code or Agentforce Vibes.
In your terminal, run sf org list. If you see the headless org alias in the list, you’re successfully authenticated.
This example also requires:
Data 360
Step 2: Build an Agent
Copy and paste this prompt into your AI assistant:
1Create a Q&A agent called "QnA".
Your AI assistant creates the agent. We’re not ready to publish and activate it yet.
Step 3: Download Sample Files for an Agentforce Data Library
Agentforce Data Libraries (ADL) enhance the accuracy of AI features, such as Agentforce agents, by connecting them to your trusted data sources. Data libraries use unstructured or semi-structured data. They convert large sets of information from the web, documents, or text fields into useful, searchable information.
Download these files to your filesystem so that you can use them to ground the agent. The files contain information about a fictitious DiamondVision TV from Acme Corp.
Create a file-based data libary Agentforce data library.
Copy and paste this prompt into your AI assistant:
1Create an Agentforce data library. Add the order-tracking.txt, product-troubleshooting.txt, and technical-support.txt files to the data library.
Your AI assistant creates the data library with the three sample files.
Step 5: Ground the Agent with the Data Library
Wire the new Agentforce data library into the QnA agent.
Copy and paste this prompt into your AI assistant:
1Ground the QnA agent with the new Agentforce data library.
Your AI assistant connects the data library to the agent to improve the accuracy of agent responses.
Step 6: Test the Agent
Copy and paste this prompt into your AI assistant:
1Test the agent with realistic customer scenarios and interactions.
Your AI assistant generates a test plan and executes the tests. If any tests fail, review the root causes returned by your AI assistant and ask it to apply the recommended fixes.
Complete these steps by opening Salesforce org in your browser.
From the App Launcher, enter Agent, and then select Agentforce Studio.
On the Agents tab, click New Agent.
Select an Agentforce Service agent template. Under Agent Details, select or create an Agent’s User Record for this agent. See Configure Service Agent Access for details.
Enter QnA as the agent’s name and then click Let’s Go.
Step 3: Download Sample Files for an Agentforce Data Library
Agentforce Data Libraries (ADL) enhance the accuracy of AI features, such as Agentforce agents, by connecting them to your trusted data sources. Data libraries use unstructured or semi-structured data. They convert large sets of information from the web, documents, or text fields into useful, searchable information.
Download these files to your filesystem so that you can use them to ground the agent. The files contain information about a fictitious DiamondVision TV from Acme Corp.
To start a preview conversation, in the chat window, enter a typical user question or request. See the example interaction below.
To review the agent’s behavior and reasoning, start with the Interaction Summary in the Summary tab. The Interaction Summary shows you a high-level overview of the steps your agent took to generate a response, including the result of each. Hover over each step for more details.
To get AI assistance, click Ask Agentforce in the Interaction Summary panel. We send the integrated Agentforce assistant information about the preview session so you can ask it questions.
If the test reveals errors or gaps, ask the assistant to make updates, or make changes yourself in the Canvas view. If your agent version is committed, make a new version first and modify it.
To test changes, refresh the session by clicking the reset icon on the Preview panel. Continue testing, modifying, and retesting until you’re satisfied with the agent’s behavior.
Example Test Interaction
User Input
Agent Response
The DiamondVision Voice Remote isn’t responding to voice commands. What’s wrong?
Make sure the remote is paired (hold Home + Back for 5 seconds until the blue LED flashes). Voice commands require an active internet connection, so verify the TV is online. Check that the microphone permission is enabled under Settings > Voice Assistant > Permissions, and replace the AAA batteries if the remote’s LED is dim or unresponsive.
Where can I find the serial number and model number on my Acme Corp product?
The serial number and model number are typically printed on a label affixed to the back or bottom of the product. You can also find this information in your original packaging, on your purchase receipt, or within the Acme Corp companion app under Device Details if the product is registered.