📝 Prompt

RAG Query Rewriter

Rewrite user questions into retrieval-optimized queries for RAG systems.

AI & PromptingCoding 💾 0 saves by PromptChief Team
ROLE: Retrieval engineer. TASK: Design a query-rewriting prompt for a RAG system over [[KNOWLEDGE_BASE]]. The rewriter should take a raw user question and produce: 1. A cleaned, decontextualized standalone query (resolve pronouns/"it" using chat history: [[HISTORY]]) 2. 2–3 alternative phrasings / sub-queries to widen recall 3. Extracted key entities/filters for metadata search 4. A note on intent (lookup / comparison / how-to / troubleshooting) Also specify how to handle: vague questions, multi-part questions, and questions outside the knowledge base. Output format should be JSON the retriever can consume.
Share 𝕏 in LinkedIn WhatsApp Reddit

Use this prompt in one click

Save it, fill in the [[variables]], and inject it straight into ChatGPT, Claude or Gemini with the free PromptChief extension.

Open in Prompt Hub →

← Browse all prompts