Loading
Upcoming Mandatory Changes to Public Key Infrastructure (PKI)Read More
Salesforce Enforces New Security Requirements in Summer 2026Read More
Agentforce and Einstein Generative AI
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Customize Retriever Output with Prefilters

          Customize Retriever Output with Prefilters

          Get more relevant search results using prefilters in your prompt templates. Prefilters define the conditions that limit the scope of a retriever’s search so that only the most relevant information is returned. For example, you can use prefilters to retrieve content associated with only a particular country or product. The filter value, such as the country code or product Id, is specified in the prompt template at run time.

          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
          To create and manage retrievers: Data Cloud permission set
          To run prompts with Einstein search: Data Cloud User permission set
          Note
          Note To use prefilters in Prompt Builder, the Einstein Search retriever must be configured in AI Models (formerly Einstein Studio) with at least one filter condition with the Dynamic property selected. To learn more, see the instructions for defining filter conditions in Create an Individual Retriever.
          1. In Prompt Builder, create or edit a prompt template.
          2. In the Prompt Template Workspace, click where you want to insert the retriever.
          3. Type @ or click Insert Resource, click Retrievers, and click Configure Retrievers +.
          4. Select the retriever you want to add to the prompt template.
            This retriever must have at least one filter condition with the Dynamic setting enabled.
          5. Under Template Settings, scroll to the Search Parameters section and find a Pre-filter input field. Example:
            Screen shot of example pre-filter field.
            If you don’t see a Pre-filter input field, go to AI Models and verify that the selected retriever is configured with at least one filter condition that's configured as Dynamic.
          6. Click the Pre-filter field to open the resource picker and select the source of the filter value for the pre-filter field.
            Screen shot of options for pre-filter field.
            The selected value appears in the Pre-filter field.
          7. To remove a setting, select the X. To return to a previously selected setting, select the undo (Undo button) icon.
          8. Change other template settings, if you want.
          9. Click Apply and Insert.
          10. Save your work.
          11. Test your changes. Preview the prompt template and review the LLM-generated response.
           
          Loading
          Salesforce Help | Article