Back to cookbook

AI Prompt to Resolve Conflicting Information From Multiple Retrieved Sources in RAG

0 views Updated

Make this prompt yours

Share

This prompt gives a RAG (retrieval-augmented generation) system a clear procedure for what to do when the documents it retrieves disagree with each other, instead of silently picking one version or blending them into a confused answer. It's meant for teams building internal knowledge assistants, customer support bots, or research tools where retrieved chunks can come from outdated policy pages, superseded documentation, or sources written at different times.

Conflicting retrieved context is one of the most common and least discussed failure modes in RAG pipelines. A vector search can easily pull back an old pricing page and a new one, or two product specs that were never reconciled, and a model asked to "answer from the context" will often pick whichever passage it read last rather than flagging the disagreement. This prompt instructs the model to actively compare retrieved passages, surface contradictions, and attribute each claim to its source instead of merging them into one unverified statement.

Because this depends entirely on the quality of what gets retrieved in the first place, it pairs well with checking that only the most relevant passages reach the model. For pulling just the relevant snippets out of large source documents before this step runs, the Context Extractor can cut down on irrelevant or redundant passages feeding into the conflict check.

Prompt template

Make this prompt yours

prompt-template
313 tokens
ROLE: You are a research assistant that answers strictly from retrieved context and is careful to flag disagreements between sources. CONTEXT: User question: [INSERT USER QUESTION] Retrieved passages (each with source name and date): [PASSAGE 1 - SOURCE NAME - DATE]: [PASSAGE TEXT] [PASSAGE 2 - SOURCE NAME - DATE]: [PASSAGE TEXT] [ADD MORE PASSAGES AS NEEDED] TASK: 1. Compare the retrieved passages and identify any factual claims that conflict with each other. 2. For each conflict, quote the relevant line from each source and name the source it came from. 3. If the sources have different dates and recency clearly resolves the conflict, state which source is more current and recommend it, but say this is based on recency, not necessarily accuracy. 4. If recency does not resolve the conflict, say so explicitly and do not guess which source is correct. 5. Answer the user's question using only information you are confident in, and clearly mark any part of the answer that is uncertain due to source conflict. CONSTRAINTS: - Do not merge conflicting claims into a single blended statement - Do not invent a resolution that isn't supported by the source metadata provided - If no conflict exists, say so plainly and answer normally OUTPUT FORMAT: Conflicts found: [list each conflict with quoted lines and source names, or "None"] Resolution: [how the conflict was resolved, or why it couldn't be] Answer: [final answer to the user's question, with uncertainty flagged where relevant]

Want it sharper? Optimize this prompt with Prompt Optimizer, check it with the Prompt Debugger or shorten it with the Token Optimizer.

Example input

example-input
344 tokens
ROLE: You are a research assistant that answers strictly from retrieved context and is careful to flag disagreements between sources. CONTEXT: User question: What is our refund window for annual subscriptions? Retrieved passages (each with source name and date): [PASSAGE 1 - Refund Policy v2 - 2024-03-10]: Annual subscription customers may request a full refund within 14 days of purchase. [PASSAGE 2 - Refund Policy v3 - 2025-11-02]: Annual subscribers can request a refund within 30 days of the purchase date. TASK: 1. Compare the retrieved passages and identify any factual claims that conflict with each other. 2. For each conflict, quote the relevant line from each source and name the source it came from. 3. If the sources have different dates and recency clearly resolves the conflict, state which source is more current and recommend it, but say this is based on recency, not necessarily accuracy. 4. If recency does not resolve the conflict, say so explicitly and do not guess which source is correct. 5. Answer the user's question using only information you are confident in, and clearly mark any part of the answer that is uncertain due to source conflict. CONSTRAINTS: - Do not merge conflicting claims into a single blended statement - Do not invent a resolution that isn't supported by the source metadata provided - If no conflict exists, say so plainly and answer normally OUTPUT FORMAT: Conflicts found: [list each conflict with quoted lines and source names, or "None"] Resolution: [how the conflict was resolved, or why it couldn't be] Answer: [final answer to the user's question, with uncertainty flagged where relevant]

When to use it

  • Your knowledge base contains documents from different dates, like old and new versions of a policy or pricing page
  • You're building an internal assistant over Confluence, SharePoint, or a wiki where duplicate or outdated pages are common
  • Users are reporting answers that contradict what they saw in the source documents
  • You need the model to explain its reasoning when retrieved sources disagree, rather than just picking one silently

Best practices

  • Always pass source metadata (document name, last-updated date, version) alongside each retrieved chunk so the model has something to compare conflicts against
  • Ask the model to quote the conflicting lines directly rather than paraphrasing them, so you can verify the conflict is real and not a misreading
  • Instruct the model to prefer the most recently dated or most authoritative source when metadata makes that clear, but only when you've confirmed recency actually matters for that type of document
  • Before scaling this across a large document set, run a sample through the Context Extractor to confirm the retrieved chunks are actually the most relevant ones and not noise masquerading as conflicts

Common mistakes

  • Letting the model blend two contradictory passages into a single averaged-out answer that matches neither source
  • Not including source names or dates in the retrieved context, which makes it impossible for the model to judge which source should win
  • Treating every difference in wording as a conflict, when some are just paraphrases of the same underlying fact
  • Skipping a final confidence statement, so users can't tell whether the answer is settled or based on sources that disagree

FAQs

Why does my RAG system give different answers to the same question?

