Agentic chunking is an intelligent method of splitting documents into smaller chunks by using a model to determine natural breakpoints in the text. Rather than splitting text at fixed character counts, it analyzes the content to find semantically meaningful boundaries like paragraph breaks and topic transitions.
Set up your virtual environment
Custom Prompts
Custom prompts override default chunking behavior and are prioritized over default instructions.
Best Practices:
- Always set
max_chunk_size when using custom_prompt.
- Focus
custom_prompt on chunking logic only.
- The default instructions automatically handle the output format constraints.
See Agentic Chunking with Custom Prompt for a complete example.
Agentic Chunking Params