HyDE
HyDE is a retrieval technique that generates hypothetical document or answer content from a query and uses that content or its embedding to retrieve relevant documents.
Retrieval Augmented Generation, The Foundational Ideas
HyDE (Hypothetical Document Embeddings) is a retrieval technique that generates a hypothetical document or answer and embeds it to improve document retrieval.
- How it is used
- Addresses query–document mismatch in RAG by searching with an imagined answer when a short question fails to retrieve relevant documents.
- How deep it goes
- Explains generation, embedding, and retrieval as a pipeline, then discusses zero-shot applications and failure modes.
- Examples
- Uses internal-document search, Korean-language retrieval, and PubMed-style clinical search to show where a hypothetical document can help.
- What you can do after
- Build it from scratch using an LLM-generated passage and an encoder, then evaluate retrieval errors before trusting downstream answers.
Read how Retrieval Augmented Generation, The Foundational Ideas explains HyDE →
Grokking AI Applications
A query-transformation technique that generates hypothetical answer text and uses its embedding for document retrieval.
- How it is used
- Improves vector similarity retrieval by transforming a user question into synthetic answer text before searching.
- How deep it goes
- Defines HyDE and gives Langflow wiring and a prompt, but stops short of implementation internals or evaluation.
- Examples
- Uses a thirsty customer and drinks menu, plus a Langflow Prompt Template between Chat Input and ChromaDB.
- What you can do after
- Apply it via Langflow by generating answer-like text, then searching the database with that synthetic text.
Also covered in
What to know first
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- retrieval-augmented generationRetrieval-augmented generation is a technique that retrieves relevant information from external sources and supplies it as context to a generative model when producing an output.
- information retrievalInformation retrieval is the process of finding and selecting information relevant to a query or information need from a collection.
- knowledge baseA knowledge base is an organized body or representation of information that people or computational systems can consult to support retrieval, reference, reasoning, or tasks.
Related concepts
- hypothetical documentproduces · A hypothetical document is synthetic text representing the kind of document that could satisfy an information need.
- language modeluses · A language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- query rewritingkind of · Query rewriting is the transformation of a query into an alternative formulation intended to better support its execution or retrieval while preserving its intended meaning or behavior.
- document-to-document similarityimplements · A retrieval comparison that evaluates similarity between a generated document-like passage and candidate documents rather than directly comparing a query with documents.
- DSPyuses · DSPy is a Python framework for declaratively programming, composing, evaluating, and optimizing language-model applications and pipelines.
- semantic gapaddresses · A semantic gap is a difference between intended or represented meaning and the forms or representations through which that meaning is expressed or processed.
Questions about HyDE
What is HyDE?
HyDE is a retrieval technique that generates hypothetical document or answer content from a query and uses that content or its embedding to retrieve relevant documents.
Which Manning books explain HyDE?
Retrieval Augmented Generation, The Foundational Ideas and Grokking AI Applications.
What should I know before learning HyDE?
Manning books that teach HyDE usually introduce language model, retrieval-augmented generation, information retrieval and knowledge base first.
What is HyDE a kind of?
HyDE is a kind of query rewriting. Query rewriting is the transformation of a query into an alternative formulation intended to better support its execution or retrieval while preserving its intended meaning or behavior.
What is HyDE also called?
HyDE is also called Hypothetical Document Embeddings.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

