--- title: "HyDE: hypothetical document embeddings" sidebarTitle: "HyDE" description: "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. 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.