Parent-child chunking solves one of the oldest tensions in retrieval-augmented generation: small chunks match questions precisely, but large chunks give the language model the context it needs to answer well. The fix is to decouple the two jobs — embed small child chunks for search, and hand the model the larger parent chunk each match came from. Should you use it? Yes, when your questions need precise matching and your answers need surrounding context, and you are willing to build the retrieval step that expands children into parents.
Every single-size chunking strategy forces a compromise. Pick small chunks and retrieval is sharp but context is thin; pick large chunks and context is rich but matching is blurry. Parent-child chunking refuses the compromise by keeping two sizes at once, linked together so that a match at one level can be expanded to the other.
Key takeaways
- Parent-child chunking stores small child chunks for embedding search and larger parent chunks for generation context, linked by metadata.
- Retrieval matches on children, which are precise; the model receives parents, which carry definitions, exceptions and background.
- It needs retrieval-time expansion — a plain vector search over children alone will not deliver the benefit.
- It costs more storage than single-size chunking, because two granularities of the same text are kept.
- It works best on structured documents where a section genuinely adds context to the facts inside it.
What is parent-child chunking?
Parent-child chunking, also called hierarchical or small-to-big chunking, splits each document into two linked levels. The parent level holds large pieces — a section, a long paragraph, or roughly 1,000 to 2,000 tokens of text. The child level holds small pieces carved from inside each parent — a sentence or two, or roughly 100 to 300 tokens. Each child records which parent it belongs to, and each parent records its children.
Only the children are embedded and indexed for search. When a question arrives, the retriever compares it against child embeddings, which are focused enough to match a specific fact or rule. Once the best children are found, the system looks up their parents and sends those larger pieces to the language model instead. The model therefore sees the fact in its full setting: the definition that precedes it, the exception that follows it, and the conditions that qualify it.
The pattern generalises to more than two levels. Some pipelines use three — grandparent, parent and child — so retrieval can start very precise and expand in stages.
How parent-child chunking works
Building the index takes four steps. First, split documents into parent chunks using a recursive or structure-aware splitter, so parents follow section or paragraph boundaries. Second, split each parent into child chunks with a smaller splitter, keeping the parent identifier on every child. Third, embed the children and store them in the vector index. Fourth, store the parents in a document store keyed by the same identifiers, so any child can be resolved to its parent at query time.
Query time is where the design earns its keep. A plain retriever would return the matching children and stop, which would waste the whole arrangement. A parent-child retriever instead expands each matched child to its parent before building the prompt. In LlamaIndex, this is handled by the HierarchicalNodeParser, which builds the levels, and the AutoMergingRetriever, which merges a parent into the results when enough of its children match. In LangChain, the equivalent is the ParentDocumentRetriever, which embeds child documents but returns their parents.
The merging rule matters. Returning the parent of every matched child can flood the prompt with repeated text when several children share one parent, so good implementations deduplicate parents and cap the number of parents returned. Some systems also merge only when a threshold of sibling children match, treating multiple hits inside one parent as evidence that the whole section is relevant.
Parent-child chunking in practice
A typical LlamaIndex setup builds three levels from each document:
from llama_index.core.node_parser import HierarchicalNodeParser
parser = HierarchicalNodeParser.from_defaults(
chunk_sizes=[2048, 512, 128]
)
nodes = parser.get_nodes_from_documents(documents)
Here the largest level holds 2,048-token parents, the middle level 512-token pieces, and the smallest level 128-token leaf nodes. Only the leaf nodes are indexed for search, while the full hierarchy is kept in the document store so the retriever can climb back up to the right level at query time.
In LangChain, the ParentDocumentRetriever follows the same idea with two splitters: a large one for parents and a small one for children. The children are embedded and stored in the vector store, the parents in a separate document store, and retrieval returns parents for matched children. Both frameworks agree on the hard part: the splitter is easy, but the retriever must be built to expand matches, or the hierarchy does nothing.
Before adopting the pattern, measure it against a single-size baseline on your own questions. Our guide to retrieval accuracy shows how to run that comparison, and it is the only way to know whether the extra storage and complexity are paying for themselves on your corpus rather than someone else’s.

