Skip to main content
Type: chunk Subtype: chunk_by_contextual

Usage guidance

Contextual chunking is a post-chunk enrichment step, not a chunking strategy. The chunk_by_contextual node does not split or combine elements. It takes the chunks an upstream chunker already produced and prepends a short, LLM-generated context summary to each chunk’s text. Chunk count, chunk order, and element IDs are preserved. Add chunk_by_contextual as a second chunker node, placed after a text chunker (such as chunk_by_character, chunk_by_page, chunk_by_similarity, or chunk_by_title). The supported workflow chains two chunker nodes:
The node enriches the chunks it receives from the upstream chunker. It does not re-read the source file. Each chunk is sent a window of the surrounding document, sized by context_char_limit. For very large documents, the node estimates total request time and, if this exceeds the internal limit, returns the original elements unchanged. Per-element failures fall back to the original text rather than canceling document processing. For more information, see Contextual chunking.

Settings

contextual_chunking_model
string
required
The model to use, in provider/model format (for example, anthropic/claude-sonnet-4-6). Supported providers: anthropic, openai, custom_openai_compatible, vertexai, bedrock. For available models, see Available models.
context_char_limit
integer
Size of the document window, in characters, given to the LLM for each chunk. A larger window gives each chunk broader document context at higher token cost. Default: 15000.
user_prompt
string
Custom instruction to override the default per-chunk prompt. Default: none.