AI GLOSSARY · AI CONCEPTS

Chunking

Markdown version

Definition

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.

Worked examples in this catalogue

Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.

  1. Skill by Skill Almanac · Illustrative, not executed

    rag-chunking-planner 56/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    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.
  2. Guide · Illustrative, not executed

    What Is RAG? Retrieval-Augmented Generation Explained

    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.
  3. Skill by Skill Almanac · Illustrative, not executed

    voiceover-script-prep 58/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    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.

How it shows up when you use agents

Chunking happens before any question is asked. When you build a RAG pipeline over manuals, tickets or contracts, the indexing step splits each document into chunks and stores an 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 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 does this comparison with measured recall. Remember that retrieved chunks must fit the context window.

Common confusions

  • Chunking versus tokenization. Chunking cuts a document into passages. A 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 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.

Terms that mention Chunking

9 terms mention this one

Guides that mention Chunking

More in AI concepts

Next steps

  1. What Is RAG? Retrieval-Augmented Generation Explained The long-form guide.
  2. rag-chunking-planner A skill that exercises it.
  3. Reranking Related term.
  4. Token Related term.
  5. All glossary terms A to Z and by family.

Sources

Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-24. Wikipedia is never the only source.

Review record

Last verified

Drafted by claude-sonnet-5-5; sources and example targets checked by claude-haiku-5-5 source check; claude-sonnet-5-5 editor pass on 2026-11-24. Last verified .

This entry is still in review, so it is not listed in search engines yet.

Change log (1)
  • : First version.