# Hyde Hypothetical Document Embeddings

> Generates hypothetical answer passages using an LLM to dramatically improve zero-shot dense vector retrieval. Use when user queries are short, ambiguous, or que

- Skill: `bishnucd/hyde-hypothetical-document-embeddings` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx get-skill add bishnucd/hyde-hypothetical-document-embeddings`
- Raw SKILL.md: https://api.skillmd.com/api/skills/bishnucd/hyde-hypothetical-document-embeddings/raw
- Safety review: pending
- Works with: any agent that reads SKILL.md (Claude Code, Claude.ai, Cursor, Codex, Windsurf, 60+ more)
- Category: Coding & Dev Tools
- Author: Bishnucd (https://skillmd.com/u/bishnucd)
- Updated: 2026-12-03
- Page: https://skillmd.com/skills/bishnucd/hyde-hypothetical-document-embeddings

---

---
name: hyde-hypothetical-document-embeddings
description: Generates hypothetical answer passages using an LLM to dramatically improve zero-shot dense vector retrieval. Use when user queries are short, ambiguous, or question-phrased.
license: MIT
metadata:
  author: Community List Maintainers
  version: "1.0.0"
  source: "https://arxiv.org/abs/2212.10496"
---
# Hyde Hypothetical Document Embeddings

## Overview
Short questions often lack semantic overlap with long, detailed document passages. HyDE prompts an LLM to hallucinate a hypothetical answer, embedding that passage to retrieve actual matching documents.

## Operational Workflow

1. **Instruct an LLM with zero-shot prompt**:
   - Instruct an LLM with zero-shot prompt: "Write a passage that answers the following question: {query}".

2. **Encode the generated hypothetical document into a dense semantic embedding vector.**:
   - Encode the generated hypothetical document into a dense semantic embedding vector.

3. **Query vector database using the hypothetical document embedding as the search probe.**:
   - Query vector database using the hypothetical document embedding as the search probe.

4. **Feed the retrieved real, fact-checked passages to the final generator LLM.**:
   - Feed the retrieved real, fact-checked passages to the final generator LLM.

## Recommended Tools & Environments
- HyDE
- Dense Retrieval
- Query Expansion
- LangChain / LlamaIndex

## Verification & Execution Criteria
- Pre-execution validation verifies all prerequisites and inputs.
- Step-by-step progress logging confirms intermediate state transitions.
- Post-execution checks verify output integrity and clean exit codes.

