# Chunking

> Canonical: https://skillalmanac.com/glossary/chunking | Last verified: 2026-11-24 | Index status: not offered to search engines

Chunking is splitting a long document into smaller pieces, called chunks, so each piece can be embedded, searched and placed in a prompt on its own, most often in retrieval systems such as RAG.

Also called: chunking strategy, chunking rag, text chunking, document chunking, chunk size.

## In plain language

A language model search system cannot work well with a 200-page document as one block, so the document is cut into smaller pieces first. Chunking is deciding where to cut. Cut badly and a sentence like 'Revenue grew' ends up without the company or the year it belongs to, so a search for the right passage may miss it. Cut well and each piece makes sense by itself. There is no single right size, so the usual approach is to try a few settings and test them on questions whose answers you already know. Smaller pieces mean more of them to store and search.

## Technical definition

In a RAG indexing phase, documents are split into chunks, each chunk is embedded as a vector and stored with source metadata. Pinecone's chunking guide describes fixed-size, content-aware (sentence or paragraph), document-structure, semantic and LLM-based contextual chunking, and chunk expansion that fetches neighbouring chunks after a search. Anthropic's contextual retrieval post says chunk size, boundaries and overlap can affect retrieval performance, and prepends generated context to each chunk before embedding. Chunks also need to respect the embedding model's input limit.

## How it shows up when you use agents

Chunking happens before any question is asked. When you build a [RAG](/glossary/retrieval-augmented-generation) pipeline over manuals, tickets or contracts, the indexing step splits each document into chunks and stores an [embedding](/glossary/embedding) for each. Later, the search can only return whole chunks. If the answer is split across two chunks, or a chunk lacks the context that names what it is about, retrieval may miss it and the model may guess.

What breaks when it is misunderstood: people rewrite the prompt when answers are wrong, though the fault is in how the text was cut. Another habit is picking one chunk size from a blog post and not testing it on their own documents.

Next action: for a failing question, look at which chunks were retrieved. The [What is RAG](/learn/what-is-rag) guide recommends this, and suggests fixing chunking before touching the prompt. Then try two or three strategies, for example fixed size, splitting on headings, and adding a context line to each chunk, and compare them on questions with known answers. [rag-chunking-planner](/skills/skill-almanac/rag-chunking-planner) does this comparison with measured recall. Remember that retrieved chunks must fit the [context window](/glossary/context-window).

## Common confusions

- **Chunking versus tokenization.** Chunking cuts a document into passages. A [tokenizer](/glossary/tokenizer) cuts text into the small units a model reads. Chunk size is often measured in tokens, which is where the two meet.
- **Chunking versus context window.** The context window limits what the model can read in one request. Chunks are what you choose to put into it.
- **Chunking versus reranking.** Chunking happens at indexing time. [Reranking](/glossary/reranking) reorders candidates at query time.
- **Myth.** Smaller chunks retrieve better. Very small pieces can lose the context needed to match a question, and the right size has to be tested on your own documents.

## Worked examples in this catalogue

### [rag-chunking-planner](https://skillalmanac.com/skills/skill-almanac/rag-chunking-planner)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Your documents chunked by three strategies, with defects and offline recall measured for each, so chunk settings are chosen with numbers.

Why it exercises the concept: It is the direct way to compare chunking strategies on your own documents instead of picking a size by habit.

### [What Is RAG? Retrieval-Augmented Generation Explained](https://skillalmanac.com/learn/what-is-rag)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A worked chunking example in which a stored sentence loses the company and quarter it belongs to, plus pitfalls on chunks that are too small or too large.

Why it exercises the concept: It shows why where you cut changes what a search can find, and why the guide suggests comparing a few sizes on one question set.

### [voiceover-script-prep](https://skillalmanac.com/skills/skill-almanac/voiceover-script-prep)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A written script turned into spoken form, chunked under your tool's limit, with an estimate of its length.

Why it exercises the concept: A different use of the same idea: splitting text to fit a tool's input limit while keeping each piece usable on its own.

## Related terms

- [Retrieval-augmented generation (RAG)](https://skillalmanac.com/glossary/retrieval-augmented-generation.md)
- [Embedding](https://skillalmanac.com/glossary/embedding.md)
- [Reranking](https://skillalmanac.com/glossary/reranking.md)
- [Context window](https://skillalmanac.com/glossary/context-window.md)
- [Token](https://skillalmanac.com/glossary/token.md)
- [Vector database](https://skillalmanac.com/glossary/vector-database.md)

## Sources

- [Introducing Contextual Retrieval](https://www.anthropic.com/news/contextual-retrieval), Anthropic (accessed 2026-11-24)
- [Chunking Strategies for LLM Applications](https://www.pinecone.io/learn/chunking-strategies/), Pinecone (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
