# Tailor document segmentation with custom prompt support on AgenticChunking

> AgenticChunking now accepts a custom_prompt parameter, letting you override the default model-driven chunking instructions with domain-specific logic.

- Published: 2026-03-26
- Author: Agno Team
- Category: Changelog
- Canonical: https://agno-com-nine.vercel.app/articles/tailor-document-segmentation-with-custom-prompt-support-on-agenticchunking
- Markdown: https://agno-com-nine.vercel.app/articles/tailor-document-segmentation-with-custom-prompt-support-on-agenticchunking.md

`AgenticChunking` now accepts a `custom_prompt` parameter, letting you override the default model-driven chunking instructions with domain-specific logic. Rather than relying solely on the built-in heuristics for finding semantic breakpoints, you can now describe exactly how the model should segment your documents — for example, splitting at major section boundaries, preserving clause integrity, or separating structured metadata from body content — making it straightforward to tune retrieval quality for specialized corpora.

Details**:**

- Pass any string to `custom_prompt` to override the default chunking behavior; custom prompts are prioritized over built-in instructions
- The default output format constraints are still enforced automatically — `custom_prompt` only needs to describe the chunking logic itself
- Always pair `custom_prompt` with `max_chunk_size` to bound output length; the default `max_chunk_size` is 5000 characters
- The `model` parameter accepts any Agno-compatible model, allowing you to route chunking to a smaller or cheaper model independently of your agent

See the [Custom Prompts docs](https://docs.agno.com/knowledge/concepts/chunking/agentic-chunking#custom-prompts) for more.
