Skip to content
Automation
Skill

/rag-query-transformation

Query expansion, HyDE, and multi-query generation for improved retrieval

From plugin
babysitter
1.8k200 skills3 agents21 commands1 MCP
Install
$ npx -y skills add a5c-ai/babysitter --skill rag-query-transformation --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/rag-query-transformation

Context preview

The summary Claude sees to decide when to auto-load this skill.

Query expansion, HyDE, and multi-query generation for improved retrieval

SKILL.md

rag-query-transformation.SKILL.md
name: rag-query-transformation
description: Query expansion, HyDE, and multi-query generation for improved retrieval
allowed-tools:
  - Read
  - Write
  - Edit
  - Bash
  - Glob
  - Grep
graph:
  domains: [domain:software-engineering]
  specializations: [specialization:ai-agents-conversational]
  skillAreas: [skill-area:retrieval-augmented-generation, skill-area:prompt-engineering]
  roles: [role:ml-engineer, role:backend-engineer]
  workflows: [workflow:ml-model-lifecycle, workflow:feature-development]

RAG Query Transformation Skill

Capabilities

  • Implement query expansion techniques
  • Configure Hypothetical Document Embeddings (HyDE)
  • Set up multi-query generation
  • Design query decomposition strategies
  • Implement step-back prompting
  • Configure query routing for specialized indices

Target Processes

  • advanced-rag-patterns
  • knowledge-base-qa

Implementation Details

Transformation Techniques

1. **Multi-Query Generation**: Generate query variations 2. **HyDE**: Generate hypothetical answer, embed that 3. **Query Decomposition**: Break complex queries into sub-queries 4. **Step-Back Prompting**: Generate higher-level queries 5. **Query Expansion**: Add synonyms and related terms

Configuration Options

  • Number of query variations
  • LLM for query generation
  • Decomposition depth
  • Query routing rules
  • Result fusion strategy

Best Practices

  • Match technique to query complexity
  • Test with representative queries
  • Monitor retrieval quality changes
  • Balance latency vs quality tradeoffs

Dependencies

  • langchain
  • LLM provider
Read more
Ships withbabysitter

Enforce obedience on agentic workforces. Manage extremely complex workflows through deterministic, hallucination-free self-orchestration.

Get the whole plugin

Other skills on babysitter.