Sub topic 10
Passages and Chunking: What Actually Gets Retrieved
Assume you already understand traditional search results and have used an AI search product. This chapter focuses on retrieval, the step where a system selects source material before generating an answer.
Documents are usually retrieved as passages
A search index may store a whole web page, but an AI system often retrieves smaller sections from that page. A passage is a short piece of a document, such as a paragraph, a group of paragraphs, or a section under a heading.
This matters because the system may not use your entire article. It may use only the passage that appears relevant to a sub-query. A page can therefore rank well overall while still contributing little to the final answer if its useful information is difficult to isolate.
Chunking is the process of dividing a document into these smaller retrieval units, called chunks.
A chunk usually contains:
- Text from one section or a nearby group of paragraphs.
- Metadata such as the page title, URL, heading path, author, or publication date.
- An embedding, which is a numerical representation of the chunk's meaning.
- Sometimes keyword data used for exact word matching.
How chunk size changes retrieval
Chunk size creates a trade-off.
| Chunk design | Strength | Risk |
|---|---|---|
| Small chunks | Precise matching for one fact | Missing context and qualifications |
| Large chunks | More complete explanations | Less precise retrieval and more irrelevant text |
| Overlapping chunks | Less chance of splitting an important idea | Duplicate content and larger indexes |
A chunk that says “It costs $140” is weak on its own. It does not identify the product or explain the price conditions. A larger chunk might preserve that context, but it can also contain several unrelated topics.
Systems often use overlap. If one chunk ends halfway through an explanation, the next chunk repeats some surrounding text. This reduces boundary problems, but it does not guarantee that every related fact will be retrieved together.
Here is a simple illustration of fixed-size word chunking:
def chunk_words(text, size=40, overlap=8):
"""Return overlapping chunks of approximately size words."""
if size <= 0 or overlap < 0 or overlap >= size:
raise ValueError("Use size > 0 and 0 <= overlap < size")
words = text.split()
step = size - overlap
return [
" ".join(words[start:start + size])
for start in range(0, len(words), step)
if words[start:start + size]
]
article = " ".join(
["Stability shoes can help some runners manage overpronation."] * 20
)
for number, chunk in enumerate(chunk_words(article), start=1):
print(f"Chunk {number}: {chunk[:70]}...")Production systems may split by tokens, headings, sentences, or semantic boundaries instead of using a fixed word count. The exact method varies by product and is often not publicly documented.
Make important passages self-contained
For marketers, chunking creates a structural requirement: each important passage should make sense when separated from the rest of the page.
A useful passage should identify its subject, state the claim directly, and include important conditions. Heading paths help provide context, but they may not always travel with the text during retrieval.
Prefer:
- “For flat feet, stability running shoes add support against inward rolling.”
- “This model costs $99 before shipping, according to the price checked on 1 May 2026.”
Avoid:
- “They add support for this problem.”
- “It is the cheapest option.”
- “This approach works better.”
The second group depends on surrounding text. A retrieved passage with unclear references is harder for an answer system to use accurately.
Inspecting passage-level coverage
Create a list of likely sub-questions, then inspect whether separate passages answer each one. Check for the subject, the answer, evidence, and qualifications. Keyword overlap can help find gaps, but it cannot prove that a passage answers a question.
Exercise
Why might a page with excellent information still contribute poorly to an AI-generated answer?
Show answer
Its information may be split across chunks, lack context in each chunk, use unclear references, or fail to match the system's sub-queries.