Skip to main content
Chunking divides content into smaller pieces before embedding and storing in a vector database. The strategy you choose affects search quality and retrieval accuracy.

Why Chunking Matters

Consider processing a recipe book with different strategies: The right strategy returns complete, relevant results. The wrong one returns fragments.

Available Strategies

Fixed Size

Split into uniform chunks by character count

Semantic

Split at natural breakpoints based on meaning

Recursive

Split using multiple separators hierarchically

Document

Preserve document structure (sections, pages)

Markdown

Split by heading structure

CSV Row

Each row becomes a chunk

Agentic

AI determines optimal boundaries

Code

Split at function and class boundaries using AST analysis

Custom

Build your own strategy

Using with Readers

Pass a chunking strategy to any reader:

Choosing a Strategy

Each reader has a sensible default, but you can override it based on your content and retrieval needs.

Configuration

Most strategies accept configuration options:

Chunk Size Guidelines

Smaller chunks work better for specific questions. Larger chunks work better when context matters.

Next Steps

Semantic Chunking

Split content by meaning

Fixed Size Chunking

Uniform chunk sizes

Readers

Configure readers with chunking

Search & Retrieval

How chunking affects search