This prompt is designed for retrieval-augmented generation (RAG) assistants where a user challenges a sourced claim. When a user says 'that's wrong' or provides contradictory information, this prompt re-evaluates the original retrieved evidence against the correction, determines whether the retrieval was insufficient or misinterpreted, and produces a corrected answer with explicit re-retrieval triggers if needed. Use this when your assistant must maintain source faithfulness after user pushback, when you need structured correction decisions that downstream systems can act on, and when correction handling determines whether users trust your system enough to continue using it. This prompt belongs in the correction-handling layer of your RAG pipeline, after correction detection but before response generation. It assumes you already have the original query, the original retrieved passages, the assistant's prior answer, and the user's correction message available as inputs.
Prompt
Correction in RAG Context Prompt Template

When to Use This Prompt
Understand the job-to-be-done, required inputs, and boundaries for the Correction in RAG Context prompt before wiring it into your pipeline.
Do not use this prompt when the user is asking a clarifying question rather than issuing a correction, when the correction targets a non-sourced claim (use the Assistant Claim Reversal Prompt instead), or when the user provides new evidence that requires fresh retrieval before re-evaluation (use the Correction with New Evidence Prompt Template). This prompt is also inappropriate for corrections that span multiple prior turns or require state rollback across tool calls—those scenarios need the State Rollback After Correction or Correction Cascade Prevention prompts. The ideal user is an AI engineer or product developer building a RAG system where source citations are surfaced to users and where incorrect citations directly damage credibility. You need four structured inputs at minimum: the original user query, the retrieved passages with source identifiers, the assistant's prior answer with citation mappings, and the user's correction text.
Before implementing, verify that your correction detection step reliably distinguishes corrections from follow-up questions and topic shifts. False positives here will route benign clarification requests into this re-evaluation flow, wasting latency and context budget. Also confirm that your retrieval system can accept re-retrieval triggers programmatically—this prompt may output a re_retrieval_needed flag with modified query parameters that your harness must act on before generating the final response. If your RAG pipeline cannot perform mid-turn re-retrieval, configure the prompt to operate in 'evidence-only' mode where it works solely with the already-retrieved passages and flags insufficient evidence for human review rather than requesting new retrieval.
Use Case Fit
Where the Correction in RAG Context prompt works, where it fails, and what inputs it assumes before you wire it into production.
Good Fit
Use when: users challenge specific sourced claims with counter-evidence or point out retrieval misinterpretation. Guardrail: the prompt assumes the original retrieved context is still available for re-evaluation alongside the user's correction.
Bad Fit
Avoid when: the user is expressing preference or opinion rather than factual correction, or when the original retrieval pipeline is unavailable for re-query. Guardrail: route preference changes to state update prompts, not evidence re-evaluation prompts.
Required Inputs
Must have: the original user query, the assistant's prior response with citations, the specific retrieved passages used, and the user's correction turn. Guardrail: missing any of these degrades the prompt to guesswork—validate input completeness before invoking.
Operational Risk
Risk: re-retrieval can surface different sources that contradict the correction, creating a correction loop. Guardrail: cap re-retrieval attempts at 2 and escalate to human review if source conflict persists after re-evaluation.
Latency Budget
Risk: re-retrieval plus re-verification doubles response time, frustrating users who expect instant correction acknowledgment. Guardrail: acknowledge the correction immediately in a lightweight first response, then stream the re-verified answer as a follow-up.
Source Faithfulness
Risk: the model may accept the user's correction without verifying it against sources, producing a polite but wrong answer. Guardrail: require the prompt to explicitly compare the correction against original sources and flag discrepancies rather than silently adopting the user's claim.
Copy-Ready Prompt Template
A reusable prompt with square-bracket placeholders that re-evaluates retrieved evidence against a user's correction and produces a corrected, source-faithful answer.
This prompt template is the core instruction set for a retrieval-augmented generation (RAG) assistant that must handle a user challenging a previously sourced claim. It forces the model to re-examine the original retrieved evidence, compare it against the user's correction, and determine whether the error stemmed from insufficient retrieval, misinterpretation of a source, or a correct source that the user is now disputing. The output is a structured correction that includes a re-verification of source faithfulness, preventing the assistant from simply agreeing with the user without evidence.
textYou are an assistant that answers questions using only the provided retrieved context. You have just given a previous answer based on that context. The user is now correcting a specific claim you made. Your task is to re-evaluate the original evidence against the user's correction and produce a corrected answer. ## INPUTS [ORIGINAL_USER_QUESTION] [YOUR_PREVIOUS_ANSWER] [RETRIEVED_CONTEXT_USED] [USER_CORRECTION] ## CONSTRAINTS - You must ground every factual statement in the provided [RETRIEVED_CONTEXT_USED]. - If the user's correction is supported by the original context, acknowledge the error and provide the corrected information with a direct quote from the source. - If the user's correction is not supported by the original context, politely explain that the provided evidence does not confirm their correction, and restate what the evidence actually says. - If the original context is silent or ambiguous on the point of correction, state that clearly and do not fabricate a resolution. - Do not use any outside knowledge. - Maintain a professional, non-defensive tone. ## OUTPUT SCHEMA Respond with a valid JSON object matching this schema: { "correction_analysis": { "original_claim": "The specific claim from your previous answer that is being challenged.", "user_correction_summary": "A concise summary of the user's correction.", "evidence_evaluation": "supported_by_context | contradicted_by_context | context_is_silent", "evidence_quote": "The exact text from [RETRIEVED_CONTEXT_USED] that supports this evaluation, or null." }, "requires_re_retrieval": true or false, "re_retrieval_query": "A new search query to find better evidence, only if requires_re_retrieval is true. Otherwise, null.", "corrected_response": "The full, corrected answer to the user, incorporating the analysis above." }
To adapt this template, replace the bracketed placeholders with your application's actual data. [ORIGINAL_USER_QUESTION] and [YOUR_PREVIOUS_ANSWER] come from your session history. [RETRIEVED_CONTEXT_USED] is the raw text of the chunks that were provided to the model in the previous turn. [USER_CORRECTION] is the user's latest message. The requires_re_retrieval boolean is a critical control signal for your application harness; if true, your system should execute the re_retrieval_query and run this entire prompt again with the new context before showing the user the corrected_response. For high-stakes domains, always log the full JSON output and consider flagging cases where evidence_evaluation is context_is_silent for human review, as this indicates a knowledge gap that retrieval alone cannot fix.
Prompt Variables
Inputs the Correction in RAG Context prompt needs to work reliably, with validation guidance for each placeholder.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[CONVERSATION_HISTORY] | Full transcript of the current session up to the user's correction turn | USER: What is the refund policy? ASSISTANT: Refunds must be requested within 14 days. USER: That's wrong, it's 30 days now. | Parse check: must contain at least one assistant turn and one subsequent user turn. Truncate to last 10 turns if context budget is tight. Verify assistant turn exists before user correction. |
[USER_CORRECTION_TURN] | The specific user message containing the correction claim | That's wrong, it's 30 days now. | Parse check: must be non-empty and appear in [CONVERSATION_HISTORY]. If correction is implicit, extract the contradicting statement. Do not include prior user turns. |
[ORIGINAL_RETRIEVED_SOURCES] | The evidence passages originally retrieved and cited in the assistant's disputed response | [{"source_id": "doc-42", "text": "Refunds must be requested within 14 days of purchase.", "citation": "Refund Policy v2.1, Section 3"}] | Schema check: array of objects with source_id, text, and citation fields. Must match sources cited in the assistant turn being corrected. Empty array allowed if assistant made unsourced claim. |
[CORRECTION_TYPE] | Classification of the correction: factual, source_outdated, misinterpretation, or missing_context | source_outdated | Enum check: must be one of factual, source_outdated, misinterpretation, missing_context. If null, prompt should infer type from context. Confidence threshold: require >0.7 for auto-classification, else flag for review. |
[RE_RETRIEVAL_QUERY] | Reformulated search query to find evidence supporting or refuting the user's correction | refund policy 30 days current terms | Parse check: must differ from original retrieval query. Validate query length between 3 and 500 characters. If null, prompt should generate query from correction context. Retry if generated query matches original exactly. |
[OUTPUT_SCHEMA] | Expected structure for the corrected response and re-verification results | {"correction_acknowledged": true, "corrected_claim": "...", "updated_sources": [...], "re_retrieval_needed": false, "confidence": 0.92} | Schema check: validate against JSON schema with required fields. Must include corrected_claim, updated_sources array, and re_retrieval_needed boolean. Confidence must be 0.0-1.0. Reject if schema mismatch. |
[EVIDENCE_CONFLICT_POLICY] | Rule for resolving conflicts between original sources and new retrieval results | prefer_newer_publication_date | Enum check: must be one of prefer_newer_publication_date, prefer_higher_authority, require_human_review, or prefer_user_evidence. If null, default to require_human_review for safety. Policy must be logged in audit trail. |
Implementation Harness Notes
How to wire the Correction in RAG Context prompt into an application with validation, retry logic, and human-review gates.
The Correction in RAG Context prompt is not a standalone component; it is a decision node inside a larger retrieval-augmented generation pipeline. When a user challenges a sourced claim, the application must pause the normal answer flow, invoke this prompt with the original query, the disputed assistant response, the retrieved evidence that supported it, and the user's correction text. The prompt's output—a structured decision about whether retrieval was insufficient or misinterpreted, plus a corrected answer or a re-retrieval trigger—must then be acted on by the surrounding harness. This means the harness is responsible for supplying clean, timestamped evidence records, enforcing the output schema, and routing the result to either the user or a re-retrieval loop.
Start by validating the prompt's output against a strict schema before any user-facing action. The expected output should include at minimum: a correction_accepted boolean, a correction_type enum (e.g., retrieval_insufficient, source_misinterpreted, user_evidence_override, no_correction_needed), a corrected_answer string, a re_retrieval_needed boolean, an optional re_retrieval_query string, and a source_faithfulness_check object listing each original source with a still_valid boolean and reason string. If the model's output fails to parse into this schema, do not show it to the user. Instead, log the raw output, increment a schema_violation metric, and retry with a stricter version of the prompt that includes the schema inline and a [CONSTRAINTS] block explicitly forbidding extra commentary. After two retries, fall back to a safe canned response: 'I wasn't able to verify the correction against the original sources. Let me re-check and get back to you.' This prevents malformed corrections from eroding trust.
The re-retrieval loop is the most dangerous part of this harness. If re_retrieval_needed is true, the application must execute the suggested re_retrieval_query (or a system-generated variant) against the same retrieval pipeline, then re-invoke the Correction in RAG Context prompt with the new evidence appended. Set a hard limit of two re-retrieval cycles per correction event. If the second cycle still produces re_retrieval_needed: true, break the loop and escalate to a human review queue with the full chain: original query, original evidence, user correction, first re-retrieval results, second re-retrieval results, and both prompt outputs. This prevents infinite loops and surfaces genuinely hard retrieval failures to the operations team. Log every cycle with a correction_loop_id for traceability.
Human review gates should be triggered by specific conditions, not just loop exhaustion. Escalate to a review queue when: (a) the source_faithfulness_check shows that more than half of the original sources are now marked still_valid: false, indicating a systemic retrieval failure; (b) the correction_type is user_evidence_override and the user's evidence directly contradicts a source from an authoritative internal knowledge base, which may indicate a knowledge base error; or (c) the correction involves a regulated domain such as healthcare, legal, or financial claims, where incorrect corrections carry compliance risk. In these cases, the harness should surface the correction event in a review tool with a structured payload, not just a raw log line. The human reviewer should be able to accept the corrected answer, modify it, or reject the correction and restore the original response with an explanation.
Model choice matters here. This prompt requires strong instruction-following and structured output discipline. Prefer models with native JSON mode or function-calling support, and set temperature to 0 or near-zero to reduce variance in the correction decision. If using a model without reliable JSON mode, wrap the prompt output in a parser that extracts JSON from markdown fences or free text, but log every parse failure as a near-miss. Finally, instrument the harness with metrics: correction acceptance rate, re-retrieval loop frequency, schema violation rate, human escalation rate, and time-to-correction-resolution. These metrics will tell you whether the correction flow is building user trust or creating a new failure mode.
Common Failure Modes
Correction in RAG context fails silently when the model trusts its retrieval over the user, re-retrieves the same bad evidence, or loses track of what was actually corrected. These cards cover the most common production failure patterns and how to guard against them before they erode user trust.
Retrieval Echo Chamber
What to watch: The assistant acknowledges the correction but re-retrieves the same or semantically similar documents, producing an identical 'corrected' answer. The user sees the system double down on the error. Guardrail: Inject the user's correction as a negative constraint into the re-retrieval query. Explicitly instruct the model to exclude passages that support the disputed claim. Log the before/after retrieval set to detect zero-delta re-retrieval.
Source Faithfulness Drift After Correction
What to watch: The assistant produces a corrected answer that aligns with the user's correction but is no longer grounded in the retrieved evidence. The model invents new supporting facts to agree with the user. Guardrail: Run the corrected answer through the same citation verification step as the original. Require every factual claim in the corrected response to map to a specific retrieved passage. If no passage supports the correction, trigger an explicit 'insufficient evidence' response instead of fabricating support.
Partial Correction Overwrite
What to watch: The user corrects one specific claim, but the assistant regenerates the entire response and inadvertently changes other correct portions. Uncontested facts get lost or altered. Guardrail: Before regeneration, extract and freeze all claims the user did not dispute. After generating the corrected response, diff it against the frozen claims. Flag any changes to uncontested content for review or automatic rollback.
Correction-Without-Re-Retrieval
What to watch: The assistant accepts the user's correction and updates its answer without re-querying the knowledge base. If the correction reveals a retrieval gap, the new answer is still built on incomplete evidence. Guardrail: Classify the correction type. Factual corrections must trigger a mandatory re-retrieval step with a rewritten query. Procedural or format corrections may not require it. Add a re_retrieval_triggered boolean to your observability trace and alert if factual corrections skip retrieval.
Correction Cascade Contamination
What to watch: The assistant correctly reverses one claim but fails to update downstream conclusions, action items, or state fields that depended on the original error. The session state becomes internally inconsistent. Guardrail: Maintain a dependency map of which state fields and prior conclusions were derived from which claims. When a claim is corrected, flag all dependent state as 'stale' and force re-computation before the next assistant turn. Validate that no stale-derived state survives into subsequent responses.
Over-Compliance with Incorrect User Corrections
What to watch: The user provides a correction that is factually wrong, but the assistant accepts it without challenge because it's optimized for deference. The system replaces a correct answer with a user-supplied error. Guardrail: After accepting a correction, run a silent verification step: re-retrieve evidence and compare the user's corrected claim against the retrieved sources. If the evidence strongly contradicts the user's correction, surface the conflict with citations and ask the user to resolve it rather than silently adopting the wrong answer.
Evaluation Rubric
Pass/fail criteria for evaluating the Correction in RAG Context prompt before production deployment. Use this rubric to score outputs against a golden dataset of corrected claims and adversarial retrieval scenarios.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Source Re-verification | Output re-evaluates original retrieved passages against the user's correction claim and explicitly states whether the original source supports or contradicts the correction | Output ignores original sources, accepts correction without evidence comparison, or fabricates new source content | Golden dataset: 20 correction turns with known source documents. Check that output references original passage IDs and compares them to the correction |
Correction Classification Accuracy | Output correctly identifies whether the error was due to retrieval failure, misinterpretation, or missing evidence and labels the root cause | Output misclassifies a retrieval gap as a reasoning error, or blames the user when evidence was genuinely missing | Confusion matrix test across 30 labeled correction scenarios with known root cause labels. Target >90% accuracy on root cause classification |
Re-retrieval Trigger Decision | Output includes a boolean re-retrieval flag set to true when original passages are insufficient and false when existing evidence supports correction without new retrieval | Re-retrieval flag is true when original passages already contain the answer, or false when evidence is clearly incomplete | 50 test cases with varying retrieval completeness. Measure precision and recall of re-retrieval trigger against human-annotated ground truth |
Citation Faithfulness After Correction | Corrected answer cites only passages that genuinely support the new claim. No citation hallucination or orphaned citations from the original incorrect response | Corrected output retains citations from the original wrong answer that do not support the correction, or invents new citation IDs | Citation grounding check: extract each citation, retrieve the passage, verify entailment between passage and corrected claim. Require 100% citation accuracy |
Correction Acknowledgment Tone | Acknowledgment is concise, specific about what changed, and free of over-apology, defensiveness, or blame-shifting language | Output contains excessive apology, deflects responsibility to the user or sources, or fails to state what specifically was corrected | LLM-as-judge eval with tone rubric. Human review on 20 samples. Pass if >85% rated acceptable on acknowledgment quality |
State Rollback Completeness | Output identifies all downstream claims or state fields that depend on the corrected claim and marks them for re-verification or invalidation | Output corrects only the surface claim but leaves dependent conclusions, summaries, or slot values unchanged | Dependency graph test: inject corrections into 15 multi-turn scenarios with known downstream dependencies. Verify all dependent fields are flagged |
No Correction Cascade | Output does not introduce new errors while fixing the original. Corrected response is internally consistent and does not contradict other parts of the conversation | Correction introduces a new factual error, contradicts a prior correct statement, or creates a logical inconsistency with session context | Consistency check across full conversation state after correction. Run 25 correction scenarios and verify no new contradictions introduced |
Uncertainty Handling When Evidence Is Ambiguous | When retrieved evidence is ambiguous or conflicting, output expresses appropriate uncertainty, does not fabricate certainty, and recommends clarification or human review | Output presents a confident corrected answer when evidence is evenly split, or fails to flag ambiguity when sources conflict | Ambiguous evidence test set: 15 scenarios with conflicting source passages. Pass if output expresses uncertainty or requests clarification in >80% of cases |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base prompt template and replace [RETRIEVED_CONTEXT] with a static set of 3-5 passages. Use [USER_CORRECTION] as a single-sentence override. Skip re-retrieval triggers and source faithfulness re-verification. Focus on getting the correction acknowledgment and answer update working before adding retrieval loops.
Watch for
- The model accepting corrections that contradict the evidence without flagging the conflict
- Overly apologetic tone that erodes user confidence
- Missing the distinction between "user disagrees with interpretation" and "user provides new facts"

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us