---
title: "HyDE (Hypothetical Document Embedding) · agent retrieval pattern · Agent Fieldbook"
url: https://agentfieldbook.org/memory/retrieval/hyde/
description: "Generate a hypothetical answer to the query, embed that, and search by similarity to the answer: surfaces matches that direct-query embedding misses."
section: "Memory · Retrieval"
source: Agent Fieldbook — generated from the published page
---

# HyDE (Hypothetical Document Embedding)

Generate a hypothetical answer to the query, embed that, and search by similarity to the answer: surfaces matches that direct-query embedding misses.

Verified against [arxiv.org](https://arxiv.org/abs/2212.10496)

- [arxiv.org](https://arxiv.org/abs/2212.10496)

## How it works

## At a glance

| Field | Value |
| --- | --- |
| Stage | Retrieval |
| Phase | Read |
| Used by | Cloudflare Agent Memory· RAG pipelines |

## Trade-off

Adds an LLM generation step; a wrong hypothetical can pull off-topic results.

## Basis

## Verified against

- [https://arxiv.org/abs/2212.10496](https://arxiv.org/abs/2212.10496)

The corpus does not rewrite vendor documentation. Where copy is quoted verbatim it is marked as such and attributed to its source.
