Sub topic 1
Why agents need grounding
Prerequisites
This chapter assumes you have the following background:
- Basic Salesforce administration: objects, fields, and permission sets.
- Familiarity with Salesforce Knowledge articles.
- A general idea of what a large language model (LLM) is.
- Awareness of Agentforce agents, topics, and actions.
You don't need Data Cloud experience yet. Later chapters introduce it.
The problem with ungrounded answers
An LLM generates text from patterns learned during training. It doesn't know your return policy, your support hours, or the steps in your product's setup guide. If you ask it about them, it still produces a fluent answer, and that answer may be wrong.
Common failure modes of an ungrounded agent:
- Invented details. The model states a policy or price that does not exist.
- Outdated facts. The model's training data is older than your latest article.
- Wrong scope. The model gives a generic industry answer instead of your company's rule.
- No source. The customer and your team cannot check where the answer came from.
In a customer-facing agent, each of these is a business risk, not just a quality issue.
What grounding means
Grounding means giving the model relevant, trusted content at the moment it answers, and instructing it to use only that content. The technique that supplies the content is retrieval-augmented generation (RAG). RAG has three steps:
- Retrieve. Search your content for passages that match the question.
- Augment. Insert those passages into the prompt.
- Generate. The model writes an answer based on the passages.
The model's general knowledge is still there, but the prompt tells it to rely on the retrieved excerpts. Because the excerpts come from your own articles, you can update an answer by updating an article. You don't have to retrain a model.
What grounding does and does not guarantee
Grounding lowers the risk of wrong answers. It doesn't remove it. Two things still determine quality:
- Retrieval quality. If the retriever returns the wrong excerpts, or none, the model has nothing correct to work from.
- Instructions. If the prompt doesn't say what to do when excerpts are missing, the model may fall back on general knowledge.
What the rest of the tutorial builds
You will follow Knowledge articles from publication through Data Cloud, into a search index and a retriever. Then you will connect the retriever to a prompt template and to an agent's knowledge action. Finally you will test the answers and troubleshoot problems.
A useful first habit is checking which content is actually available. This query lists the most recently published English article versions:
SELECT Id, Title, UrlName, PublishStatus, Language, LastPublishedDate
FROM Knowledge__kav
WHERE PublishStatus = 'Online'
AND Language = 'en_US'
ORDER BY LastPublishedDate DESC
LIMIT 20Only articles with PublishStatus = 'Online' are published. If an article isn't in this list, an agent can't ground an answer in it.
Exercise
A customer asks your agent about a policy that changed last week. The agent answers with the old policy. Name two places in the grounding chain where the cause might be, and say why grounding alone would not prevent this.
Show answer
The updated article may not be published (or not yet ingested into Data Cloud and indexed), so the retriever still returns the old content. Alternatively, the prompt may not require the model to use only retrieved excerpts, so it answers from general knowledge. Grounding only works when current content is retrievable and the instructions enforce its use.