Chunking

Chunking splits documents into pieces of suitable size before computing their embeddings for a RAG. Size and overlap affect precision: too large, a chunk dilutes information; too small, it loses its context. Structure (headings, paragraphs) is respected where possible.

Example

splitter = RecursiveCharacterTextSplitter(chunk_size=800, chunk_overlap=100)

Related concepts

The whole glossary