Skip to content
Docs

Split Text

Split Text cuts a long text into chunks sized for embedding. It reads the previous node’s output, usually Read a File as Text: every document in its documents list is split, and a plain text value is accepted too. It emits a list of chunks that Embed accepts directly. You find it on the node picker’s AI shelf.

Ingest: Read a File as Text → Split Text → Contextualize Chunks (optional) → Embed → Knowledge Base Insert
Read back: Knowledge Base Query (search) or Read Knowledge Base (read whole)

The node has one input handle and one output handle.

  • Recursive (character) is the default: it tries each separator in order (paragraphs, then lines, then words, then characters) and repeats the tail of each chunk at the start of the next, per chunkOverlap. It is structure-blind and will cut through a heading.
  • Markdown (headings) produces one chunk per heading section, cuts over-budget sections on blank lines only, and stamps each chunk’s metadata with its section heading and the document’s frontmatter title, so a RAG answer can cite the section. It ignores chunkOverlap and separators by construction. Use it for anything Read a File as Text produced from a markdown source.

The source document’s metadata is copied onto every chunk. That is how a document’s title, URL, or attachment id survives through Embed to Knowledge Base Insert and into the knowledge base.

The Split Text node's settings form, with the fields described below
The Split Text node's settings form, with the fields described below
FieldTypeDefaultDescription
Chunk size (chunkSize)integer ✦ (required) — Maximum size, in characters, of each text chunk. Around 1600–2000 works best for prose.
Chunk overlap (chunkOverlap)integer ✦ (required) — Number of characters from the end of one chunk to repeat at the start of the next, preserving context across boundaries. Ignored when the strategy is Markdown.
Separators (separators)list (optional) — Ordered list of separators the recursive splitter tries when breaking the text, from coarsest to finest. Ignored when the strategy is Markdown.
Strategy (strategy)one of recursive, markdown ✦ (optional) — How to break the text up: Recursive splits on the separators below, Markdown splits per heading section and tags each chunk with its heading and the document title. Leave empty for Recursive.
Prepend title (prependTitle)boolean ✦ (optional) — Start every chunk with the document’s title, so a chunk taken from the middle still says what it belongs to. Turn it on when the title carries information the body does not repeat — a product name, a model number, an article number. Leave empty to embed the body text alone.

Fields marked ✦ accept expressions.

Try this node — run it once against your own workspace, with your credentials, without building a flow first.

{
"chunks": [
{ "text": "First chunk...", "index": 0, "metadata": { "source_type": "url", "title": "Employee handbook" } },
{ "text": "Second chunk...", "index": 1, "metadata": { "source_type": "url", "title": "Employee handbook" } }
]
}

index records where each chunk sat in its document. It rides through the pipeline into a column of the knowledge base, which is what lets Knowledge Base Query expand a match with its neighbouring chunks later.

The template Rag / SplitText under Automation → Templates wires an Injector holding a paragraph of text into this node with chunkSize 120 and chunkOverlap 20, small values chosen so the split is visible at a glance. For real prose, a chunk size around 1600 to 2000 characters works best with the common embedding models.

  • Turning on prependTitle changes every chunk’s text, so the next ingest re-embeds the whole corpus once. Measure the retrieval gain on your own corpus before leaving it on; it wins on distinctive titles and loses slightly on generic ones.
  • A document whose metadata carries no title is chunked unchanged even with prependTitle on.