Skip to main content
An LLM writes a hypothetical document answering the query, and that document, not the query, is embedded and used for retrieval. It works because a plausible answer sits nearer the real answers in embedding space than a question does.
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.