Unify Logo Footer.svg
Unify Automations
Logo
Chunk Text

Chunk Text

Logo

2 mins READ

Chunk Text splits long text into smaller, retrievable segments — the foundational step for embedding, search, and RAG pipelines. Choose from multiple splitting strategies to match your content type and retrieval goals.

Overview

The Chunk Text operation divides input text into segments that downstream embedding and retrieval systems can process effectively. You select a strategy and, optionally, a chunk size and overlap. Most pipelines start with recursive character, which tries to break on natural boundaries — paragraphs first, then lines, then words — making it the sensible default for prose. The semantic strategy uses an embedding model to group text by meaning; it produces more coherent chunks but is slower and depends on that model being available. Code-aware and syntax-tree strategies handle source code and respect language grammar. Fixed character and token splitting use exact counts. Passthrough disables splitting entirely and returns the text unchanged.

By default chunks have no overlap. Setting an overlap value causes adjacent chunks to share a configurable number of characters or tokens, which reduces missed context at segment boundaries.

chunk-1
chunk-1

Input

Field

Type

Required

Description

Text

string

Yes

The text to split into chunks.

Chunking Strategy

enum

Yes

How to split the text. Options: recursive character (default for prose), fixed charactertokensemanticcode-awaresyntax-treepassthrough.

Chunk Size

integer

No

Maximum characters or tokens per chunk. Applies to all strategies except passthrough.

Overlap

integer

No

Characters or tokens shared between adjacent chunks. Defaults to 0 (no overlap).

Embedding Model

string

Conditional

Required when Chunking Strategy is semantic. The model used to group text by meaning.

chunk-2
chunk-2

Output

Returns an array of text chunks. Each element is a segment of the original text within the configured size limit. When Chunking Strategy is passthrough, the array contains a single element equal to the full input.

Notes

  • Start with recursive character for general prose; switch to semantic when retrieval quality matters more than speed.

  • The semantic strategy calls an embedding model and is slower than the others. Ensure that model is available before using this strategy.

  • The syntax-tree code splitter targets a set of common programming languages and caps each chunk to the configured size.

  • Passthrough returns the full input as a single chunk — useful when you want a consistent pipeline shape without actually splitting.

  • Overlap defaults to 0; increase it if retrieval results are missing context at segment boundaries.

  • Use Chunk Text before an embedding step; chunked text produces vectors that retrieval engines can compare efficiently.

FAQs

Which strategy should I use by default?

Recursive character is the sensible default for documents and prose. Use semantic when you need chunks that are coherent by meaning and can tolerate slower processing. Use code-aware or syntax-tree for source code.

What does overlap do?

Overlap is the number of characters or tokens that repeat between the end of one chunk and the start of the next. An overlap of 100 means the last 100 units of chunk N are also the first 100 units of chunk N+1, reducing missed context at boundaries.

Does passthrough still produce a chunk array?

Yes. Passthrough returns the full text as a single element in the output array, keeping the pipeline shape consistent with all other strategies.