Skip to content

AIMI 106 · Module 2

Agentic Retrieval & Trust

Core question: how do you know a retrieval assistant found the right evidence, cited it correctly and stayed silent when there was nothing to find?

Start Section 1
0 / 6 completed
Sync my progressJoin a session to keep progress across devices and share it with your instructor

Info

After you join, your completed lesson numbers are sent to your instructor together with your learner code, so they can see your progress. Use the codes your instructor gave you or the email you sign in with, and do not enter your name, company secrets or other personal data. Progress is kept with the rest of that session's data.

Learning objectives

  • Describe a multi-step agentic retrieval loop and the limits it needs
  • Require grounded answers with document and page/section citations
  • Design abstention behaviour for questions without supporting evidence
  • Design a 10-question evaluation set with at least two no-answer questions
  • Define hit@k, citation accuracy, answer groundedness and abstention appropriateness, and state small-sample limits

Multi-Step Agentic Retrieval

10 min

Multi-Step Agentic Retrieval

Learning objective: describe how an agentic retrieval loop breaks a question into lookups, checks what it found and decides whether it has enough evidence to answer.

An agentic retrieval loop
  1. Plan: split the question into sub-questions (for example one per report)
  2. Retrieve: search with filters for each sub-question
  3. Check: is the evidence relevant, from the right document and version?
  4. Retrieve again or stop, within a fixed step limit
  5. Compose: answer only from the evidence, with citations, or abstain

Single-shot RAG

  • One search, one answer
  • Simple to log and evaluate
  • Struggles with comparisons and multi-part questions

Agentic retrieval

  • Several searches with a check between them
  • Better for "compare A and B" questions
  • Needs a step limit, a log of every lookup and a stop rule

Warning

Text inside a retrieved document is data, not instructions. If a passage says "ignore previous rules", the assistant must not follow it. This is prompt injection; log it as a failure if it changes behaviour.
Check yourself

Why should an agentic retrieval loop have a fixed step limit and a log of every lookup?

Why should an agentic retrieval loop have a fixed step limit and a log of every lookup?

Key takeaway: Agentic retrieval adds planning and checking, so it also needs a step limit, a lookup log and a clear stop rule.

Grounding and Citations

10 min

Grounding and Citations

Learning objective: require every factual claim in an answer to be grounded in a retrieved passage and cited with document and page or section (106-CLO3).

Citation quality (illustrative patterns, not real documents)
PatternExampleVerdict
Specific and checkable[report-b, Risk Factors > Liquidity, page as loaded]Good: a reader can open the exact place
Too vague[Report B]Weak: the reader must search the whole document
Wrong locationCitation points to a section that does not contain the claimFail: citation inaccurate
InventedA page or section that does not exist in the documentCritical fail: fabricated source
  • One claim, one or more citations; no uncited factual sentences
  • Quote or closely paraphrase; do not add numbers or causes the passage does not state
  • Keep opinion and comparison language clearly separate from what the documents say
  • A human checks a sample of citations against the source before anything is published
Check yourself

An answer says "Report A expects the risk to ease next year [report-a, Risk Factors]". The cited section describes the risk but says nothing about next year. How should this be judged?

An answer says "Report A expects the risk to ease next year [report-a, Risk Factors]". The cited section describes the risk but says nothing about next year. How should this be judged?

Key takeaway: A citation must support the exact claim it is attached to; a correct document with an unsupported claim is still a failure.

Abstention When Evidence Is Missing

10 min

Abstention When Evidence Is Missing

Learning objective: design how the assistant responds when the documents do not contain the answer. In financial media, a confident guess can mislead readers; saying "the documents do not say" is a correct answer.

Unsafe behaviour

  • Fills the gap from general knowledge without saying so
  • Invents a figure or a page reference
  • Answers a forecast or investment question as if the report said it

Appropriate abstention

  • States that the loaded documents do not contain the information
  • Shows what was searched and what was closest
  • Suggests where a human could look, without guessing the answer
Abstention response (illustration)

The loaded versions of Report A and Report B do not state this figure. The closest passage is in Report A, Risk Factors, which describes the risk qualitatively. A reporter should check the company's official filings before reporting a number.

Info

Over-abstention is also a failure: refusing a question the documents clearly answer makes the assistant useless. Evaluate both directions.
Check yourself

A user asks which of the two companies is the better investment. Neither report addresses this. What is the appropriate response?

A user asks which of the two companies is the better investment. Neither report addresses this. What is the appropriate response?

Key takeaway: Abstaining without evidence is a correct answer; inventing one is a critical failure, and refusing answerable questions is a failure too.

Evaluation Set Design

12 min

Designing the Evaluation Set

Learning objective: design a 10-question evaluation set that tests retrieval, grounding, citation and abstention, with the expected evidence written down before you run the assistant (106-CLO4).

A balanced 10-question set (suggested mix)
Question typeWhat it testsSuggested count
Single-document factRetrieval and citation of one passage3
Cross-document comparisonMulti-step retrieval across Report A and Report B3
Detail or table lookupChunking of tables and exact terms2
No-answer questionAbstention when neither report contains the answerAt least 2
  • For each question record: question id, question text, answerable (yes/no), expected document, expected page or section, and key points of the expected answer
  • Write expected evidence by reading the documents yourself, before running the assistant
  • Make no-answer questions realistic, for example a figure or a forecast the reports do not contain
  • Keep the same 10 questions for every system you compare, including the baseline
Check yourself

Why must expected evidence be written down before running the assistant?

Why must expected evidence be written down before running the assistant?

Key takeaway: Ten questions, expected evidence written first, at least two no-answer questions, the same set for every system.

Metrics and Small-Sample Limits

10 min

Metrics and Small-Sample Limits

Learning objective: score each question with four metrics and report the results with honest limits.

Four metrics for this course
MetricQuestion it answersHow to score per question
hit@kWas the expected passage among the top k retrieved chunks?Yes / no for answerable questions (state the k you used)
Citation accuracyDoes each citation exist and point to a passage that supports the claim?Share of citations that check out
Answer groundednessIs every claim in the answer supported by the retrieved evidence?Grounded / partly / not grounded
Abstention appropriatenessDid it abstain on no-answer questions and answer the answerable ones?Appropriate / missed abstention / over-abstained

Warning

Small-sample limit: with 10 questions, one question changes a rate by 10 percentage points. Report counts (for example 7 of 8) alongside any rate, say that results are indicative only, and do not claim one system is better on a difference of one or two questions.
Check yourself

Your RAG prototype scores 8 of 10 on groundedness and the baseline scores 7 of 10. What is the most defensible conclusion?

Your RAG prototype scores 8 of 10 on groundedness and the baseline scores 7 of 10. What is the most defensible conclusion?

Key takeaway: Score retrieval, citations, groundedness and abstention per question, and always report counts with the small-sample limit.

Exercise: Evaluation Set Design

8 min

Exercise: Evaluation Set Design

Learning objective: build the evaluation set you will use in the lab, for the Formosa Finance Daily (simulated) assistant that compares risk statements in Report A and Report B.

  1. Start from the template
    Open the evaluation-set CSV and review the example rows and columns.
  2. Write 10 questions
    Cover single-document facts, cross-document comparisons, a detail or table lookup, and at least two no-answer questions.
  3. Write the expected evidence
    For each answerable question, record the expected document, page or section and key points, from your own reading.
  4. Mark the no-answer questions
    For each, note why neither report answers it and what an appropriate abstention would say.
  5. Peer check
    Swap with a partner and confirm each expected citation actually exists in the documents.

Done

Completing this set counts as exercise 2 (aimi106-m2-eval-set-design). You will run both your RAG prototype and a baseline on it in the lab.

Key takeaway: Module summary: trust is measured, not assumed; ground every claim, abstain without evidence, and evaluate on a pre-written set with honest limits.

What next?