What is parent-child chunking?
Parent-child chunking is a RAG chunking pattern where the same document is represented at two related levels:
- Parent chunks contain larger sections of text.
- Child chunks contain smaller pieces taken from those parent sections.
The child chunks are usually used for precise retrieval, while the larger parent chunks are used to provide richer context to the language model.
Simple example
Suppose a document contains a section about authentication.
Parent chunk
Authentication
├─ Child 1: API key authentication
├─ Child 2: Access token authentication
└─ Child 3: Refresh token behaviorThe parent contains the broader section, while each child focuses on a smaller topic.
Why use two levels?
Small chunks are often easier to retrieve accurately because they contain less unrelated text.
But a very small chunk may not contain enough surrounding information for generation.
Parent-child chunking separates these two needs:
Small child → retrieval precision
Large parent → generation contextWhat is stored?
A parent-child setup usually keeps a relationship between the two levels.
For example:
parent_id: P12
child_id: C47The child record may also store metadata such as:
- Document ID
- Section heading
- Page number
- Parent ID
- Source information
This allows the retrieval system to find the larger parent after a child has matched the query.
What gets embedded?
A common design is to embed and index the smaller child chunks because they provide fine-grained retrieval.
The larger parent chunks may be stored separately and retrieved through their parent IDs rather than searched directly.
Other implementations may index both levels, but the defining idea is the relationship between smaller children and larger parents.
Example query
Imagine the user asks:
How long is an access token valid?A small child chunk about access-token expiration may match very closely.
The RAG system can then use its parent_id to recover the larger authentication section before sending context to the generator.
How is this different from ordinary chunking?
Ordinary flat chunking usually stores each chunk independently.
Chunk 1
Chunk 2
Chunk 3Parent-child chunking preserves relationships:
Parent A
├─ Child A1
├─ Child A2
└─ Child A3This lets retrieval stay fine-grained without losing access to broader context.
Parent-child chunking and hierarchical chunking
Parent-child chunking is a simple form of hierarchical organization.
It typically focuses on two levels: parent and child.
Hierarchical chunking can extend the idea to several levels such as document → section → subsection → paragraph.
When is parent-child chunking useful?
It is especially useful for:
- Long technical documentation
- Manuals
- Policies
- Legal documents
- Reports
- Knowledge bases with large structured sections
It is most valuable when small chunks improve retrieval but larger surrounding sections improve answer quality.
In short, parent-child chunking combines small retrieval units with larger context units. The child helps the system find the right passage, while the parent provides the broader information needed for a grounded answer.
Learning Sequence
Retrieval-Augmented Generation Curriculum
Explore Related Questions
Deepen your understanding across related Retrieval-Augmented Generation topics.