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

# HyDE: hypothetical document embeddings

> Generate a hypothetical answer, then retrieve documents similar to it.

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.

> [!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/Advance-RAG-with-HyDE/main.ipynb)
>
> Run it end to end in the browser.

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


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