Skip to content
Visual explainer 2h 30m to learn 4 steps

Resolve outdated and contradictory sources in RAG answers

Apply provenance and freshness rules to conflicting snippets and flag evidence that is missing or unresolved.

By Invicly Tech, , in Generative AI, Agentic AI and RAG. About 11 minutes to read.

Topic 14 of 34

In short

Real corpora contain old versions, drafts, forum notes and policies that disagree. Before generation, your code ranks evidence by authority, effective date and version, and removes anything superseded or not yet in effect. When two current, authoritative snippets still disagree, the answer says so and flags the conflict instead of quietly picking one.

Think of it like this: It is like checking a train timetable: you trust the current official timetable over an old printout or a friend's message, and if two official notices disagree you warn the traveller.

Explained simply

Company documents change. A refund policy might move from 14 days to 30 days, but the old FAQ page still says 14. A support agent might write a ticket note with a workaround that later stops being true. If your assistant retrieves all of these, it sees conflicting answers.

A model left alone will often pick one at random, or mix them into a vague answer. That is risky. The fix is to decide, in code, which sources to trust before the model ever sees them, using information you stored when the documents were ingested.

Three pieces of information do most of the work. The version tells you which copy of a document is newest. The effective date tells you when the content starts to apply. The source type, such as policy, FAQ or ticket note, tells you how authoritative it is.

Sometimes two current, official sources really disagree. Then the assistant should not guess. It should say that the sources conflict, show both, and send the question to a person who can fix the documents. This also helps the content owners find mistakes.

Press Play on a diagram to walk through it one step at a time.

FlowFreshness and provenance rules before generation
  1. 1
    Drop superseded

    Keep only the latest version of each document

  2. 2
    Check effective date

    Skip future-dated and expired content

  3. 3
    Rank by authority

    Policy above FAQ above ticket notes

  4. 4
    Detect conflicts

    Same topic key, different values

  5. 5
    Answer or flag

    Resolved answer, or a conflict note and escalation

MapKinds of disagreement and what to do
Conflicting snippets
  • Old version vs new version
    • Filter superseded in SQL
    • Keep old ones for audit
  • Future-dated content
    • Skip until effective_from
    • Mention upcoming change if useful
  • Lower vs higher authority
    • Answer from higher authority
    • Report the stale source
  • Two current, equal authority
    • Do not choose
    • Escalate with both IDs

In depth

Metadata that makes freshness possible

You cannot resolve conflicts later if you did not record the facts earlier. Each chunk in the corpus from module 3 should carry its document ID, version number, effective_from date, optional effective_to date, source type and owner. Store these as columns, not just inside text, so retrieval queries can filter on them.

With this metadata the simplest rules go straight into SQL. Filter out rows whose effective_from is after today or whose effective_to is before today. Join to a table of current versions, or filter on a superseded flag set at ingestion, so old versions are never candidates. The model then sees fewer contradictions to begin with.

Keep old versions in the database for audit and for questions like what was the policy last March. Just exclude them from normal retrieval.

  • doc_id, version, effective_from, effective_to
  • kind: policy, faq or ticket_note
  • owner: who can fix the document
  • superseded flag or a current-version table
  • Filter in SQL before ranking

Authority beats recency across source types

Date alone is a poor tie-breaker. A ticket note written yesterday is newer than the official policy from last year, but it is not more trustworthy. So rank first by an authority order you agree with the content owners, then by date within the same type.

A typical order is: signed policy, then product documentation, then FAQ, then internal ticket notes. Write this order in one place in your code, test it, and show it in the answer's provenance so readers know why one source won.

When a lower-authority source contradicts a higher one, you have two jobs. Answer from the higher-authority source. Then record the contradiction, because the lower source is probably stale and someone should update it. A weekly report of these cases is cheap and very useful.

LayersExample authority order
  1. 1
    Signed policy

    Owned by legal or the policy team

  2. 2
    Product documentation

    Owned by the product team

  3. 3
    FAQ

    Summaries that can lag behind policy

  4. 4
    Ticket notes

    Useful context, lowest authority

Detecting real contradictions

After filtering, some conflicts remain. Two current policies from different teams might give different limits. You can detect many of these without a model if key facts are tagged at ingestion, for example a topic key refund_window_days with a value. Two current chunks with the same key and different values are a conflict.

Where facts are not tagged, you can ask the model to report conflicts as part of its structured output: a list of pairs of source IDs that disagree, each with a one-line description. Validate those IDs exactly as you validate citations.

Treat model-reported conflicts as signals, not proof. Sample them for human review, and prefer tagged facts for the policies that matter most, such as money, safety and legal terms.

Writing an answer that flags uncertainty

When a conflict is resolved by your rules, answer normally and add a short provenance note, for example based on the refund policy version 4, effective 1 March 2026. Readers can see what the answer rests on.

When a conflict is unresolved, use a conflicts field in the response with the source IDs involved and set the status to escalated with reason conflicting_sources. The text can explain the disagreement in plain words, such as the policy says 30 days, the finance guide says 21 days, but it should not choose between them.

