Glossary
Parent document retrieval
A retrieval technique that searches small chunks for precision and returns the larger parent section or document for context.
Parent document retrieval is a retrieval technique that searches over small chunks but returns the larger section or document each chunk came from. Small chunks match a query precisely, and large chunks give the model enough surrounding text to answer well. Indexing the small pieces and handing back their parents gets some of both, at the cost of more tokens per result.
How parent document retrieval works
Documents in a RAG system are split twice. A first pass cuts each document into parents, often sections of a thousand tokens or more, or whole short documents. A second pass splits each parent into children of a few hundred tokens, and only the children are embedded and indexed in the vector store. Each child keeps the ID of its parent. At query time the retriever finds the best-matching children, looks up their parents in a separate document store, removes duplicates and returns the parents to the model.
The pattern is also called small-to-big retrieval. LangChain ships it as a ParentDocumentRetriever, and LlamaIndex has an auto-merging retriever that swaps in a parent when enough of its children match; LangChain vs LlamaIndex compares the two frameworks.
Why split matching from context
Every chunking strategy faces the same tension. The embedding of a long chunk averages several topics, so it matches specific questions weakly. A short chunk embeds precisely, but it may cut off the sentence before it or the table header above it that the answer depends on. Tuning chunk size or chunk overlap moves the trade-off without removing it. Parent document retrieval separates the two jobs: the child is the unit of search, and the parent is the unit of context. Chunking is a workaround, not a design takes the argument further.
Parent document retrieval compared
Technique | Unit searched | Unit returned | Main cost |
|---|---|---|---|
Standard chunk retrieval | Chunk | The same chunk | One size has to serve precision and context |
Parent document retrieval | Small child chunk | Parent section or document | More tokens per result |
Sentence window retrieval | Single sentence | Sentence plus neighbours | Window size to tune |
Contextual retrieval | Chunk with added context | The same chunk | A model call per chunk at indexing |
Sub-document retrieval | Passage located at query time | The matching passage | Depends on the search engine |
Sentence window retrieval is the fine-grained version, expanding a matched sentence by a fixed number of neighbours. Contextual retrieval and late chunking take another route and put document context into each chunk’s embedding, so the chunk itself carries more meaning. Sub-document retrieval locates the answering passage at query time instead of relying on pre-cut blocks.
Trade-offs
Returning parents multiplies the tokens in each request. Five matched children can bring back five long sections, so teams usually return fewer results, cap parent size and merge children that share a parent, which makes deduplication a required step. Large parents also carry unrelated text that can distract the model and push the useful part into the middle of the prompt, the lost in the middle effect. Reduce token costs explains why the size of returned context matters for the bill.
The setup also needs a second store that maps child IDs to parent text, and both stores have to stay in step when documents change, which becomes part of every re-indexing job.
Parent document retrieval and Exabase
Deep Search returns results in a parent and child shape. Each hit is a resource, such as a PDF, note or video, with its own relevance score, and under it sit the matched chunks with their scores and page numbers or timestamp ranges. Your application can pass just the chunks to the model or use the hit to decide which document deserves more of the prompt. The precision setting, from 0 to 1, controls how many loosely related hits come back. Documents stored as Resources are indexed when they are written, with no chunking logic to build or tune, and How sub-document retrieval works explains the approach.
If you run your own retriever on Extract output, each chunk carries a sequence number alongside its page number or timestamps, so a parent can be rebuilt from a range of neighbouring chunks fetched through the chunks endpoint. Extract deletes stored job files one day after the job is created, so save the chunks you need. The PDF to chunks tool shows the output format, and the RAG pipelines use case shows a full pipeline.
FAQs
What is parent document retrieval?
Parent document retrieval indexes small chunks for precise matching and returns the larger parent section or document of each matching chunk, so the model gets fuller context.
What is the difference between parent document retrieval and sentence window retrieval?
Both search small units and return more text. Parent document retrieval returns a predefined parent such as a section, while sentence window retrieval returns the matched sentence with a fixed number of neighbouring sentences.
What chunk sizes work for parent document retrieval?
A common starting point is children of 100 to 400 tokens and parents of 1,000 to 2,000 tokens, tuned against a small set of real questions with known answers.
Does parent document retrieval increase token costs?
Yes. Each result carries more text, so return fewer parents, cap their size and merge duplicates to keep requests small.
Is parent document retrieval the same as hierarchical chunking?
They are closely related. Hierarchical chunking describes splitting documents into nested levels, and parent document retrieval is the retrieval pattern that searches the lowest level and returns a higher one.
Does Exabase support parent document retrieval?
Deep Search groups matched chunks under the document they came from, with page numbers or timestamps, so your application can see the source of every chunk and decide how much context to pass. There is no separate parent index to build.
Related pages: Chunking, Sentence window retrieval, Contextual retrieval, Sub-document retrieval, Chunk overlap, Retriever, HyDE, Multi-hop retrieval, Deep Search, RAG accuracy.