---
title: "Late chunking"
sidebarTitle: "Late Chunking"
description: "Retrieve whole documents first, chunk them afterwards."
---
Inverts the usual order: documents are retrieved first and chunked just before
synthesis. Chunking late preserves context that pre-chunking discards, since a
chunk is cut with knowledge of the query it is answering.
This example is a runnable notebook in the
[vectordb-recipes](https://github.com/lancedb/vectordb-recipes) repository rather than a page here.
Run it end to end in the browser.
Read the source.