RAG
Parent-child (small-to-big) retrieval
Search over small chunks for precision, hand the model the bigger section for context.
What it is and why it exists
Index sentence- or paragraph-sized child chunks so matches are precise, but store a pointer to their parent section. At answer time, return the parent (deduplicated) so the model sees surrounding context.
Quick prototype
Retrieve chunk i and also include chunks i−1 and i+1.
In production, at scale
Hierarchical chunking with stored parent IDs, dedupe parents when several children hit, and cap parent size by token budget.
Vendors and tools
| LlamaIndex AutoMergingRetriever | Merge children into parents |
|---|---|
| LangChain ParentDocumentRetriever | Small-to-big retrieval |
On AWS: Bedrock Knowledge Bases hierarchical chunking returns parent chunks.
How it fails
- Parents so large they blow the budget
- Five children of one parent crowd out other sources
What the interviewer asks next
When does small-to-big beat just using larger chunks?
When questions are specific (one fact) but answers need surrounding conditions: small chunks match the question precisely, the parent supplies the caveats.