Concept 6 of 16Designing agents

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.

Your confidence:Not rated

Simple explanation

Grounding gives the model the facts it needs so answers are accurate and specific.

SourceHowBest for
Record dataActions or prompt merge fieldsCurrent case, order, account
Data graphs (Data 360)Precomputed JSON for a profileCustomer context across systems
Knowledge and documentsRetrievers over search indexes (RAG)Policies, manuals, how-tos
Agentforce Data LibrarySets up ingestion, index, retriever, prompt and action with defaultsQuick RAG start
External systemsAPI or MCP actionsLive data outside Salesforce
VariablesConversation stateVerified 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

Rendering 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.