AskReference
ExplanationIntermediate

What is the purpose of the Chunk Overlap parameter in the Split Text component, and what value is set in the example?

The Chunk Overlap parameter sets how many characters are shared between consecutive chunks so that important context at chunk boundaries is not lost. In the example, it is set to 150.

When text is split into chunks, each chunk can end or begin mid-sentence or mid-idea. Chunk Overlap duplicates a portion of the text at the end of one chunk and the beginning of the next, preserving context that might otherwise be separated. For example, if one chunk ends with “...the price of the Margherita pizza is” and the next starts with “$14...”, overlap keeps the connection between the item and its price. In the exercise, the author sets Chunk Overlap to 150 characters.

Key points

  • Chunk Overlap is measured in characters.
  • It intentionally duplicates text between adjacent chunks.
  • Its purpose is to avoid losing important context at chunk boundaries.
  • The value set in the example is 150.
Source:AI Agents and Applications· Building your first GenAI app· p. 102–110

Related questions

Cover of AI Agents and Applications

AI Agents and Applications

Andrea De Mauro

MEAP Edition Version 7 · Manning Publications

View this ebook