Chunking
Chunking is the process of splitting documentation into small, self-contained passages before indexing, so a retrieval system can find and return the exact section that answers a question.
Chunking decides what a retrieval system can find. When docs are indexed for search or a chatbot, each page is split into chunks, each chunk is embedded, and questions are matched against chunks, not pages. A chunk that mixes three topics matches none of them well.
Good chunking follows the document's own structure: headings, sections, and paragraphs. That is why docs writing conventions like one idea per section and descriptive headings directly improve AI answer quality; they produce chunks that stand alone.
Chunk size is a trade-off. Chunks that are too small lose necessary context, such as which product version a step applies to; chunks that are too large dilute the embedding and waste the model's context budget.
Frequently asked questions
How big should a chunk be?
Start with sections that answer one question and keep the supporting context together. The best size depends on your content and retrieval system, so test it with real reader questions.
Can I influence how my docs are chunked?
Yes. Use clear headings, make sections understandable on their own, and put the answer near the heading. The retrieval system still determines the final split.