Choosing useful sources
6 min read
The agent trusts what it reads
A model has no instinct for which page to believe. If a retrieved passage says that refunds take 90 days, the agent will write that down as fact, even when the policy says 30. The wording of the answer will be fluent either way. Fluency is not evidence.
That is why source choice is a design decision, not a detail. It is the best defence against an AI hallucinationAn answer that sounds confident but is false. The model wrote text that fits the pattern instead of text that is true. that comes from bad input, and it decides how much you can trust Retrieval-augmented generationA method where an app searches sources at question time and adds selected passages to the model's context. Updated information can inform later answers once it is available to retrieval, but the results and answers still need checking. in practice.
Three questions for every source
Ask these before you add a source to an agent's reach.
- Is it relevant? Does it cover the question, or only the topic? A page about shipping in general does not answer a question about shipping to Norway.
- Is it trusted? Who wrote it? An official policy page, a database you control and a signed contract rank above a forum post or an anonymous blog.
- Is it current? When was it last updated? A price list from last year is worse than none, because the agent will not know that it has expired.
A source can pass one test and fail another, so check all three.
Rank the sources in code
When several sources return passages, the program can rank them with simple rules before the model reads any.
from datetime import date
TRUST = {"policy": 3, "help_centre": 2, "forum": 1}
def rank(passages, today=date(2026, 11, 15)):
def value(passage):
age_days = (today - passage["updated"]).days
fresh = 1 if age_days < 365 else 0
return (TRUST[passage["kind"]], fresh)
return sorted(passages, key=value, reverse=True)
passages = [
{"kind": "forum", "updated": date(2026, 10, 1), "text": "Refunds take 90 days."},
{"kind": "policy", "updated": date(2026, 6, 1), "text": "Refunds are accepted within 30 days."},
]
print(rank(passages)[0]["text"])The policy page ranks first, even though the forum post is newer, because trust comes before freshness in this rule. Choose the order that fits your data. For a news agent, freshness might come first.
When sources disagree
Disagreement is a signal, not a nuisance. Pick one of these responses and make it a rule in the instructions.
- Prefer the more trusted source when one clearly outranks the other.
- Show both and say where each came from, when the user should decide.
- Say that you do not know when the sources conflict and nothing ranks higher.
Whatever the choice, ask the agent to name its sources in the answer. A citation lets a reader check the claim in seconds and lets you find the bad source when something goes wrong.
Which source wins?
A company policy page and a forum post disagree about the refund window.
Trust usually outranks freshness for policy. Pick a clear rule for your data and put it in the instructions.
What should the agent do?
Two equally trusted sources give different prices, and nothing ranks higher.
Disagreement is a signal. Do not hide it behind a confident single answer.
Why ask for citations?
You want to trust an agent's answer.
A named source lets a person verify a claim quickly and helps you find the page that misled the agent.
Your reading position is saved
0 of 20 complete
Lesson complete
Choosing useful sources
Up next