203 words, 2 min read

8 Chunking strategies for RAG-based agents

  1. Fixed-Size: cuts text every fixed number of tokens, with a small overlap.
  2. Recursive: splits on paragraphs first, falling back to lines then words and characters only when a piece is still too big.
  3. Document-Based: splits wherever the document already marks a break, a heading, a chapter, an HTML tag, so a markdown file becomes one chunk per section on its own.
  4. Semantic: embeds each sentence, checks its similarity to the one before it, and starts a new chunk when that similarity drops. This finds real topic shifts instead of guessing by length.
  5. LLM-Based: asks an LLM to rewrite the text as standalone propositions, one idea per line, and turns each into a chunk, high quality but expensive across a large corpus.
  6. Agentic: an AI agent reads each document, decides what it is (code, contract, table), and picks the chunking method for that file instead of one rule for everything.
  7. Late Chunking: runs the full document through an embedding model, then applies normal split boundaries and mean-pools within each boundary to create chunk embeddings.
  8. Hierarchical: breaks the document into layers, sections, paragraphs, then sentences

Courtesy of the ByteByteGo newsletter.