Study
LangChain · Text splitters
Why documents are split into chunks for retrieval, how RecursiveCharacterTextSplitter tries paragraph, then sentence, then word boundaries, and what chunk size and overlap do.
- Chunks need to be small enough to retrieve precisely but large enough to make sense alone.
- The recursive splitter tries the largest natural boundary first (paragraphs) and only falls back to smaller ones when a piece is still too long.