Handling Conflicting and Outdated Sources

What to do when retrieved documents disagree or are out of date.

Last Updated: 27, Nov 2026

Search Tutorials

--Ads--

Module 11 · Lesson 6 of 6 · Intermediate

Handling Conflicting and Outdated Sources

What to do when retrieved documents disagree or are out of date.

Real knowledge bases contradict themselves. The 2024 travel policy says hotels are capped at 5,000 rupees; the 2026 revision says 6,000; an old FAQ page still says 4,500. If all three are retrieved, a naive RAG system may quote any of them, or average them into something nobody wrote. This lesson shows how to prevent outdated sources from being retrieved and how to make the model handle conflicts openly.

Prevent: fix it in the data

The best conflict is one that never reaches the prompt.

  • Remove superseded documents from the index, or mark them with status="archived" and filter them out by default.
  • Deduplicate versions, keeping the newest (see Cleaning and Deduplication).
  • Record dates and authority as metadata: effective date, version, owner, and a source type such as "official policy" or "FAQ" or "forum post".

Rank: prefer recent and authoritative sources

When several versions remain (for example, because users sometimes need historical policies), adjust ranking with metadata. A simple approach multiplies the relevance score by a recency factor and an authority weight:

from datetime import date

AUTHORITY = {"policy": 1.0, "procedure": 0.95, "faq": 0.85, "forum": 0.6}

def adjusted_score(hit: dict, today: date | None = None, half_life_days: int = 730) -> float:
    today = today or date.today()
    m = hit["metadata"]
    age_days = (today - date.fromisoformat(m.get("effective_date", "2000-01-01"))).days
    recency = 0.5 ** (max(age_days, 0) / half_life_days)        # halves every two years
    return hit["score"] * (0.7 + 0.3 * recency) * AUTHORITY.get(m.get("doc_type"), 0.8)

hits.sort(key=adjusted_score, reverse=True)

The weights here are examples. Keep recency's influence moderate: an old document is not wrong just because it is old, and many policies stay valid for years.

Show: give the model what it needs to decide

The model can only resolve a conflict it can see. Put dates, versions and document types in the source headers:

<source id="1" title="Travel Policy" version="3.0" effective="2026-04-01" type="policy">
Hotel costs are covered up to 6,000 rupees per night in metro cities.
</source>
<source id="2" title="Travel FAQ" updated="2023-11-15" type="faq">
The hotel limit for metro cities is 4,500 rupees per night.
</source>

Instruct: say how to handle disagreement

CONFLICT_RULES = """When sources disagree:
- Prefer an official policy over an FAQ or informal page, and the most recent effective
  date over older ones.
- State the answer from the preferred source, then briefly mention that an older or less
  authoritative source says something different, citing both.
- If you cannot tell which source is current, present both values with their dates and
  recommend confirming with the policy owner. Never average or blend conflicting values."""

With these rules and the headers above, a typical answer reads: "The hotel limit in metro cities is 6,000 rupees per night under the current Travel Policy (effective April 2026) [1]. An older FAQ still lists 4,500 rupees [2]; that figure is out of date."

Detect: flag conflicts for the content owners

Conflicts are data-quality bugs. Ask for a structured flag and log it, so that whoever owns the documents can fix the source:

from pydantic import BaseModel
import anthropic

client = anthropic.Anthropic()

class ConflictCheck(BaseModel):
    has_conflict: bool
    description: str
    source_ids: list[int]

def check_conflicts(question: str, sources_xml: str) -> ConflictCheck:
    response = client.messages.parse(
        model="claude-opus-5-5",
        max_tokens=800,
        output_config={"effort": "low"},
        messages=[{"role": "user", "content":
            f"{sources_xml}\n\nDo any of these sources give contradictory information that is "
            f"relevant to the question: {question}? Ignore differences that are not contradictions."}],
        output_format=ConflictCheck,
    )
    return response.parsed_output

Run this check offline on a sample of logged queries rather than on every request, and send a weekly report to content owners.

Key takeaways

  • Prevent conflicts in the data: archive superseded documents and keep only current versions searchable.
  • Use dates and authority metadata to rank and to show the model which source is current.
  • Tell the model to prefer authoritative, recent sources, mention discrepancies and never blend values.
  • Log detected conflicts and send them to the document owners.