Agent skill · Code Review & Quality

hyde-retrieval

HyDE (Hypothetical Document Embeddings) for improved semantic retrieval. Use when queries don't match document vocabulary, retrieval quality is poor, or implementing advanced RAG patterns.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill hyde-retrieval --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 5 KB
Bundled scripts: none
Version: 1.0.0
Declared author: SkillForge
Path: skills/ai-llm/hyde-retrieval/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# HyDE (Hypothetical Document Embeddings) Generate hypothetical answer documents to bridge vocabulary gaps in semantic search. ## The Problem Direct query embedding often fails due to vocabulary mismatch: ``` Query: "scaling async data pipelines" Docs use: "event-driven messaging", "Apache Kafka", "message brokers" → Low similarity scores despite high relevance ``` ## The Solution Instead of embedding the query, generate a hypothetical answer document: ``` Query: "scaling async data pipelines" → LLM generates: "To scale asynchronous data pipelines, use event-driven messaging with Apache Kafka. Message brokers provide backpressure..." → Embed the hypothetical document → Now matches docs using similar terminology ``` ## Implementation ```python from openai import AsyncOpenAI from pydantic import BaseModel, Field class HyDEResult(BaseModel): """Result of HyDE generation.""" original_query: str hypothetical_doc: str embedding: list[float] async def generate_hyde( query: str, llm: AsyncOpenAI, embed_fn: callable, max_tokens: int = 150, ) -> HyDEResult: """Generate hypothetical document and embed it.""" # Generate hypothetical answer response = await llm.chat.completions.create( model="g

What's inside
Steps it walks through
  1. The Problem
  2. The Solution
  3. Implementation
  4. With Caching
  5. Per-Concept HyDE (Advanced)
  6. Overview
  7. Fallback Strategy
  8. Performance Tips
  9. Related Skills
  10. Key Decisions
  11. References
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the hyde-retrieval skill do?

HyDE (Hypothetical Document Embeddings) for improved semantic retrieval. Use when queries don't match document vocabulary, retrieval quality is poor, or implementing advanced RAG patterns.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill hyde-retrieval --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going