> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lancedb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Late chunking

> 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.

> [!NOTE]
>
> This example is a runnable notebook in the
> [vectordb-recipes](https://github.com/lancedb/vectordb-recipes) repository rather than a page here.

> [card] [Open in Colab](https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Advanced_RAG_Late_Chunking/Late_Chunking_\(Chunked_Pooling\).ipynb)
>
> Run it end to end in the browser.

> [card] [View on GitHub](https://github.com/lancedb/vectordb-recipes/tree/main/examples/Advanced_RAG_Late_Chunking)
>
> Read the source.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.