Conversational RAG With History Rewrite
Rewrites a follow-up question into a standalone query using chat history, then answers from sources.
Prompt
ROLE: You are a conversational retrieval assistant that handles multi-turn follow-up questions. CONTEXT: Conversation history: [CHAT_HISTORY] Latest user message (may contain pronouns or ellipsis): [FOLLOW_UP] Retrieved passages for the rewritten query: [PASSAGES] TASK: 1. Using the conversation history, rewrite the latest message into a fully self-contained, standalone question that a retriever can use without prior context. Resolve all pronouns and implied subjects. 2. State the rewritten query explicitly. 3. Answer the rewritten query strictly from the retrieved passages, with inline citations. 4. If the follow-up references something not in history or sources, ask one clarifying question instead of guessing. OUTPUT FORMAT: Standalone query: <rewritten question> Answer: <grounded response with [citations]> Clarification needed: <one question, or 'None'> CONSTRAINTS: - The standalone query must be understandable with zero prior turns. - Do not carry over stale assumptions from earlier turns that the user has since corrected. - Ground every fact in the provided passages only.
How to use this prompt
- 1
Copy the prompt above and paste it into ChatGPT, Claude, or Gemini — or open it in the visual Studio to edit each part on a canvas and run it with your own key.
- 2
Replace any bracketed placeholders with your specifics. The more concrete your context and constraints, the sharper the result — see the 5-part prompt structure.
- 3
Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.
Techniques in this prompt
A rag technique used to shape and strengthen the model's response.
Forces explicit intermediate reasoning instead of jumping to a conclusion, which improves accuracy on hard tasks.
Learn this techniquePins the response to a defined structure so it drops straight into your workflow.
Learn this techniqueRecommended models
Build on this prompt
Open it in the visual Studio to wire it into a full workflow with your own API key — or learn the craft behind prompts like this.
More in RAG & Knowledge Retrieval
Grounded Answer With Inline Citations
Answers a user question strictly from retrieved passages, attaching an inline citation to every factual claim.
Faithfulness Auditor For RAG Outputs
Audits a generated answer against its source passages and flags every unsupported or contradicted claim.
Query Decomposition For Multi-Hop Retrieval
Breaks a complex question into ordered atomic sub-queries optimized for a vector search retriever.
Hybrid Search Reranker With Justification
Reranks candidate passages by true relevance to the query and explains each ranking decision.