Missing evidence is a related case. If the question asks about a product or region the corpus does not cover, say that clearly instead of answering from a nearby but different document. Test both cases with fixtures.

  • Resolved: answer plus provenance note
  • Unresolved: escalate with conflicting_sources
  • List the disagreeing source IDs
  • Missing: abstain with no_evidence

Learn it in 4 short steps

About 40m each. Track them with a timer in your plan.

  1. 1
    Rank evidence by effective date and version~40m
  2. 2
    Detect contradictory snippets~40m
  3. 3
    Prefer authoritative sources~40m
  4. 4
    Flag unresolved conflicts in the answer~40m

Key points

  • Freshness rules use metadata stored at ingestion: version, effective_from, effective_to and authority.
  • Superseded versions should usually be filtered in the query, not left for the model to notice.
  • Authority beats recency across source types: a new forum post does not override the current policy.
  • An unresolved conflict is a valid outcome; the answer shows both sources and asks a person to confirm.

Key terms

Tap a card to flip it. 0/5 known

Examples

python
from datetime import date

AUTHORITY = {'policy': 3, 'faq': 2, 'ticket_note': 1}

def usable(chunks, today: date):
    latest = {}
    for c in chunks:
        if c.effective_from > today or (c.effective_to and c.effective_to < today):
            continue
        best = latest.get(c.doc_id)
        if best is None or c.version > best.version:
            latest[c.doc_id] = c
    return sorted(latest.values(),
                  key=lambda c: (AUTHORITY[c.kind], c.effective_from), reverse=True)

Deterministic selection: current, in effect, most authoritative first.

Old FAQ versus current policy

Synthetic data: kb-refunds version 4 (policy, effective 2026-03-01) says 30 days. kb-faq version 2 (FAQ, effective 2025-06-01) says 14 days. Step 1: retrieval returns both. Step 2: the usable() filter keeps both, since both are current versions of different documents. Step 3: ranking puts the policy first because policy outranks FAQ. Step 4: a tagged fact check finds refund_window_days with values 30 and 14, so the answer cites the policy and adds a stale-source record for kb-faq. Expected evidence: answer says 30 days, cites kb-refunds#s2, and the stale report lists kb-faq#s4.

python
facts = [('kb-refunds#s2', 'policy', 30), ('kb-faq#s4', 'faq', 14)]
AUTH = {'policy': 3, 'faq': 2, 'ticket_note': 1}
ranked = sorted(facts, key=lambda f: AUTH[f[1]], reverse=True)
winner, others = ranked[0], ranked[1:]
stale = [sid for sid, _, v in others if v != winner[2]]
print(winner[0], stale)  # kb-refunds#s2 ['kb-faq#s4']

Two current policies disagree

Synthetic data: kb-refunds#s2 (policy, effective 2026-03-01) says 30 days and fin-guide#s3 (policy, effective 2026-04-01, visible to the caller) says 21 days. Both are current and equally authoritative. Step 1: filtering keeps both. Step 2: the fact check finds a conflict at the same authority level. Step 3: the response is escalated with reason conflicting_sources and a conflicts list. Expected evidence: no number is presented as the answer; both source IDs appear; the escalation record names the policy owners. Rollback: none needed; the fix is a content change by the owners.

json
{
  "status": "escalated",
  "reason": "conflicting_sources",
  "text": "The refund policy says 30 days; the finance guide says 21 days.",
  "source_ids": ["kb-refunds#s2", "fin-guide#s3"],
  "conflicts": [["kb-refunds#s2", "fin-guide#s3"]]
}

Quick reference

  • Store version, effective_from, effective_to, kind and owner on every chunk
  • Filter superseded and out-of-date rows in SQL, before ranking
  • Rank by authority first, then by effective date within the same kind
  • Tag key facts (refund_window_days = 30) so conflicts can be found without a model
  • Unresolved conflict: status escalated, reason conflicting_sources, list both IDs
  • Keep old versions for audit; exclude them from normal retrieval

Common mistakes

  • Leaving old versions in the index and hoping the prompt will tell the model to prefer new ones.
  • Sorting only by date, so a recent informal note outranks the official policy.
  • Hiding a real contradiction by letting the model blend two values into one confident answer.

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1Which metadata lets you skip a policy that only starts next month?

Question 2

2A ticket note from yesterday contradicts the current signed policy. What should the answer use?

Question 3

3Why filter superseded versions in the query instead of telling the model to ignore them?

Question 4

4Two current policies of equal authority give different values. What is the right status?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    Add effective_from, effective_to and kind columns to your chunks table and write a query that returns only chunks in effect today.

  2. Exercise 2medium

    Write a function that takes ranked chunks with tagged facts and returns either a winner or a conflict list when equal-authority sources disagree.

  3. Exercise 3hard

    Create four fixture cases (superseded version, future-dated policy, stale FAQ, equal-authority conflict) and a test that checks the status and cited IDs for each.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Should I delete old document versions?
Usually not. Keep them for audit and historical questions, but exclude them from normal retrieval with a superseded flag or a current-version table.
Can the model decide which source is right?
It can help spot disagreements, but the trust rules should live in your code. That keeps decisions consistent and testable.
What if a document has no effective date?
Use the publish or ingest date as a fallback and record that it is a fallback. Ask the content owner to add a real date.

Go deeper

ShareXLinkedInWhatsApp