Lesson 4 of 6
Grounding: documents and business data
9 min
Listen to this lesson
Clerks do not only ask "where is my order?" They ask "why hasn't it shipped?", "what's the cut-off for same-day shipping from Detroit?" and "does the fleet service policy allow partial deliveries?" Those answers live in documents, not APIs. Grounding gives the agent that knowledge, so it answers from Contoso's own content instead of the model's general training.
Two kinds of grounding
| Aspect | Document grounding | Business data grounding |
|---|---|---|
| Source | Policies, contracts, manuals, runbooks | Live records through skills and APIs; data products for history |
| How | Documents are chunked, embedded and retrieved at question time (RAG) | Tools return current, authorized records |
| Freshness | As fresh as the last document sync | Real time (APIs) or as of the last data product refresh |
| Fleet example | "Partial deliveries allowed for fleet orders over 20 pieces" | "Order 1000457: delivery 80001234 goods-issued" |
| Main risk | Outdated or conflicting documents | Wrong authorizations or stale data |
Setting up document grounding in the classic edition
- Provision SAP AI Core (with the generative AI hub) and an object store; create a destination for each in the BTP cockpit.
- In the SAP Build lobby, open Control Tower > Document Grounding, select the AI Core and object store destinations, and wait until the status changes from Pending to Completed (SAP's tutorial warns it can show Error for a while first).
- Upload the approved documents to the object store location used for grounding: Contoso's fleet service policy, shipping cut-off times for shipping points 1710 and 1720, and the Great Lakes service terms.
- In the agent editor, add document grounding as a tool and describe precisely when to use it ("policy and process questions; never for order status").
- Test with questions whose answers sit in one document, in two documents, and in none.
Business data grounding works differently. For current facts, the agent calls skills, as in lesson 3. For history and cross-system context, such as "how often has Great Lakes received partial deliveries this year?", the better source is a governed data product or an analytic model in SAP Datasphere within SAP Business Data Cloud, exposed to the agent as a tool. Course sap-dap-101 explains why that data must be owned, fresh and reconciled before an agent relies on it. Do not paste extracts of business data into the document index: they go stale on the first day and bypass the authorizations that a tool call respects.
Preparing documents
Retrieval quality depends on the documents more than on the model. Course sap-ai-204 covers retrieval in depth; the practical rules for an agent are short. Use one owner and one current version per topic, and remove superseded copies. Write rules as explicit sentences with numbers and units ("orders of 20 pieces or more") rather than tables of codes. Give each document a title, owner, effective date and scope. Keep personal data out: the policy may name roles, not people. Finally, keep restricted content (for example the Great Lakes credit review) out of a grounding index that every clerk's agent can read; documents in one index are available to every user of that agent unless you design access controls for retrieval.
| Document | Owner | Effective | In index? |
|---|---|---|---|
| Fleet service policy v3 | Maria | 2026-09-01 | Yes |
| Shipping cut-off times, shipping points 1710 and 1720 | Marcus | 2026-07-15 | Yes |
| Great Lakes service terms (no credit data) | Fleet Sales | 2026-01-01 | Yes |
| Great Lakes credit review | Dan | 2026-01-01 | No: restricted |
| Fleet service policy v2 | Maria | Superseded | No: removed |
Contoso's grounding register: every indexed document has an owner and an effective date; restricted and superseded documents stay out.
What would you do?
During testing, the agent tells a clerk that the Detroit same-day cut-off is 14:00. The current policy says 13:00; an old version said 14:00. What is the right fix?
- Ground rules and explanations in documents; get facts about records from tools.
- Classic edition document grounding needs SAP AI Core and an object store, set up in Control Tower > Document Grounding.
- One owner and one current version per topic; no personal or restricted content in a shared index.
- Test single-document, multi-document, no-answer, superseded and restricted cases.
Check your understanding · not graded
Lesson check
1. What does document grounding in the classic edition require besides the agent?
2. Which question should a tool answer rather than document grounding?
3. Why keep the Great Lakes credit review out of the shared grounding index?
4. The agent quotes a superseded policy. Which fix lasts?