Documentation Index
Fetch the complete documentation index at: https://docs.upsonic.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Recursive splitter intelligently splits text using a prioritized list of separators. It tries the first separator, and if segments are still too large, recursively applies the next separator. Highly effective for structured text like code and markdown, ensuring logical units stay together. Splitter Class:RecursiveChunker
Config Class: RecursiveChunkingConfig
Dependencies
No additional dependencies required. Uses standard library.Examples
Parameters
| Parameter | Type | Description | Default | Source |
|---|---|---|---|---|
chunk_size | int | Target size of each chunk | 1024 | Base |
chunk_overlap | int | Overlapping units between chunks | 200 | Base |
min_chunk_size | int | None | Minimum size for a chunk | None | Base |
length_function | Callable[[str], int] | Function to measure text length | len | Base |
strip_whitespace | bool | Strip leading/trailing whitespace | False | Base |
separators | list[str] | Prioritized list of separators | ["\n\n", "\n", ". ", "? ", "! ", " ", ""] | Specific |
keep_separator | bool | Keep separator in chunks | True | Specific |
is_separator_regex | bool | Treat separators as regex patterns | False | Specific |

