ERPClimb logoERPClimb
Grounding and retrieval architecture
SAP Business AI & Jouleintermediate 6 min read

Grounding and retrieval architecture

Free sample lesson · open to everyone

Key takeaway

Grounding supplies retrieved context; it does not make every answer correct. Retrieval must respect authorization, effective dates, source authority and freshness. Evidence supports a specific claim only when it actually contains the relevant information.

In this lessonShow sections

Visual overview

Grounding and retrieval architectureWorked investigation: follow the evidence through each step. Filter: Forbidden company-code documents are never retrieved.; Retrieve: Current policy P2 is preferred over expired P1.; Answer: The answer names the supported current approver.; Audit: An unsupported answer is qualified rather than fabricated.ERPClimb.com · INTERMEDIATE · ORIGINAL TEACHING DIAGRAMGrounding and retrieval architecture11. FilterForbidden company-code documents are never retrieved.22. RetrieveCurrent policy P2 is preferred over expired P1.33. AnswerThe answer names the supported current approver.44. AuditAn unsupported answer is qualified rather than fabricated.Worked investigation: follow the evidence through each stepSynthetic evidence. Verify SAP product, edition, runtime and enabled capabilities.

The situation: a real project scenario

A fictional assistant cites an expired approval policy instead of the current one. This happens when a retrieval index contains both superseded and current versions of a document without clear effective-date metadata, and the superseded version happens to be phrased in a way that scores slightly better against the query.

The result reads fluently and even cites a real source, which makes the error easy to miss in a quick review — it only surfaces when someone checks the cited policy's effective date against today's date, or when the recommended approver turns out to be wrong for the current process.

Explanation

Tutorial outcome

Grounding supplies retrieved context; it does not make every answer correct. Retrieval must respect authorization, effective dates, source authority and freshness. Evidence supports a specific claim only when it actually contains the relevant information.

Prerequisites

Complete chapters 1–5 in this module. Use synthetic fixtures or an authorized sandbox.

Worked case — fictional

A fictional assistant cites an expired approval policy instead of the current one.

Step-by-step investigation

1. Filter

Restrict retrieval to the user's permitted documents and relevant business scope.

Expected evidence: Forbidden company-code documents are never retrieved.

2. Retrieve

Compare current and expired policy fixtures and retain version/effective-date metadata.

Expected evidence: Current policy P2 is preferred over expired P1.

3. Answer

Build only claims supported by retrieved evidence and identify missing information.

Expected evidence: The answer names the supported current approver.

4. Audit

Check each material claim against its cited evidence and test an unanswered question.

Expected evidence: An unsupported answer is qualified rather than fabricated.

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 answer uses current authorized evidence and acknowledges missing information.

Common failure to avoid

Do not treat a citation, high similarity score or fluent explanation as proof of correctness.

Self-check

What makes a citation useful?

Expected reasoning: It supports the specific claim and is appropriate for the user's access and context.

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

Illustrative example
{"documents":[{"id":"P1","status":"expired"},{"id":"P2","status":"current"}],"expectedSource":"P2"}

Loading guided workshop…

Watch out

Common mistakes

Do not treat a citation, high similarity score or fluent explanation as proof of correctness.

A retrieved document can be a strong semantic match for the query and still be the wrong source — an expired policy often resembles the current one closely enough to score well, which is exactly why effective-date and version metadata must be checked, not just relevance.

A related mistake is retrieving broadly and trusting the model to pick the right source itself; retrieval should filter to the user's permitted documents and relevant scope before the model ever sees the candidates, rather than relying on the model to apply access control after the fact.

Teams also sometimes skip testing an unanswerable question, so the first time the assistant fabricates an answer instead of acknowledging missing evidence is in front of a real user.

Do this

Best practices

The answer uses current authorized evidence and acknowledges missing information. Filter retrieval to the user's permitted scope before ranking by relevance, and retain version and effective-date metadata so a current document can be preferred over an expired one even when both match the query.

Build answers only from claims the retrieved evidence actually supports, and test an intentionally unanswerable question to confirm the assistant qualifies uncertainty rather than fabricating a plausible-sounding policy. 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 makes a citation useful? A weak answer says having a citation at all, or a document with a high similarity score — that mistakes retrieval activity for retrieval correctness. A strong answer is specific: the citation must actually support the particular claim being made, and it must be a document the user is authorized to see.

The strongest answers also mention freshness and source authority explicitly — between a current and an expired policy that both mention approvals, the system must prefer the current, authoritative one, not simply the best-matching text.

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 is grounding in generative AI scenarios?

Practise this in an interview

Answer in your own words and get instant feedback, the way an interviewer would judge it.

1Design a retrieval architecture for an assistant that answers questions about internal procurement policies.

2When would you use a live system query instead of document retrieval?

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.