How to configure Agentforce to search your Salesforce Knowledge base.
Brian Shea
Salesforce Architect, Independent Consultant // 17x Certified // Dreamforce, TDX Speaker
***UPDATE January 17, 2025***: After I posted my original article last week, I received lots of great comments from folks who've been working on similar agents. The biggest piece of feedback that I received was "I built an agent that queries unstructured data (text, rich text, PDF) just like your agent, but I took a slightly different approach". Here are the approaches that folks shared:
Approach 1: Standard Action using Knowledge
My original article (below) explains the configuration steps for this approach.
Approach 2: Standard Action using File Upload
Approach 3: Custom Action using Prompt Builder + Knowledge
Note: S3 Integration: I also received a question asking if I had tried building a Prompt Template grounded in PDF files brought into Data Cloud via the Amazon S3 integration. I haven't tried that approach yet but may try it soon and post an update here. If you've built out that scenario (or any other scenarios you'd like to share), I'd love to hear your experience with it.
Below is the original article which describes how to configure Approach 1: Standard Action using Knowledge).
Configuration Steps for using the Standard Agent Action: "Answer Questions With Knowledge"
Salesforce Service Cloud has a well-established feature called Knowledge that enables companies to create/manage help articles in their Salesforce org. These articles can cover things like Frequently Asked Questions (FAQs), Product Documentation, and Customer Service Policies. Knowledge articles can be used by support teams to answer customer questions or can be public facing to enable customers to ind answers on their own.
Agentforce contains a standard action called Answer Questions With Knowledge that enables agents to query the Knowledge articles within your Salesforce org. In order to use this action, there are a few configuration steps that you'll need to complete. This article provides the steps to configure Agentforce to use Knowledge.
1. PREREQUISITES: Make Sure Required Features are Enabled
Confirm the following:
2. CREATE DATA LIBRARY
Once Data Cloud setup is complete, create Data Library (Setup > Einstein Data Libraries > create a data library). Set data source as Knowledge and select Knowledge fields you want data library to have access to. Note: when you create the Einstein Data Library, Salesforce will automatically generate relevant configurations in Data Cloud, including Data Source and Search Index records.
Important: in order to create an Einstein Data Library based on your Knowledge Base, you must have at least 10 knowledge articles in your Knowledge base.
领英推荐
3. CONFIGURE AGENT USER
Make sure there is a Salesforce user for your Agent. The agent user should have a profile with the Einstein Agent user license. Make sure agent user has the necessary perms:
4. CONFIGURE AGENT & TOPIC
4.1 Create Agent
Go to Setup > Agents, click "New Agent" and go through the setup Wizard. Pay careful attention to the following:
4.2 Add Topic to Agent:
If you didn't add the General FAQ topic during the New Agent setup process, you can add it later by doing the following:
Click "Open in Builder", add a Topic and add instructions.
4.3 Add Data Library to Agent:
If you didn't add the a Data Library during the New Agent setup process, you can add it later by doing the following:
In the Agent Builder, click the Data Library icon in the left hand menu. Assign the Data Library that you created above to the Agent.
5. REFRESHING KNOWLEDGE BASE
As you create or update Knowledge articles, Agentforce will not immediately have access to the changes. In order for Agentforce to search the updated Knowledge base, the Data Cloud search index will need to be refresh. According to the documentation, this happens on a daily basis. If you'd like to manually refresh it more frequently, I have found that you can do the following:
Once the Search Index has completed refreshing, your agent should now be able to search the most updated Knowledge base. You can test by asking the agent questions that cover your new/updated Knowledge articles and confirming that the agent's responses reflect the most updated versions of the articles.
References:
I used approach 2, but the Search Index was not created when upload a file.
Senior salesforce developer at OpFocus, Inc.
4 周I used approach 1, but the agent is unable to get any answers. The response is always like this: { ?"knowledgeSummary": "Sorry, I can't find an answer based on the available articles." } The agent user has the following permission sets: Data Could User Agentforce Service Agent Object Access Service - Knowledge Access. Am I missing anything?
VP Global SI Services
2 个月Thanks so much for this Brian. This is really informative and very helpful information.
Troubleshooter | 7X Certified Salesforce Professional | Let's improve the process before we make it faster!
2 个月Great info and concise. Very helpful.