AI agents · OpenClaw · self-hosting · automation

Quick Answer

Best Chunking Libraries for RAG 2026: 6 Compared

Published:

The short answer

Use Chonkie for a standalone chunking step, Docling’s HybridChunker if Docling already parses your documents, and your framework’s splitter if you are deep inside LangChain or LlamaIndex. Chunking decides what your retriever can ever find; a bad split cannot be fixed by a better embedding model or reranker. Versions read from GitHub and PyPI on November 17, 2026:

LibraryLicence / versionChunking strategiesStructure-awareBest for
ChonkieMIT · v1.7.0Token, Fast (SIMD), Sentence, Recursive, Semantic, Late, Code, Table, Neural, Slumber (LLM)Recursive recipes (e.g. Markdown), Code, TableMost new RAG pipelines
Docling HybridChunkerMIT · docling v2.150.1 (Nov 14, 2026)Hierarchical (by document elements) + tokenizer-aware merge/split✅ uses parsed document structurePDFs and Office files parsed with Docling
LangChain text splittersMIT · langchain-text-splitters 1.1.3Recursive character, token, Markdown/HTML header, codeHeader splittersExisting LangChain apps
LlamaIndex node parsersMIT · llama-index-core 0.14.26Sentence, token, semantic, hierarchical, Markdown✅ hierarchical nodesExisting LlamaIndex apps
semchunkMIT · v4.1.1Semantic-boundary recursive splitting to a token limitPartialMinimal dependency, high throughput
UnstructuredApache-2.0 · 0.27.37 (Nov 6, 2026)Basic and by-title chunking of partitioned elements✅ titles and sectionsMany file types in one ETL step

This page is a spoke of our best RAG frameworks guide; for retrieval after chunking, see best hybrid search engines for RAG.

1. Chonkie — best standalone chunker

Chonkie is a focused chunking library (pip install chonkie, MIT, v1.7.0) with the widest menu: TokenChunker, SIMD-accelerated FastChunker, SentenceChunker, RecursiveChunker with recipes such as Markdown, SemanticChunker, LateChunker (embed first, then split), CodeChunker, TableChunker, NeuralChunker and SlumberChunker, which uses an LLM to find boundaries. A Pipeline chains chunkers and refineries — for example recursive Markdown split, then semantic split, then overlap and embeddings — and the default install stays small because extras are opt-in. It can also run as a self-hosted REST API (chonkie serve). The repository moved to the feyninc organisation and had commits on November 17, 2026.

2. Docling HybridChunker — best for parsed documents

If Docling converts your PDFs, DOCX and slides, chunk the DoclingDocument directly instead of exporting Markdown first. HierarchicalChunker creates one chunk per document element (paragraph, list, table) with heading metadata; HybridChunker adds tokenizer awareness — it splits oversized elements and merges small neighbours to fit your embedding model’s tokenizer (Hugging Face or tiktoken). Table header handling is configurable, and a LineBasedTokenChunker keeps code and logs line-intact. contextualize() returns each chunk with its heading path, which is what you should embed. Docling is MIT and shipped v2.150.1 on November 14, 2026.

3. LangChain text splitters — default inside LangChain

langchain-text-splitters (1.1.3) gives you RecursiveCharacterTextSplitter, token splitters, Markdown and HTML header splitters and language-aware code splitters. They are dependable and well documented; the limitation is that they see text, not document structure, unless you split on headers first.

4. LlamaIndex node parsers — default inside LlamaIndex

LlamaIndex (llama-index-core 0.14.26) turns documents into nodes with sentence, token, semantic, Markdown and hierarchical parsers. Hierarchical parsing pairs well with auto-merging retrieval, where small chunks are retrieved and their parent is sent to the model.

5. semchunk — smallest dependency

semchunk (MIT, v4.1.1) splits text at the most semantically meaningful boundary it can find (paragraphs, then sentences, then clauses) until each chunk fits your token limit. One function, any tokenizer, fast. Choose it when you want a better-than-character splitter without adopting a framework.

6. Unstructured — chunk many file types in one step

Unstructured (Apache-2.0) partitions HTML, email, PDF, Office and image files into typed elements, then chunks them basic or by_title, keeping sections together. Use it when ingestion spans many formats and you want one ETL library.

Settings that matter more than the library

  1. Count tokens with your embedding model’s tokenizer, not characters.
  2. Start at 256–512 tokens with 10–15% overlap, then evaluate.
  3. Keep tables whole or chunk by rows with the header repeated.
  4. Embed the heading path with the chunk (Docling contextualize, LlamaIndex metadata).
  5. Evaluate on 30–50 real questions before changing strategy; see how to add a reranker to a RAG pipeline for the next lever.

Last verified: November 17, 2026. Versions from GitHub and PyPI read the same day.

Sources