Skip to main content

Learn the Basics of Grounding

Learning Objectives

After completing this unit, you’ll be able to:

  • Understand the concept of grounding an agent and why it helps.
  • Clarify how grounding and retrieval augmented generation (RAG) are related.
  • Describe the different types of data that can be used as data sources for Agentforce.
  • Preview data security methods and tools available within Agentforce.

Before You Begin

We know you’re eager to learn about agents and grounding them with data as we roll out new generative artificial intelligence (AI) tools. Before you begin, consider completing this recommended content.

The Einstein Generative AI Glossary of Terms also covers many of the terms used in this badge, such as large language models (LLM), prompts, grounding, hallucinations, toxic language, and more.

Calibrate Your AI Agent with Relevant Content

Salesforce developed Agentforce to help you quickly deploy accurate and relevant AI agents. Agentforce includes a comprehensive suite of tools so you can implement AI-based automation with agents. Your agents can be calibrated by grounding them in your enterprise data and systems. This ensures agents have access to the most up-to-date information, which makes them more accurate and more relevant than agents that aren’t grounded. Grounding agents leads to better decision-making and more effective actions.

Grounding gives ‌LLM domain-specific knowledge and customer information. When you ground AI by giving a model access to verifiable data sources, the model can generate more accurate outputs and reduce the risk of hallucinations. Grounding data sources can include structured data, like Excel spreadsheets and CRM data, as well as unstructured data, like PDFs, chat logs, email messages, and blog posts.

Learn more about LLMs in the Large Language Models Trailhead module.

Do You Need to Connect Structured Data or Unstructured Data?

Before you can connect your data to an agent, you need to know the difference between structured and unstructured data.

Structured data is organized in a predefined format with known metadata. It’s easy to search, analyze, and integrate structured data. Examples include data from Salesforce objects like Accounts, Contacts, and Cases.

Unstructured data lacks a predefined format with unknown metadata. Examples include emails, chat logs, social media posts, or documents. While more challenging to process, unstructured data can provide valuable insights. To connect this data to Agentforce, you might use natural language processing (NLP) tools or data extraction services to convert it to a structured format.

Structured data is more seamlessly integrated with agents using APIs or integrations, and it provides for automated analysis. On the other hand, unstructured data requires preprocessing before it can ground your agent. By mastering the connection of both structured and unstructured data, you unlock a wealth of information to enhance your agent’s performance and your customer service.

Next, take a look at retrieval augmented generation (RAG), which helps most with unstructured data.

Grounding with Retrieval Augmented Generation

Grounding and RAG are layered to enhance the performance of LLMs, but they work in different ways. Let’s break them down.

Grounding

In general, grounding is the idea of infusing an LLM prompt with the information that the model needs to consider when processing a request. Grounding instructs a model on a fixed set of structured data or documents to ensure that its responses are accurate and relevant. This is helpful because LLMs, which are frequently used with agents, are trained on general rather than context-specific knowledge or proprietary information. Grounding provides information to LLMs that anchors the LLM’s responses to specific, reliable data sources, which helps to prevent the LLM from generating incorrect or outdated responses. This is essential for maintaining trust and accuracy.

Grounding instructs a model on a defined set of structured data or documents to encourage responses that are accurate and relevant. This approach is ideal for scenarios where the information is well-defined and doesn’t change frequently, such as historical archives, or legal or regulatory documents. For example, a legal assistant agent that needs to provide accurate citations from a specific set of laws and regulations would benefit from grounding.

Retrieval-Augmented Generation

RAG is a form of grounding that combines the power of retrieving information in real time with generating a response. RAG is suitable for environments where information is constantly updated. In this approach, an LLM retrieves relevant, recent information from a trusted source, such as a collection of documents, and then generates a response based on that retrieved data. This two-step process ensures that the agent’s responses are both informed and appropriate. For instance, if a customer asks about a product feature, RAG can find the latest feature details in your knowledge base and generate a detailed, accurate response. RAG is particularly effective for handling complex queries and providing comprehensive, data-driven answers.

Both techniques have their strengths. Grounding focuses mostly on structured data and is ideal for ensuring accuracy and relevance, while RAG is a form of grounding that excels with unstructured data to provide detailed and rich responses within the context or guardrails of an agent.

Configure AI Agents with Security and Trust

The security and integrity of the data is built into the foundations of an AI agent–Agentforce security isn’t an afterthought. There are robust and flexible security tools available during your development process. Check out Trusted Agentic AI and Maintain Trust with Agentforce Actions to learn more details about managing security in your AI agent.

To bolster security, use the principle of least privilege, strong authentication methods, and identity and control access confirmation tools. For insight into your agents, Agentforce enables you to monitor and audit access logs. Another security measure includes designing actions with specific boundaries. Finally, Agentforce supports data masking techniques to hide sensitive data from unauthorized users, ensuring compliance with data protection regulations.

To make grounding with data practical and effective, you need to understand some methods to use it in Agentforce. You explore those two ideas next.

Resources

在 Salesforce 帮助中分享 Trailhead 反馈

我们很想听听您使用 Trailhead 的经验——您现在可以随时从 Salesforce 帮助网站访问新的反馈表单。

了解更多 继续分享反馈