You are here:
Create a Document Library for the Applicant and Grantee Support Agent
Upload PDF files to an Agentforce Data Library so the Applicant and Grantee Support Agent can retrieve answers from your grant documents.
Required Editions
| Available in: Lightning Experience |
| Available in: Nonprofit Cloud for Grantmaking and Public Sector Solutions. View edition availability. |
| User Permissions Needed | |
|---|---|
| To create an Agentforce Data Library: | Manage Data Libraries system permission |
| To modify an agent in Agent Builder: | Manage Bots system permission |
Complete Set Up the Applicant and Grantee Support Agent before creating a document library.
-
Create the Agentforce Data Library.
If your organization supports multiple grant programs, repeat this task for each one. See the example for details on configuring the agent for multiple retrievers.
- From Setup, enter Agentforce Data Library in the Quick Find box, then select Agentforce Data Library.
- Click Add Data. You can either upload local files or use a custom retriever.
- Select a data space and name your data library.
-
Upload your PDF files and click Save.
Important For best results, upload PDFs with clear, well-structured content. Avoid complex, densely formatted government documents such as Notices of Funding Opportunity (NOFOs), which are difficult for the agent to process accurately due to their length and formatting. An FAQ-style document that directly addresses common grantseeker questions is ideal.
-
Wait for the data library to reach Ready status.
After you upload files, Salesforce automatically indexes them and creates the underlying Data Cloud configurations. This process takes approximately 15–20 minutes. To check progress, go to App Launcher | Data Cloud | Search Indexes and wait until the search index is created and the data library shows Ready.
Important Don't connect the library to the agent until it shows Ready status. Using a library before indexing completes produces incomplete or missing results. -
Tag the document library's data model objects for external user access.
When Salesforce indexes the document library, it creates three data model objects (DMOs) in Data Cloud. You must tag these DMOs so that external Community users can access the retriever. Internal platform users are covered automatically by Salesforce's default All Data Access ruleset policy and don't require this step.
- From the App Launcher, open Data Cloud and click Data Model.
-
Locate the three DMOs created for your document library. Their names follow these
patterns, where LibraryName is the first 15 characters of your
library's API name.
ADL_LibraryNameADL_LibraryName chunkADL_LibraryName index
- For each DMO, open its detail page by clicking the Object Label, click Manage Tags, then click Attach Tags.
-
In the search box, search for and add the following tags.
ExternalData.Visibility.PortalExternalData.Visibility.Public
- Select Add these tags to [library name] and click Save.
- On the DMO Details page, click Done.
- Repeat substeps (c) through (f) for each of the remaining DMOs.
-
Get the API name of the library's retriever.
- From Setup, enter Agentforce Data Library in the Quick Find box, then select Agentforce Data Library.
- Select your data library.
- In the Status section, click the Retriever link.
-
Under Retriever Details, copy the API Name.
The retriever API name follows the pattern
File_ADL_LibraryName_UniqueID, for exampleFile_ADL_GrantDocuments_1Cx_l2D32f7b02d.
-
Update the agent to use the document library retriever.
- From the App Launcher, enter Agents in the search box, then select Agentforce Studio and open your Applicant and Grantee Support Agent.
- If the agent is active, click Deactivate.
- Switch from Canvas view to Script view.
-
In the Grantseeker Assistance subagent (1), find the
AnswersQuestionsFromDocument (2) action and update its
instruction to reference the retriever API name (3) you copied in the previous
step.
- Click Save, then switch from Script view to Canvas view.
- In the Explorer pane, under Data, select Data Library.
- Search for and select your data library.
- Click Save and then click Commit Version.
-
Test the document library.
- In Agent Builder, click Preview.
- Ask a question that can be answered from your uploaded documents and confirm that the agent returns a relevant response.
If your organization supports multiple grant programs, update the Grantseeker Assistance subagent instructions in Script view to direct the agent to the correct retriever based on the user's question. The following example shows instructions configured for two grant programs. Replace the retriever IDs and grant names with your own.
subagent GrantseekerAssistance:
label: "Grantseeker Assistance"
description: "Answer grantseeker questions about grant programs, eligibility, application procedures, deadlines, and funding guidelines using document search and knowledge base."
reasoning:
instructions: ->
| Your organization supports TWO grant programs. Use only the retriever for the grant the user is asking about:
- Digital Equity Competitive Grant: File_Digital_Equity_Competitive_Grant_1Cx_ZZ3deff5335
- Public Wireless Supply Chain Innovation Fund Grant: File_Public_Wireless_Supply_Chain_Innova_1Cx_ZZ393667fb8
1. Identify which grant the user is asking about before taking any action.
- If the grant was named earlier in the conversation, continue using it for follow-up questions unless the user clearly switches.
- If the grant hasn't been identified, ask the user which grant their question is about. Do not call any action until a grant is identified.
- Recognize common shorthand (for example, "digital equity" for the Digital Equity Competitive Grant; "public wireless," "supply chain," or "wireless innovation" for the Public Wireless Supply Chain Innovation Fund Grant). When in doubt, ask.
- If the user names an unsupported grant, do not search. Tell them the two supported programs and direct them to the grants administrator for any other program.
- If the user asks a question that compares or spans both grants, decline politely and direct them to the grants administrator.
2. Use the Answer Questions from Document action to search the identified grant's document retriever. Do not include the grant name in the search query — the retriever is already scoped to that grant.
3. If the document search doesn't provide a sufficient answer, use the Answer Questions with Knowledge action to search Salesforce Knowledge articles.
4. If neither action provides relevant information, clearly state that you couldn't find an answer and direct the user to contact the grants administrator or support team for further assistance.
- Always provide clear, accurate, and concise answers based only on information retrieved from documents or knowledge articles.
- Never fabricate facts, instructions, dates, requirements, or data values that aren't explicitly stated in your provided resources.
- Never use content from one grant's retriever in an answer about the other grant.
- When relevant, mention eligibility conditions, required documents, and next steps.
- Confirm with the user whether the answer resolved their question.To give the agent access to Knowledge articles in addition to documents, see Create a Knowledge Article Library for the Applicant and Grantee Support Agent. Otherwise, proceed to Activate the Grantseeker Agent.
