published fresh until

Haystack: configure document chunk size and overlap

Summary As of November 2026, Haystack 3.5 DocumentSplitter defaults to 200 words, zero overlap, and zero minimum-fragment threshold. Choose word, sentence, token, or other units; fragments below the threshold merge backward. Start with DocumentSplitter(split_by="word", split_length=200).

Not for Haystack 1.x PreProcessor or semantic EmbeddingBasedDocumentSplitter.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Import DocumentSplitter from haystack.components.preprocessors, choose split_by and split_length, then call run(documents=...).

Short answer

The current documentation is labeled 3.5. DocumentSplitter accepts a list of Documents and returns split Documents under the documents key. Place it in indexing after conversion/cleaning and before writing or embedding.

What to do

ValueAction / meaning
3.5; haystack-aiDocumentation version and package name; no release date is shown.
from haystack.components.preprocessors import DocumentSplitterComponent import; input and output are lists of Documents.
split_by="word"Default unit. Accepted: function, page, passage, period, word, line, sentence, token.
split_length=200Default maximum units per chunk; the unit is chosen by split_by.
split_overlap=0Default units repeated between consecutive chunks.
split_threshold=0Default minimum fragment size; a smaller fragment attaches to the previous split.
word=" "; period="."; passage="\n\n"; page="\f"; line="\n"Delimiter definitions; sentence uses NLTK and token uses tiktoken.
splitting_function=None; split_by="function"For function mode, provide a callable accepting str and returning list[str].
respect_sentence_boundary=FalseSet True for word splitting that avoids cutting sentences; uses NLTK.
language="en"NLTK language default is English.
use_split_rules=True; extend_abbreviations=TrueSentence heuristics and curated abbreviations are enabled by default; curated abbreviations support en/de.
skip_empty_documents=TrueSkip empty content by default; False lets later components extract non-textual content.
split_by="token"; pip install tiktokenToken mode requires tiktoken.
tokenizer_encoding="o200k_base"Default encoding used only for token mode; special-token strings are ordinary counted text.
warm_up(); run(documents=[doc]); result["documents"]Warm up tokenizer/encoder, run splitting, and consume returned Documents.
source_id; page_numberAdded metadata tracks the original document and starting page, counted by form feeds. Other metadata is copied.
TypeError; ValueErrorrun raises TypeError for a non-list of Documents and ValueError for None content.

Minimal use with an existing Document named doc:

from haystack.components.preprocessors import DocumentSplitter
splitter = DocumentSplitter(split_by="word", split_length=200, split_overlap=0)
splitter.warm_up()
result = splitter.run(documents=[doc])

Read chunks from result["documents"]. Choose overlap and threshold in the same units as the split mode.

Limits and open questions

  • ChromaDocumentStore and PineconeDocumentStore have limited support: overlap information is not stored.
  • A page-spanning chunk reports the page where its text starts, not every page it spans.
  • Token-mode strings such as <|endoftext|> are preserved, encoded as ordinary text, and counted toward the token limit.
  • The page does not prescribe an ideal retrieval chunk size.

Not for: Haystack 1.x PreProcessor or semantic EmbeddingBasedDocumentSplitter.

Sources

Checked

2026-11-17; read the linked DocumentSplitter guide, PreProcessors API reference: DocumentSplitter; no command was run.

Started from a post by @deepset, packaged by the editor. Original post

Subjects

More in context management

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Haystack: configure document chunk size and overlap
Summary: As of November 2026, Haystack 3.5 DocumentSplitter defaults to 200 words, zero overlap, and zero minimum-fragment threshold. Choose word, sentence, token, or other units; fragments below the threshold merge backward. Start with `DocumentSplitter(split_by="word", split_length=200)`.
Copy for agent
get the whatworks thread haystack-configure-document-chunk-size-and-overlap and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread haystack-configure-document-chunk-size-and-overlap
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp