Skip to main content
Optimise how documents are split into chunks for better retrieval quality.
The user uploads documents; they are chunked and embedded, and the agent retrieves the best slices for each question.

Two ways to configure chunking

Set the three flat fields, or pass a single chunker={...} dict — the dict wins when both are set.

Strategies

recursive is the default. Set chunking_strategy= to any name below.
Passing an unknown strategy (e.g. "wordwise") now raises a ValueError listing valid presets, instead of silently falling back to recursive.
"fixed" and "paragraph" remain valid names — they now map onto token and recursive respectively. Existing code that used them keeps working.

Best Practices

Technical docs: 500–800 tokens with 50–100 overlap (semantic). FAQs: 200–400 with 20–50 overlap (fixed).
Use 800–1200 token chunks with 100–200 overlap and semantic splitting for narrative content.
Keep code chunks around 300–500 tokens with ~50 overlap; prefer fixed splitting for source files.

Knowledge Base

Build a knowledge base

Knowledge Module

Full API reference