Strengths of parent-child chunking
The main strength is that it resolves the chunk-size dilemma instead of compromising on it. Small children match specific facts — a threshold, a date, a named rule — that would be diluted inside a large embedding. Large parents give the model the surrounding explanation, which reduces the guessing that causes hallucinations when a fragment is ambiguous on its own.
It also handles mixed question types gracefully. A question asking for one fact gets the same treatment as a question asking for an explanation, because the expansion step adapts: the fact question retrieves a precise child, and the model still receives the parent that explains it. Single-size pipelines have to choose which question type to favour.
Finally, the hierarchy is reusable. Once parent-child links exist, other retrieval strategies can use them: a reranker can score children and return parents, and a citation system can point at the parent for readable sources.
Weaknesses of parent-child chunking
The biggest weakness is that it is not a splitter alone — it is a splitter plus a retriever, and the retriever is the hard half. Teams that index children but query with a plain top-k retriever get small chunks back and none of the benefit. The pattern only works when the query path is built to expand, merge and deduplicate.
It also costs more. Two levels of the same text must be stored, and building the index means running the splitter twice and managing the links between levels. For very large corpora, that overhead is real, though it is usually smaller than the cost of a semantic chunking pass.
Parents can also be too large. If a parent is a whole chapter, returning it for every match wastes context and can push useful material out of the prompt. Parent size needs the same care as any chunk size, and the right size depends on how much surrounding text your answers actually use.
Parent-child chunking compared with other strategies
| Strategy | How it splits | Main strength | Main weakness | Best for |
|---|---|---|---|---|
| Parent-child chunking | Two linked levels: small children, large parents | Precise matching plus rich context | Needs expansion at retrieval time | Structured docs, mixed questions |
| Fixed-size chunking | Equal character or token counts | Simple and predictable | Cuts mid-sentence | Uniform plain text |
| Recursive chunking | Separator hierarchy | Respects natural boundaries | One size for both jobs | General-purpose documents |
| Sentence-window retrieval | Single sentences plus neighbours | Very precise matching | Windows are fixed, not structural | Dense factual prose |
Best for: structured documents such as manuals, policies, contracts and research papers, where a section adds real meaning to the facts inside it, and where questions range from single facts to explanations that need background.
When parent-child chunking is the right choice
Choose it when your documents have genuine hierarchy — sections with headings, clauses with sub-clauses, chapters with subsections — and when your questions mix precise facts with requests for explanation. Policy documents are a classic case: a user asks about one rule, but the answer is only correct with the definitions and exceptions that surround it.
It also fits when single-size tuning has stalled. If small chunks retrieve well but answers are thin, and large chunks answer well but retrieve poorly, no single size will fix the pipeline.
Skip it when documents are flat prose with no meaningful sections, when your questions are uniformly short and factual, or when your team cannot build the expansion step in the retriever. In those cases, a well-tuned recursive splitter and a reranking pass will usually deliver most of the benefit for far less engineering. The pattern is powerful, but it is not free.
Common mistakes with parent-child chunking
The most common mistake is building the hierarchy and then querying it with a plain retriever. If the query path returns children directly, the system behaves exactly like a small-chunk pipeline, and the parents sit unused in storage. Always verify that matched children expand to parents before you measure anything.
The second mistake is making parents too large. A parent should be a section, not a chapter, and it should fit comfortably in the prompt alongside several other parents. If parents routinely exceed 2,000 tokens, split them smaller or add a middle level so expansion can stop at the right size.
The third mistake is skipping deduplication. Several matched children often share one parent, and sending that parent three times wastes context that could hold other evidence. Deduplicate parents before building the prompt, and cap the total number of parents so the prompt stays within budget.
Decision checklist
Use this checklist before adopting parent-child chunking in production.
- Your documents have real hierarchy — sections, clauses or chapters — that adds meaning to the facts inside.
- Single-size tuning has stalled: small chunks retrieve well but answer thinly, or large chunks answer well but retrieve poorly.
- Your retriever expands matched children to parents, merges siblings and deduplicates the results.
- Parent size is capped so several parents fit in the prompt alongside the question and instructions.
- You measured retrieval and answer quality against a single-size baseline on your own test set.
- Storage and indexing costs for two levels are budgeted and acceptable.
- You have a fallback — plain recursive splitting — if the hierarchy adds no measured benefit.
Frequently asked questions
What is parent-child chunking?
Parent-child chunking splits documents into two linked levels: small child chunks that are embedded and searched, and larger parent chunks that are returned to the language model. It gives precise retrieval and rich context at the same time.
How is parent-child chunking different from recursive chunking?
Recursive chunking produces one set of chunks at one size, chosen to balance matching and context. Parent-child chunking keeps two sizes at once, using small chunks for matching and large chunks for generation, linked so a match can expand to its parent.
Do I need a special retriever for parent-child chunking?
Yes. A plain vector search returns the matched children and stops. You need a retriever that expands children to parents, such as LlamaIndex’s AutoMergingRetriever or LangChain’s ParentDocumentRetriever, or the hierarchy delivers no benefit.
What parent and child sizes should I use?
Common starting points are parents of 1,000 to 2,000 tokens and children of 100 to 300 tokens, but the right sizes depend on your documents. Test alternatives against your own questions rather than copying numbers.
Does parent-child chunking cost more than normal chunking?
Yes, modestly. Two levels of the same text must be stored, and the index build runs the splitter twice. Embedding costs stay low, because only the children are embedded; the parents are stored as plain text.
When should I not use parent-child chunking?
Skip it for flat prose with no real sections, for uniformly short factual questions, or when you cannot build the expansion step in the retriever. A tuned recursive splitter is the better choice in those cases.







