Rewrite user questions into retrieval-optimized queries for RAG systems.
AI & PromptingCoding💾 0 savesby 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.