Skip to main content
Addresses the “lost in the middle” problem in retrieval. An LLM generates a succinct piece of context for each document chunk, which is prepended to the chunk before embedding, so a chunk carries enough surrounding meaning to be retrieved for the right queries.
This example is a runnable notebook in the vectordb-recipes repository rather than a page here.

Open in Colab

Run it end to end in the browser.

View on GitHub

Read the source.