Skip to main content
AIDiveForge AIDiveForge
🔄

Query Reformulation Expander

Search & Retrieval · by AIDiveForge · Apr 20, 2026 · Intermediate

Expand a user query into 3-5 rewrites plus a HyDE-style synthetic passage, then aggregate retrieval results for measurably better recall.

🧠 Why it works

Users write short queries; documents are written in long form. Single-query retrieval often misses passages where the vocabulary differs. Expanding the query into multiple phrasings covers more of the document's vocabulary space, and HyDE retrieves by synthesized-answer similarity — which finds passages that actually answer the question rather than ones that merely restate it.

⚙️ How it works

  1. Generate 3 paraphrases of the user query via LLM. 2. Generate one broader and one more-specific variant. 3. Generate a 100-word HyDE passage that pretends to answer the query. 4. Retrieve top-K against each variant and the HyDE passage. 5. Merge via reciprocal rank fusion with a small boost for passages retrieved by multiple variants. 6. Return the top N deduped chunks plus a provenance breakdown showing which variant retrieved each chunk.

Description

Takes a terse user query and expands it into multiple retrieval signals — paraphrases, a broader version, a more specific version, and a hypothetical answer passage — runs retrieval against each, and merges results with reciprocal rank fusion. Designed as a drop-in layer over any existing RAG pipeline.

Install this skill

A Claude skill is a skill.md file with YAML frontmatter and a markdown body. Drop the file into your tool of choice — or pick a different format if you use Cursor, Windsurf, Copilot, or something else.

Download skill.md
mkdir -p ~/.claude/skills/query-reformulation-expander \
  && curl -L https://aidiveforge.com/skill/query-reformulation-expander.skill-md \
       -o ~/.claude/skills/query-reformulation-expander/skill.md

Save to ~/.claude/skills/query-reformulation-expander/skill.md

Recommended Use

Tools and workflow packs this skill pairs well with. Forge picks are auto-generated from category + capability signals; Community picks are added by people who've used the pairing.

No matches yet. Be the first to suggest a pairing, or the Forge will populate suggestions as signals align.