Skip to content
Back to skills

Component Hyde Rewriter

ASecurity

Generate exactly one hypothetical answer-like document from the original query with single-sample HyDE (N=1) for zero-shot semantic retrieval. Use before a vector retriever when query-document wording mismatch is likely; never treat the generated text as factual evidence.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 1, 2026
ai-agents

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 1, 2026

npx -y skills add DocAILab/Agentic-RAG-Skill --skill component-hyde-rewriter --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Component Hyde Rewriter?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Component Hyde Rewriter
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/docailab-component-hyde-rewriter/badge)](https://www.skillsdirectory.com/skills/docailab-component-hyde-rewriter)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: component-hyde-rewriter
description: Generate exactly one hypothetical answer-like document from the original query with single-sample HyDE (N=1) for zero-shot semantic retrieval. Use before a vector retriever when query-document wording mismatch is likely; never treat the generated text as factual evidence.
---

# HyDE Rewriter Component

Provide the `rewriter` capability for an Agentic RAG slot.

## Interface

Input `RewriteRequest`:

- `query`: original user query
- optional `temperature`: generation temperature, default `0.0`
- optional `max_tokens`: maximum hypothetical-document tokens, default `8192`

Output `RewriteResult`:

- `rewritten_query`: exactly one hypothetical answer-like document used as the retrieval query

## Execution

Run `scripts/component.py:run(inputs, context)`.

Implement the single-sample HyDE variant (`N=1`). Call the frozen Executor Model supplied through `context.call_model()` exactly once and generate one concise hypothetical document. Do not generate multiple hypotheses or perform embedding aggregation in this Component.

Use the generated text only as the input to a semantic Vector Retriever. Keep the original query for reranking and final answer generation.

The hypothetical document may contain false details. Never add it to the retrieved evidence, never return it as a real document, and never use it directly as the final answer.

Prefer this Component when the original query is short, abstract, or phrased differently from the corpus. Do not select it as the default preprocessing step for exact keyword, identifier, or entity-name retrieval.

Files in this skill

  • SKILL.md1.6 KB
  • agents/openai.yaml219 B
  • ragskill.yaml329 B
  • scripts/component.py1.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.