Grounding: records, data graphs, knowledge and retrieval
How agents get the facts they need: record and merge-field grounding, Data 360 data graphs, Knowledge and RAG with retrievers and the Agentforce Data Library, variables, and managing context size, freshness and access.
Simple explanation
Grounding gives the model the facts it needs so answers are accurate and specific.
| Source | How | Best for |
|---|---|---|
| Record data | Actions or prompt merge fields | Current case, order, account |
| Data graphs (Data 360) | Precomputed JSON for a profile | Customer context across systems |
| Knowledge and documents | Retrievers over search indexes (RAG) | Policies, manuals, how-tos |
| Agentforce Data Library | Sets up ingestion, index, retriever, prompt and action with defaults | Quick RAG start |
| External systems | API or MCP actions | Live data outside Salesforce |
| Variables | Conversation state | Verified identity, selected items |
Design rules
- Only what's needed: large contexts cost more and can confuse the model.
- Fresh enough: match data latency to the question.
- Access-controlled: the agent should only retrieve what the user may see.
- Cite sources for knowledge answers.
- Refuse when nothing relevant is found rather than guessing.
Real-world analogy
Grounding is handing the new hire the right file and the right page of the manual before they answer the customer, instead of hoping they remember.
Worked example
A travel company's agent loads a data graph with the traveller's upcoming bookings and loyalty tier, retrieves the relevant fare rules through a filtered retriever, and calls the airline API for live seat availability. It cites the fare rule it used and hands over when rules conflict.
Diagram
Key points
- Ground with records, data graphs, retrieval and live APIs.
- Use ADL for a fast RAG start; custom retrievers for control.
- Keep context minimal, fresh and access-controlled.
- Cite knowledge sources; refuse when unsure.
- Variables anchor context to the verified user.
Limits and gotchas
- Retrieval quality depends on content quality and chunking.
- Large grounding payloads increase latency and cost.
- Data 360 consumption applies to retrieval and graphs.
- Wrong access design can leak data between customers.
π€ How to say this in an interview
Match each information need to a grounding method, then cover access, freshness, size and citation.
Common follow-ups
Knowledge answers are correct but slow. What do you check?
Retriever result count and chunk size, grounding payload size, index type, and whether a simpler record lookup would suffice.
How do you stop retrieval returning internal-only articles to customers?
Audience filters on retrievers or separate indexes, data categories, and tests that try to retrieve restricted content.