nœuds / builtin / ai / aidependencies / textsplitter
Character Text Splitter
Breaks down text into smaller parts.
Ce contenu n’est pas encore disponible dans votre langue.
Tell the Indexer how to cut long text into chunks at one separator of your choice.
What it does
Section titled “What it does”Character Text Splitter is not a step on its own: it has no output port and never runs by itself. You plug it into the Text Splitter slot of the Indexer, which uses it to cut its Input into chunks before saving them to a knowledge base.
It cuts the text wherever Separator appears, then joins the pieces back up into chunks of at most about Chunk Size characters, repeating Chunk Overlap characters between neighbouring chunks. When Separator is empty, it splits at spaces, so chunks break between words.
A single piece longer than Chunk Size (no separator inside it) is kept whole, as a chunk larger than the limit.
When to use it
Section titled “When to use it”- Your text has a clear marker between entries, such as
---between notes or;between records. - You want simple, predictable chunks of a fixed size, cut between words.
- For prose, Markdown or code, Recursive Character Text Splitter usually gives better chunks.
Inputs and settings
Section titled “Inputs and settings”| Réglage | Type | Ce que cela fait |
|---|---|---|
| Chunk Size | Number | The size of each chunk. Par défaut : 1000 |
| Separator | Text | The separator to use. |
| Chunk Overlap | Number | The overlap between chunks. Par défaut : 200 |
- Chunk Size and Chunk Overlap count characters. Keep the overlap smaller than the chunk size. A value of
0in either field is replaced by its default (1000 and 200). - Separator is matched as plain text, not as a pattern. It is removed from the chunks.
Outputs
Section titled “Outputs”This node has no output port. It plugs into a slot on another node instead of passing items along.
- Text Splitter slot of Indexer
The chunks are counted in the Indexer’s output (chunks) and stored in the knowledge base connected to it.
Dependencies and credentials
Section titled “Dependencies and credentials”None. This node needs no connection and has no slots for other nodes.
Example workflow
Section titled “Example workflow”- Local File Read with Read as
Textand Accepted file types.txtopens a text file of meeting notes separated by---. - Indexer with Input
{{ $input.content }}and Source name{{ $input.name }}. Connect Local Knowledge to its Knowledge slot. - Character Text Splitter connected to the Indexer’s Text Splitter slot, with Separator
---, Chunk Size1500and Chunk Overlap1.
Each note becomes its own chunk unless notes are short enough to be joined.
Common issues
Section titled “Common issues”- “Cannot have chunkOverlap >= chunkSize”. Chunk Overlap is as large as Chunk Size or larger. Lower the overlap.
- Chunks are much bigger than Chunk Size. The separator does not appear in the text, so nothing was cut. Check Separator, or leave it empty to split at spaces.
- You cannot turn overlap off.
0falls back to 200. Use1for almost no overlap.
Related nodes
Section titled “Related nodes”- Indexer: the node this splitter plugs into.
- Recursive Character Text Splitter: tries several separators, better for prose.
- Local Knowledge: the knowledge base the chunks go to.