Skip to main content
Not sure which chunker to use? This guide helps you pick the right one based on your use case, performance needs, and content type.

Quick Recommendations

Building a RAG chatbot?

Use RecursiveChunker for general-purpose document chunking, or SemanticChunker if you need high topical coherence.

Processing source code?

Use CodeChunker — it understands AST structure and keeps functions/classes intact.

Need maximum throughput?

Use FastChunker — SIMD-accelerated, processes 100+ GB/s at the byte level.

Working with tabular data?

Use TableChunker — preserves headers and splits by rows.

Decision Guide

Ask yourself these questions in order:
  1. Are you chunking source code? → Use CodeChunker
  2. Are you chunking tables? → Use TableChunker
  3. Is raw throughput your top priority? → Use FastChunker
  4. Do you need chunks grouped by topic?
  5. Are simple sentence-boundary splits enough? → Use SentenceChunker
  6. None of the above? → Use RecursiveChunker (best default)

Comparison Table

When to Use Each

1

You just need it to work

Start with RecursiveChunker. It’s the best general-purpose option — fast, no heavy dependencies beyond a tokenizer, handles most document types well.
2

You need high-quality semantic chunks

Use SemanticChunker if you have an embedding model available. It groups sentences by meaning, so each chunk stays on-topic.
3

You're processing code

Use CodeChunker — it parses the AST so your chunks respect function/class boundaries instead of cutting mid-statement.
4

You need raw speed above all else

Use FastChunker for pipelines where throughput matters more than chunk boundary quality. It uses SIMD instructions for 100+ GB/s processing.
5

You want the absolute best quality

Use SlumberChunker with a generative model. It’s the slowest and most expensive, but produces the highest-quality chunks by using an LLM to decide boundaries.

F.A.Q.

Yes. All chunkers share the same interface (chunk(), chunk_batch(), async variants). Swap one for another and everything downstream stays the same.
SemanticChunker if you already have an embedding model in your pipeline (reuse it). NeuralChunker if you don’t — it uses a small BERT model specifically trained for topic segmentation, so it doesn’t require a separate embedding setup.
It depends on your tolerance for imperfect boundaries. FastChunker splits on byte counts, which can cut mid-word or mid-sentence. For RAG where retrieval quality matters, prefer RecursiveChunker or SemanticChunker. Use FastChunker when you need to process terabytes quickly and can tolerate rough boundaries.
LateChunker implements the “Late Chunking” algorithm which produces embeddings with better recall for retrieval tasks. Use it when retrieval accuracy is your top priority and you can afford the extra compute.