Text - Recursive Split
Type identifier:
text:recursiveSplitCategory: Text Operations
Description
The Text - Recursive Split node divides text into smaller chunks suitable for processing by language models or other text analysis tools. It splits on natural boundaries (paragraphs, lines, words) where possible, while respecting the configured chunk size. Overlapping between chunks ensures context is preserved across boundaries.
Input Handles
Handle | Type | Description |
|---|---|---|
|
| The text to split into chunks. Content is serialised to text before splitting. |
Output Handles
Handle | Type | Description |
|---|---|---|
|
| Array of text chunks respecting size and overlap constraints. |
Configuration Options
Option | Type | Default | Description |
|---|---|---|---|
Chunk Size |
|
| Maximum size of each chunk in characters. |
Chunk Overlap |
|
| Number of characters to overlap between consecutive chunks. |
Behaviour
- Accepts string or Content input (Content is serialised to plain text)
Recursively splits text using a hierarchy of separators:
- First attempts to split on paragraph breaks (
\n\n) - Falls back to line breaks (
\n) - Then word boundaries (space)
- Finally character-by-character if needed
- First attempts to split on paragraph breaks (
- Merges split segments into chunks respecting the size limit
- Maintains overlap between consecutive chunks for context continuity
- Returns non-empty, trimmed chunks
Splitting Algorithm
The recursive splitter prioritises preserving semantic units:
- Paragraph Split: Tries to keep paragraphs intact
- Line Split: Breaks on line boundaries if paragraphs are too large
- Word Split: Splits at word boundaries for longer lines
- Character Split: Last resort for very long words
Overlap Behaviour
Overlap ensures context continuity:
- The end of chunk N overlaps with the beginning of chunk N+1
- Overlap size cannot exceed chunk size
- Overlap is measured in characters
Examples
Basic Text Chunking
Configuration:
- Chunk Size: 100
- Chunk Overlap: 10
Input:
This is a longer text that needs to be split into chunks.
It has multiple paragraphs.
Each paragraph contains different information.Output (chunks):
[
"This is a longer text that needs to be split into chunks.",
"It has multiple paragraphs.",
"Each paragraph contains different information."
]Document Preparation for LLM
Configuration:
- Chunk Size: 750
- Chunk Overlap: 20
Use case: Preparing a long document for embedding or analysis by an AI model.