Chunking

Chunking splits large documents into smaller passages before they are embedded and indexed for retrieval. Because embeddings and context windows work best over focused units, chunk size and boundaries strongly affect retrieval quality: chunks must be small enough to be specific yet large enough to stay self-contained.

Definition

Chunking

In a retrieval pipeline, whole documents are usually too large to embed usefully or to fit alongside a prompt, so they are divided into chunks. Each chunk is embedded and stored separately, and retrieval returns the most relevant chunks rather than entire files. The strategy — fixed size, sentence or paragraph boundaries, or overlapping windows — shapes what the retriever can find.

Poor chunking hurts RAG: chunks that are too big dilute relevance and waste context, while chunks that are too small lose the surrounding meaning needed to answer. Overlap and structure-aware splitting help preserve coherence across chunk boundaries.

Frequently asked questions

What is Chunking?

Chunking splits large documents into smaller passages before they are embedded and indexed for retrieval. Because embeddings and context windows work best over focused units, chunk size and boundaries strongly affect retrieval quality: chunks must be small enough to be specific yet large enough to stay self-contained.

Sources

Related terms

← Full AI & prompt engineering glossary

Put Chunking to work with Prompeteer, the Agentic Contextual AI Platform →