Study guide
6.4 Retrievers: Individual, Ensemble & Filtered Retrieval
Salesforce Certified Agentforce Specialist Exam
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: Exam Overview & How Agentforce Agents Work
1.1 Agentforce Specialist (AI-201) Exam Facts & Spring '26 Blueprint 1.2 How an Agent Works & the Building Blocks of Agent Script 1.3 Hybrid Reasoning: Agent Script in Canvas View and Script View
2 Chapter 2: Deterministic Control, Topics (Subagents) & Actions
2.1 Deterministic Behavior: Filters, Variables & Template Expressions 2.2 Standard and Custom Topics (Subagents) 2.3 Standard and Custom Agent Actions
3 Chapter 3: Agent Types, Security Context, Channels & Agent API
3.1 When to Use an Employee Agent or a Service Agent 3.2 Security Context: Who the Agent Runs As and How It Affects Actions 3.3 Connecting Agents to Channels: Digital Experiences, Email, Voice & Slack 3.4 When to Use the Agent API
4 Chapter 4: Prompt Builder Fundamentals
4.1 When to Use Prompt Builder 4.2 Access Controls Governing Prompt Templates 4.3 Prompt Template Types: Field Generation, Flex & More 4.4 Creating, Activating & Executing Prompt Templates
5 Chapter 5: Grounding, Prompt Best Practices, Trust Layer & Model Access
5.1 Choosing the Right Grounding Technique 5.2 Best Practices for Writing Effective Prompts 5.3 Einstein Trust Layer Security and Privacy Features 5.4 Managing and Preventing Access to Specific Models
6 Chapter 6: Data 360 Fundamentals for Agentforce
6.1 Agentforce Data Library: Types and Concepts 6.2 Chunking: Breaking Content Into Retrievable Units 6.3 Indexing and Search Types: Vector, Hybrid & Keyword 6.4 Retrievers: Individual, Ensemble & Filtered Retrieval
7 Chapter 7: Testing Agents with Testing Center
7.1 Testing an Agent with Testing Center 7.2 How Testing Center Evaluations Work
8 Chapter 8: Deploying Agents and Prompt Templates
8.1 Deploying an Agent from Sandbox to Production 8.2 Deploying Prompt Templates from Sandbox to Production
9 Chapter 9: Governance and Observability
9.1 Managing and Monitoring Agents 9.2 Agent Analytics and Agent Optimization
10 Chapter 10: Multi-Agent Orchestration, MCP & A2A
10.1 When a Multi-Agent Architecture Is Appropriate 10.2 Open Multi-Agent Protocols: MCP and A2A
6.4 Retrievers: Individual, Ensemble & Filtered Retrieval
Key Takeaways Explain This Topic AI
Retrievers are created and activated in AI Models (formerly Einstein Studio) and return relevant search-index results to prompt templates, agents, and flows.
An individual retriever targets one search index with up to ten filter conditions, selected output fields, and a number of results; only one version can be active.
An ensemble retriever runs multiple individual retrievers, combines their results into one list, and reranks by relevance.
Dynamic filter conditions accept run-time values, such as a product ID from a prompt template, but retrievers with dynamic filters can't be part of an ensemble.
Retrievers enforce data governance and row-level access, so results exclude records the calling user or agent can't access.
Last updated: September 2026
6.4 Retrievers: Individual, Ensemble & Filtered Retrieval
Quick Answer: A retriever is the use-case-specific way to search a Data 360 search index and return the most relevant results to a prompt template, agent, or flow . You build and activate retrievers in AI Models (formerly Einstein Studio). Individual retrievers query one index with filters , output fields , and a number of results . Ensemble retrievers combine several individual retrievers and rerank their results. Dynamic filters take values at run time. Retrievers respect data access , so users and agents only get what they're allowed to see.
Why Retrievers Sit Between Indexes and Prompts
A search index is often general-purpose , such as an index of the entire knowledge base. A retriever specializes it for one job, for example:
- Only articles in a product category
- Only the most recent content (such as the last 90 days)
- Only a geographic region
- Only certain fields, such as Description but not Resolution (using DataSource__c )
At run time the retriever gives the LLM accurate, current, pertinent information, which improves relevance and reduces hallucination.
Retriever Types
Type What it is Key rules
Individual retriever Queries one search index with filters and output settings Every edit and save creates a new version , and only one version can be active
Ensemble retriever A collection of individual retrievers that run in parallel . Results are combined into one list, reranked by relevance, and the most relevant returned Doesn't support retrievers of type Code . Individual retrievers with dynamic filters can't be included
Dynamic retriever Uses placeholders that accept run-time values from the prompt template Configure dynamic filter conditions; pass values in Prompt Builder
Web retriever Created by a web search data library Used as a resource in prompt templates
Default retriever (legacy) Previously auto-created with each search index No longer created automatically ; existing ones still work
Configuring an Individual Retriever
In AI Models → Retrievers :
Select the search index (the data space and DMO it covers).
Define filter conditions (up to ten ) to narrow results.
Choose output fields , meaning what data returns to the prompt. By default, all fields defined in the retriever configuration are added.
Set the number of results , such as 15 knowledge chunks or 10 similar case chunks.
Optionally enable citations at the individual retriever level so callers such as prompt templates can show sources.
Save (new version) and activate the version to make it available in Prompt Builder.
Filter conditions
- Operator Example
- Equal To Make Equal To Honda
- Not Equal To Trim Not Equal To High-End
- Greater Than / Less Than ModelYear Greater Than 2000
- Like ModelName Like Civic
Combine conditions with AND , OR , or custom logic such as 1 AND (2 OR 3) .
Like : in the retriever definition, don't add a trailing % , because one is appended internally. When supplying a value from Prompt Builder or Flow for a dynamic Like filter, you must append the trailing % .
Data type guidance: text up to 255 characters (254 with Like), Boolean True or False, dates such as "Dec 31, 2024", no ArrayOfTexts, and no single quotes in values.
Dynamic filter conditions use placeholders such as {!$ItemName} . Placeholder names must start with a letter, use alphanumeric characters and non-consecutive underscores, have no spaces, not end with an underscore, be at most 40 characters, and be unique across pre-filter fields.
Using Retrievers in Prompt Builder
In the Prompt Template Workspace, type @ or click Insert Resource → Retrievers → Configure Retrievers .
Select an individual, ensemble, or web retriever (it must be active).
In Template Settings , configure:
Search Text – merge fields from prompt inputs or free text. It's limited to globals and prompt inputs , 255 characters , and can't use related lists, flows, or Apex.
Output Fields – select only the fields the prompt needs.
Number of Results – the maximum results returned.
Pre-filter – appears only if the retriever has at least one dynamic filter condition. Bind it to a run-time value, such as the case's country or product ID.
Apply and Insert , save, and preview. The Preview Resolution shows retriever data in JSON .
If you don't set output fields or number of results, Prompt Builder uses the values from the retriever's configuration.
Permissions: Prompt Template Manager to build templates, the Data Cloud permission set to create and manage retrievers, and Data Cloud User to run prompts with Einstein search.
Using Retrievers with Agents
A Data Library creates its own retriever, and Answer Questions with Knowledge uses it.
A custom retriever data library can point to any active retriever, including an ensemble , so an agent can draw on multiple sources.
Dynamic pre-filters aren't supported with the Answer Questions with Knowledge template. Use static pre-filters, separate libraries per category, or a custom Apex action that passes filter values.
For custom logic, a prompt template action with its own retriever and dynamic pre-filter bound to a variable-driven input gives precise control.
Loading diagram... Individual vs. ensemble retrieval
Testing Retrievers: The Retriever Playground
In AI Models , the retriever playground lets you configure pre-filters, choose test data, adjust result parameters, and review intermediate outputs and metrics , such as Source Recall Score and Context Recall Score , before the retriever goes into an agent. Salesforce calls it a cost-effective way to test and debug retrievers. Testing still consumes Data Queries credits.
Limitations:
Pre-filter conditions for individual retrievers are tested separately , not inside an ensemble.
Ensemble retrievers that contain custom SQL retrievers can't be tested in the playground.
Security and Governance
Retrievers adhere to the data governance policies for your data.
Row-level access checks ensure the user or AI agent calling the retriever can access the source records. If the caller can't access a record, it doesn't appear in results.
For Service agents, the agent user's access applies. For Employee agents, the logged-in user's access applies.
Measuring Retrieval Quality
Knowledge/RAG Quality Data and Metrics (enabled in Einstein Audit, Analytics, and Monitoring Setup) scores run-time retrievals for individual and ensemble retrievers:
Metric Question it answers
Context Relevance / Precision Was the retrieved context relevant to the question?
Faithfulness Did the answer stay consistent with the retrieved context?
Answer Relevance Did the answer actually address the question?
Pattern Likely problem Investigate
High faithfulness, low context relevance Retrieval returned the wrong content Does the content exist? Enough results? Right fields? Well-formed search string? Multilingual embedding model for non-English content?
Low faithfulness , high context relevance Generation ignored good context Prompt instructions, or a more capable LLM
High faithfulness and context relevance, low answer relevance Retrieval recall too low, so not enough context Increase results, check fields, confirm content exists
Deployment Note
Retrievers and search indexes aren't included in change sets or Metadata API deployments of prompt templates. Recreate them in the target org first, or move Data 360 configuration with data kits . Packaged templates that depend on retrievers need those retrievers provided through data kits.
Exam Traps
Only one active version per retriever. Activating a new version deactivates the old one.
Dynamic-filter retrievers can't join an ensemble.
The Pre-filter field appears only for retrievers with a dynamic filter.
Retrievers enforce access. Missing results can be a permissions issue, not a relevance issue.