Chunking Parameterspublic
Validated on 11 Dec 2025 • Last edited on 17 Dec 2025
DigitalOcean Gradient™ AI Platform lets you build fully-managed AI agents with knowledge bases for retrieval-augmented generation, multi-agent routing, guardrails, and more, or use serverless inference to make direct requests to popular foundation models.
Chunking divides documents into smaller units for indexing and retrieval. This reference describes the parameters that control chunk size, structure, and behavior across all chunking strategies, and explains how these parameters interact with the selected embedding model.
For guidance on choosing a strategy, see Chunking Strategy Best Practices.
Parameters
The following parameters determine how each chunking strategy divides and structures your documents. All parameters must remain within the embedding model’s token limits.
| Parameter | Applies To | Definition | Recommendation |
|---|---|---|---|
max_chunk_size |
Section-Based, Semantic, Fixed-Length | Maximum number of tokens per chunk. Minimum is 100; maximum depends on the embedding model. For fixed-length chunking, this value is the exact split size. |
Section-Based: 800 for stable, readable chunks. Fixed-Length: 500 for predictable cost and performance. Semantic: 700 for balanced semantic precision and manageable chunk count. |
semantic_threshold |
Semantic | Sensitivity to semantic shifts (ranges from 0.0 to 1.0). Lower values allow more variation and produce fewer chunks. Higher values enforce stricter similarity and may split sentences. |
0.5 balances chunk quantity with meaningful semantic grouping. |
parent_chunk_size |
Hierarchical | Token size of parent chunks, used to provide broad context. Must be larger than the child chunk size. |
1500 for wide context windows without excessive token cost. |
child_chunk_size |
Hierarchical | Token size of child chunks, used for retrieval. Must be smaller than the parent chunk size. |
300 for focused retrieval. Model-specific recommendations: • GTE Large (v1.5): 400 • All-MiniLM-L6-v2: 128 • Multi-QA-mpnet-base-dot-v1: 256 • Qwen3 Embedding 0.6B: 400. |