RAGIntermediate

Choosing a chunking strategy

“How do you choose a chunking strategy for a RAG system, and how do you know it is working?”

What this tests

  • Understanding that chunks are retrieval units and must be self-contained
  • Knowledge of fixed, recursive, semantic, and structure-aware chunking
  • Awareness of overlap, metadata, and parent-child strategies
  • Measuring instead of guessing chunk size

Answers by level

Read the beginner answer first and notice what is missing.

A chunk is the unit that gets embedded, retrieved, and shown to the model, so it must be self-contained enough to be understood alone and specific enough to be matched precisely. Fixed-size splitting ignores document structure and cuts tables, lists, and definitions in half. I start from structure: split on headings and paragraphs, keep tables intact, keep code blocks intact, and only then apply a size cap with recursive splitting. See Ingestion: Parsing & Chunking.

Each chunk carries metadata (document, section path, version, date) and often a prefix with the section title so an isolated chunk still says what it is about. For long-form content I use parent-child: embed small chunks for precise matching, return the parent section for generation. Overlap of 10–20% helps with boundary sentences but does not fix bad boundaries.

It is working if retrieval evals say so: build a golden set of questions with the passage that answers them, then measure recall@k and chunk-contains-answer rate across chunk sizes and strategies. The right size depends on the corpus and the question style; 200 tokens for FAQ-like content, larger for narrative reasoning. See RAG Evaluation.

Green flags · Red flags

Green flags
  • Structure-aware splitting before size caps; keeps tables and code intact
  • Adds metadata and section-title prefixes to chunks
  • Knows parent-child / small-to-big retrieval
  • Measures recall@k and chunk-contains-answer on a golden set
  • Checks parsing quality first
  • Considers whole-document or section retrieval for small corpora
Red flags
  • Picks a fixed token size with no justification
  • No mention of evaluation
  • Ignores document structure and parsing
  • Believes overlap fixes boundary problems

Follow-up questions

F1
Questions often need a table plus the paragraph explaining it. What changes?
F2
How does chunk size affect embeddings?

Practical scenario

You inherit a RAG system over 10,000 engineering runbooks chunked at a fixed 1,000 tokens. Users complain that step-by-step procedures come back with steps missing or from the wrong runbook. Describe how you would diagnose the chunking, what alternative you would try, and the eval you would run before re-indexing everything.

Related concepts · Learn this topic