AgenticChunking asks a model to choose each split position within max_chunk_size characters. It uses the size limit when the model call fails or the response cannot be parsed as an integer. Positions above the limit are clamped.
1
Create a Python file
agentic_chunking.py
2
Set up your virtual environment
3
Install dependencies
4
Export your OpenAI API key
5
Run PgVector
6
Run the script
Custom Prompts
custom_prompt is inserted into Agno’s chunking instructions. For the chunker to make progress, the model must return a positive integer.