This usually happens when retrieval pulls back multiple passages that contain conflicting information, such as an old and new version of a policy, and the model picks whichever one it processed last without flagging the disagreement.

How do I detect conflicting sources in a RAG pipeline?

Include source metadata like document name and date with every retrieved chunk, then explicitly instruct the model to compare passages for contradictions before generating an answer, rather than assuming the context is consistent.

Should the newest document always win when sources conflict?

Not always. Recency is a useful signal for things like pricing or policy pages, but for some content (legal definitions, historical records) the newer document isn't automatically correct, so the model should say when it's relying on recency rather than confirmed accuracy.

What tool pairs well with this prompt for cleaner retrieval?

Context Extractor — pulls only the relevant snippets from large source documents before this conflict-resolution step runs, reducing the chance that irrelevant passages get mistaken for contradictions.

Found this prompt useful? Share it.

Share

More in RAG & Knowledge Retrieval

RAG & Knowledge Retrieval

AI Prompt to Build a Golden Test Set for Evaluating RAG Retrieval Accuracy

This RAG test set prompt helps you generate a golden evaluation set for a retrieval augmented generation pipeline, built for developers and…

You are a test-set generator for evaluating a retrieval-augmented generation (RAG) system.

CONTEXT:
Source document: [DOCUMENT TEXT OR CHUNK]
Domain: [DOMAIN, e.g. internal HR policy, product documentation, legal contracts]
Number of questions needed: [NUMBER]

TASK:
1. Read the source document carefully.
2. Generate [NUMBER] question-answer pairs that can be fully answered using only this document.
3. For each pair, include the exact sentence or passage the answer is drawn from.
4. Additionally generate [NUMBER OF ADVERSARIAL QUESTIONS] plausible-sounding questions that CANNOT be answered from this document, and label them as such.
5. Vary question phrasing: include direct factual questions, comparison questions, and questions phrased the way a real user would type them (casual, incomplete, or ambiguous).

CONSTRAINTS:
- Do not invent facts not present in the source document.
- Do not answer questions using outside knowledge.
- Flag any question where the answer requires combining multiple parts of the document.

OUTPUT FORMAT:
Return a numbered list. For each item include:
- Question:
- Expected Answer:
- Source Passage:
- Answerable: [Yes/No]

Make this prompt yours

RAG & Knowledge Retrieval

AI Prompt to Evaluate RAG Answers for Hallucinations Against Retrieved Context

This RAG hallucination detection prompt checks a generated answer against the exact passages a retrieval augmented generation system pulled…

ROLE: You are a strict fact-checking evaluator for a retrieval-augmented generation (RAG) system. You do not answer questions or improve the answer; you only judge it.

CONTEXT:
Retrieved passages:
[PASTE THE EXACT RETRIEVED CONTEXT CHUNKS HERE, NUMBERED]

Generated answer to evaluate:
[PASTE THE RAG SYSTEM'S GENERATED ANSWER HERE]

Original user question:
[PASTE THE ORIGINAL QUESTION HERE]

TASK:
1. Break the generated answer into individual factual claims.
2. For each claim, decide whether it is:
   - SUPPORTED: directly backed by a specific passage
   - PARTIALLY SUPPORTED: related to a passage but adds unsupported detail, numbers, or certainty
   - UNSUPPORTED: no passage backs this claim, even if it sounds plausible
3. For every SUPPORTED or PARTIALLY SUPPORTED claim, cite the passage number it relies on.
4. Do not use outside knowledge to judge truth; judge only whether the provided context supports the claim.

CONSTRAINTS:
- Evaluate every claim individually; do not summarize the whole answer as one verdict
- Be skeptical of specific numbers, dates, or named entities in the answer that are not explicitly in the passages
- If a claim restates the question without adding information, mark it as NOT APPLICABLE rather than forcing a verdict

OUTPUT FORMAT:
Return a numbered list, one entry per claim, each with:
Claim: [the exact claim text]
Verdict: [SUPPORTED / PARTIALLY SUPPORTED / UNSUPPORTED / NOT APPLICABLE]
Evidence: [passage number and quote, or "none found"]

End with:
Overall hallucination rate: [X of Y claims unsupported or partially supported]
Recommendation: [APPROVE / REVISE / REJECT the answer]

Make this prompt yours

RAG & Knowledge Retrieval

AI Prompt to Retrieve and Summarize Airtable Records Using MCP

This prompt is for teams who want an AI assistant to pull specific records from an Airtable base through an MCP server connection and summar…

Role: You are a data assistant with access to an Airtable MCP connection.

Context:
- Base: [BASE_NAME]
- Table: [TABLE_NAME]
- View or filter: [VIEW_NAME_OR_FILTER_CRITERIA]
- Question to answer: [SPECIFIC_QUESTION_ABOUT_THE_RECORDS]

Task:
1. Query the specified table and view through the Airtable MCP connection, applying the stated filter.
2. Identify the records that match the question.
3. Summarize the findings in plain language, including the total count of matching records.

Constraints:
- Base the answer only on records actually retrieved from the base, not assumptions about typical values.
- List the primary field value (e.g. record name or ID) for each record referenced in the summary.
- If no records match, say so explicitly rather than approximating an answer.
- Flag any records with missing or inconsistent data relevant to the question.

Output format:
- Answer: 1-2 sentence direct answer to the question
- Matching records: bulleted list with primary field value and relevant field values
- Total count: number of matching records
- Data issues: bulleted list of any missing/inconsistent fields noticed, or "None found"

Make this prompt yours