Sub topic 9
Grounding responses with knowledge and CRM data
This chapter assumes you know basic Salesforce objects and records, have read the earlier chapters on topics, instructions, and actions, and have a general idea of what a large language model does.
What grounding means
A large language model (LLM) writes fluent text from patterns it learned in training. It does not know your orders, your policies, or your customers. Grounding is the practice of giving the model relevant company data at request time, so its answer is based on that data and not on guesses.
In Agentforce, grounding data comes from two places:
- Knowledge: articles and documents that describe policies, procedures, and product information.
- CRM data: records such as cases, orders, and contacts, retrieved through actions or merged into instructions.
Grounding with knowledge
Knowledge grounding suits questions with written answers, such as "What is your return window?" The agent finds the relevant passages and uses them to write its reply.
A common setup has three parts:
- Source content, such as Salesforce Knowledge articles or uploaded files.
- A search index that Data Cloud builds over that content, so passages can be found by meaning and not only by exact words.
- A knowledge action in a topic that searches the index and returns passages to the reasoning engine.
The model then writes an answer from the returned passages. Your topic instructions should tell it to answer only from retrieved content. For example: "Answer using only the knowledge returned by the action. If nothing relevant is returned, say you do not know and offer a human agent."
Grounding with CRM data
Record-specific questions such as "Where is order 10042?" need live data. A knowledge article cannot answer them. The agent gets this data by calling an action, such as the Get Order Status Apex action or a Flow that reads a record. The reasoning engine places the result into the conversation and writes the reply from it.
Two points matter here:
- Access still applies. The data an action returns is limited by the identity it runs under, as covered in the identity chapter. A service agent sees only what its agent user can see. An employee agent sees only what that employee can see.
- Return only what the reply needs. Every field you return can end up in the response.
Choosing the right source
| Question type | Best source | Example |
|---|---|---|
| Policy or how-to | Knowledge | "How do I reset my password?" |
| State of a specific record | CRM action | "What is the status of my order?" |
| Both in one request | Knowledge and CRM action | "Can I return order 10042?" |
Common errors
- Stale or thin content. If articles are outdated or missing, the agent returns outdated answers or none. Review the sources before you blame the model.
- Vague instructions. Without a rule to answer only from retrieved data, the model may fill gaps from general knowledge.
- Unpublished articles. Draft or inaccessible articles are not searchable, so the agent seems to know nothing.
- Over-broad actions. Returning whole records exposes fields you did not intend to share.
The Einstein Trust Layer, covered next, adds protections around the data you send to the model.
Exercise
A customer asks, "Can I still return order 10042?" Which grounding sources does the agent need, and why?
Show answer
Both. A CRM action must fetch the order's date and status, because only live record data holds those. Knowledge must supply the return policy, such as the return window. The agent compares the two to write its answer.