Add a Retriever to a Field Generation Prompt Template
Add a retriever to a field generation prompt template by selecting it from the Resource field.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise, Performance, and Unlimited Editions with the Einstein for Platform, or Einstein or Agentforce for Sales or Service add-on, or Agentforce Foundations |
| User Permissions Needed | |
|---|---|
| To create and manage prompt templates in Prompt Builder: | Prompt Template Manager permission set
OR Customize Application permission set |
| To create and manage retrievers: | Data Cloud permission set |
| To run prompts with Einstein Search: | Data Cloud User permission set |
This topic walks through the steps to create and preview a prompt template that uses an Einstein Search retriever to create an account description. You must create a retriever in AI Models (formerly Einstein Studio) before you can use it in a prompt template. See Use a Custom Retriever for more information. This example uses a custom retriever named ESearchAccountDescription to search through an internal knowledge store of account description information stored as unstructured data.
- In Prompt Builder, create a prompt template and select Field Generation from the Prompt Template Type dropdown.
- Enter a Prompt Template Name and Description.
- Define a resource. In this example, we select Account for the Object, and Account Description for the Object Field.
- Click Next to go to the Prompt Template Workspace.
-
In the Example Prompt Template Library, find the Field Generation prompt
template Draft an Account Description. Copy and paste this template into the
Prompt Template Workspace.
In the instructions, add the text, Use the following information that’s related to the account:
- In the Prompt section, type @ or click Insert Resource, click Retrievers, and click Configure Retrievers +.
- Select the retriever you want to add to the prompt template.
-
Optionally, change retriever settings in the Template Settings side
panel.
- Descriptors: Change the Label and Description for this retriever in your prompt template.
- Search Text: Focus your search by specifying additional criteria. Select a resource or specify search text.
- Output Fields: If available for the selected retriever, select one or more returned fields of data to ground your prompt.
- Number of Results: If available for the selected retriever, specify the maximum number of retrieved results.
-
Click Apply and Insert.
After adding the retriever to the prompt template, you can customize the search parameters in the Preview Settings panel.
-
In the Preview Settings panel, click the Search Text field and type or select
your query.
In this example, we type
account name:in the search text. Next, we find and select the Account Name resource in the search field. Then, we typeaccount industry:in the search text and find and select Account Industry in the search field.Our final Search Text looks like this:
account name: Input.Account.Name
account industry: Input.Account.Industry
- Select the Number of Results. We use 10 for this example.
- Click Save.
-
Run the prompt template and see the LLM-generated description.
- Click the Preview Settings button.
- Under Inputs, search for and select an account in the Accounts search bar.
- In the Configure Response and Display sections, verify that Generate Response, Display Prompt, and Display Resolution are selected or deselected based on what you want to test.
- Click Preview. Review the response.

