Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Salesforce · Agentforce Specialist

Chunking, Search Indexes, Hybrid Search, Retrievers

Agentforce Specialist · Lesson 5 of 14 · 39:13

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Salesforce Agentforce Specialist exam. In this lesson: preparing data in Data 360, chunk size, vector and hybrid search, the roles of fields in a search index, default and custom retrievers in Einstein Studio, prefilters and dynamic prefilters, the ensemble retriever, and keeping content clean and current. Includes three original practice questions, with Sunmeadow Solar, a fictional solar installer, as the example.

Study notes

The text of this lesson, to read at your own pace. Information as of December 2026.

When the library is not enough

Sunmeadow's agent now answers from the inverter manuals, but two new needs appear. It must also answer from past case resolutions, and a customer in one region must only get the warranty terms of that region. Both needs go beyond a data library, so this lesson opens the box: chunks, search indexes, and retrievers.

Preparing the data

When you build it yourself, the work starts with the data. You connect the source to Data 360, through a data stream, and map it to a data model object, such as one for case resolutions. Then you create a search index on that object, which chunks the text and turns each chunk into a vector. A search index covers only one data model object, so each source gets its own index.

Chunking

Chunking first splits the text along its structure, such as headings, then groups the pieces up to a maximum size. Each chunk becomes one vector. Smaller chunks make the search more precise, while larger chunks give the model more context for its answer. The default for a file library is five hundred and twelve tokens per chunk, roughly four hundred to five hundred words.

Vector or hybrid search

A search index can use vector search, which finds chunks by meaning, so that log in and sign on match. Hybrid search adds keyword search to the vectors, then merges and reranks the results. It helps when exact words matter, such as product names, part numbers, or error codes. It costs a little more time and credits, and keyword search alone is not an option.

Field roles in an index

When you build an index on a data model object, each field gets a role. Indexed fields hold the long text that is chunked and turned into vectors. Prepended fields, such as a title or a product name, are added at the start of every chunk, to give it context. Filter fields are not turned into vectors, and serve to filter the results, while returned fields are chosen in the retriever.

Retrievers

A default retriever is created with each search index, and you can see it in Einstein Studio. You can also build custom retrievers there, and choose their filters, the fields they return, and the number of results. The default retriever of a data library returns ten results. Prompt templates then call a retriever, never the index directly.

Prefilters

A prefilter narrows the search before it runs, for example to one language, one category, or a published status. Because it runs first, you still get the number of results you asked for. A prefilter can only use fields that were declared as filter fields when the index was created, and they cannot be added later. A dynamic prefilter takes its value at run time from an input of the prompt template, such as the customer's region.

Several sources

With several sources, each source has its own search index, such as files, knowledge, and cases. One option is a prompt template with an ensemble retriever, which merges and reranks the results of several retrievers. The other is one action per source, when the instructions say clearly which source answers which question. Do not force the agent to chain several actions for one answer.

Quality of the content

Finally, the answers are only as good as the content. Write detailed articles, with one topic per article, clear titles and headings, and real examples. Add alternative text to images, because images and videos are skipped when the text is chunked. And audit the content regularly, because a wrong or outdated article produces wrong answers.

Recap

Let's recap. You connect a source to Data 360, map it to one data model object, and build a search index on it. Chunks follow the structure of the text, and smaller chunks are more precise, while larger ones give more context. Hybrid search adds keywords to vectors, for exact names and codes. Retrievers live in Einstein Studio, and prefilters, fixed or dynamic, narrow the search before it runs. Use an ensemble retriever or one action per source, and keep the content clean and current.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. Search finds the right manual, but the chunk is too long, and the answer mixes several topics. Which change helps MOST?

    • Increase the maximum chunk size
    • Reduce the maximum chunk size
    • Ask the retriever for more results
    • Index the category picklist field
    Show the answer

    Reduce the maximum chunk size

    Smaller chunks make the search more precise, so each result stays on one topic. “Increase the maximum chunk size” is wrong, because larger chunks would mix even more topics into each result. “Ask the retriever for more results” is wrong, since more results add more text, and do not make any single chunk more focused. And “Index the category picklist field” is wrong, because a picklist field holds a category, which would make chunks without any useful context.

  2. Customers type exact error codes, like E402, and vector search misses the right article. What should the admin use?

    • Keyword search on its own
    • Larger chunks in the index
    • More results from the retriever
    • Hybrid search
    Show the answer

    Hybrid search

    Hybrid search adds keyword matching to vector search, so exact codes and part numbers are found. “Keyword search on its own” is wrong, because keyword search cannot be used alone in a search index. “Larger chunks in the index” is wrong, since larger chunks change how much text is returned, not whether an exact code matches. And “More results from the retriever” is wrong, because returning more results does not teach the search to match an exact code.

  3. A customer must only get warranty terms for their own region, and the region comes from the customer’s record at run time. What should the admin set up?

    • A dynamic prefilter on the region field
    • A fixed prefilter with one region value
    • A separate agent for each region
    • Instructions telling the model to ignore other regions
    Show the answer

    A dynamic prefilter on the region field

    A dynamic prefilter on the region field takes its value from the template input at run time, before the search runs. “A fixed prefilter with one region value” is wrong, because a fixed prefilter would give every customer the same region. “A separate agent for each region” is wrong, since a separate agent per region multiplies agents, and the content would still need filtering. And “Instructions telling the model to ignore other regions” is wrong, because the model would see every region's terms, and might still mix them up.