chunk_for_rag
Split documents into RAG-ready chunks with Docling's HybridChunker. Produces token-aware segments with page, headings, and type info for accurate retrieval.
Instructions
Chunk a document for RAG using docling's HybridChunker.
Returns list of {text, index, page, headings, chunk_type, token_count}.
Args: source: Local path / URL / data URI. chunk_size: Target max tokens per chunk. overlap: Overlap tokens between adjacent chunks. tokenizer: HuggingFace tokenizer name. Defaults to BGE-small (English). Use a multilingual tokenizer (e.g. "bert-base-multilingual-cased") for non-English docs. ocr_languages: Override default OCR languages.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | ||
| overlap | No | ||
| tokenizer | No | BAAI/bge-small-en-v1.5 | |
| chunk_size | No | ||
| ocr_languages | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |