Retrieval evaluation, freshness and abstention
Free sample lesson · open to everyone
Evaluate retrieval and answer generation independently. A model cannot cite a current policy that retrieval never supplied. Use labeled synthetic queries to test relevance, scope and freshness, then require abstention when evidence is missing or contradictory.
In this lessonShow sectionsHide sections
Visual overview
The situation: a real project scenario
A fictional retrieval change increases recall but mixes current and expired policies in the same answer. This is a realistic regression: a team widens a retrieval filter or relaxes a similarity threshold to "find more relevant documents," recall metrics improve, but the richer result set now includes an expired policy alongside the current one for the same query.
Because the evaluation only tracked whether relevant content was retrieved at all, not whether source freshness and authority were disambiguated, the regression isn't caught until a labeled query set specifically tests for the current-versus-expired conflict.
Explanation
Tutorial outcome
Evaluate retrieval and answer generation independently. A model cannot cite a current policy that retrieval never supplied. Use labeled synthetic queries to test relevance, scope and freshness, then require abstention when evidence is missing or contradictory.
Prerequisites
Complete chapters 1–13 in this module. Use synthetic fixtures or an authorized sandbox.
Worked case — fictional
A fictional retrieval change increases recall but mixes current and expired policies in the same answer.
Step-by-step investigation
1. Label
Create a query set with expected current documents and explicitly irrelevant or forbidden examples.
Expected evidence: Query Q15 should use policy P-current.
2. Retrieve
Measure whether the relevant permitted evidence appears before evaluating answer prose.
Expected evidence: P-current is missing in the failing retrieval.
3. Disambiguate
Apply the supported metadata and effective-date strategy and inspect contradictory sources.
Expected evidence: Expired P-old no longer drives the answer.
4. Abstain
Test an unanswerable question and require a clear limitation rather than a fabricated policy.
Expected evidence: The assistant states that evidence is insufficient.
Try it yourself
Reproduce the synthetic input from the example below in a local fixture or authorized sandbox. Follow each step, record the observed result, and explain any mismatch before continuing. Do not treat the expected evidence as a result observed in your SAP tenant.
Acceptance check
The evaluation distinguishes retrieval failure from answer failure and tests honest uncertainty.
Common failure to avoid
Do not maximize retrieved document count without checking relevance, access and effective dates.
Self-check
What should happen when no authorized evidence supports the requested policy?
Expected reasoning: The assistant should explain the evidence gap and avoid inventing the rule.
Edition and release scope
Check the linked SAP documentation for your product, runtime, region and enabled service plan. The worked case is a simulation; these steps were not executed in a customer SAP tenant.
SAP references
References checked 2026-10-30. SAP material supports the named concepts; the case, fixture and acceptance checks are original ERPClimb teaching material. No SAP tenant execution or certification is claimed.
[SAP Learning — Advanced generative AI techniques](https://learning.sap.com/courses/using-advance-ai-techniques-with-sap-s-generative-ai-hub) — Grounding, retrieval and output evaluation
Code example
{"query":"current approval rule","expectedDocument":"P-current","missingEvidenceOutcome":"abstain"}Retrieval evaluation, freshness and abstention: evidence walkthrough
Simulated training case. These observations are authored fixtures, not screenshots or results from a customer SAP system.
A fictional retrieval change increases recall but mixes current and expired policies in the same answer.
Before you start
- Complete chapters 1–13 in this module. Use synthetic fixtures or an authorized sandbox.
Check the linked SAP documentation for your product, runtime, region and enabled service plan. The worked case is a simulation; these steps were not executed in a customer SAP tenant.
Label
Create a query set with expected current documents and explicitly irrelevant or forbidden examples.
Expected evidence · simulated
Query Q15 should use policy P-current.
Automatic playback is disabled by your reduced-motion preference. All steps remain available.
Try it, then verify
The evaluation distinguishes retrieval failure from answer failure and tests honest uncertainty.
Watch for: Do not maximize retrieved document count without checking relevance, access and effective dates.
Open the ERPClimb lesson diagram at full sizeSAP references and release scope
References checked 2026-10-30. The linked SAP material supports the named concepts; the scenario, fixtures and acceptance checks are original ERPClimb teaching material. This is not an SAP certification or a tenant-execution claim.
- SAP Learning — Advanced generative AI techniques
Grounding, retrieval and output evaluation
Watch out
Common mistakes
Do not maximize retrieved document count without checking relevance, access and effective dates. Increasing recall is a common "improvement" that actually degrades answer quality if it pulls in both current and expired sources for the same query — the model then has conflicting evidence and may blend or pick the wrong one.
A related mistake is evaluating retrieval and generation together as one pass/fail number, which hides whether a wrong answer came from bad retrieval (the right document was never found) or bad generation (the model ignored evidence that was actually present).
Teams also often fail to test abstention directly: if every evaluation query has an answer, the system is never checked on what it does when no authorized evidence exists, which is exactly when fabrication is most likely.
Do this
Best practices
The evaluation distinguishes retrieval failure from answer failure and tests honest uncertainty. Label synthetic queries with their expected current document, including deliberately irrelevant or forbidden examples, and measure whether relevant permitted evidence was retrieved before judging the generated answer's wording.
Apply the supported effective-date and metadata strategy to disambiguate conflicting sources, and require abstention on an intentionally unanswerable query rather than accepting a fabricated but fluent response. Check the linked SAP documentation for your product, runtime, region and enabled service plan. The worked case is a simulation; these steps were not executed in a customer SAP tenant.
In the interview
Interview angle
What should happen when no authorized evidence supports the requested policy? A weak answer assumes the system will naturally say "I don't know" because models are generally cautious — that's not something to assume, it's something to test explicitly with a labeled query that has no correct answer in the index.
A strong answer requires the evaluation set to include exactly this case and verify the assistant explains the evidence gap rather than inventing a plausible rule. The strongest answers also separate this from a freshness failure — missing evidence and conflicting/stale evidence are different failure modes that need different fixes.
Practice this lesson
Original educational case studies for SAP consultants, not official SAP certification exam questions. Verify product edition and implementation details against the current SAP documentation.
Quick check
0 of 3 questions attempted
Question 1 of 3
What should an assistant do when retrieval finds no relevant authorized source?
Question 2 of 3
A policy changed yesterday, but the assistant answers with the old version. What is the likely cause?
Question 3 of 3
Which metric evaluates retrieval quality specifically?
Practise this in an interview
Answer in your own words and get instant feedback, the way an interviewer would judge it.
1How do you keep a retrieval-based assistant fresh and trustworthy?
2How do you evaluate retrieval separately from answer generation?
Was this lesson helpful?
Keep exploring
Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.