---
schema_version: "1"
id: a648418992beee8b82023798be4bd8ae591ea18809e3201b1de2760dcca44f41
title: Using Retrieval Augmented Generation
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/data/264-0-0/c360_a_rag_overview.md
canonical_url: https://help.salesforce.com/s/articleView?id=data.c360_a_rag_overview.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 1623a1f9fd8cb724d6a02d93b074c8f0d5de5df063b6fa37d112839866f6041c
description: Retrieval Augmented Generation (RAG) in Data 360 is a framework for grounding large language model (LLM) prompts. By augmenting the prompt with accurate, current, and pertinent information, RAG improves the relevance and value of LLM responses for users.
products:
  - Data 360
release: "264"
---
# Using Retrieval Augmented Generation

Retrieval Augmented Generation (RAG) in Data 360 is a framework for grounding large language model (LLM) prompts. By augmenting the prompt with accurate, current, and pertinent information, RAG improves the relevance and value of LLM responses for users.

When you submit an LLM prompt, RAG in Data 360:

1. Retrieves relevant information from structured and unstructured data indexed in Data Cloud’s vector database
2. Augments the prompt by combining this information with the original prompt
3. Generates a prompt response

It’s helpful to think of RAG in two main parts: offline preparation and online usage.

![Architecture overview of Retrieval Augmented Generation, or RAG](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/data_cloud/images/c360_a_rag.png)

## Offline Preparation

To implement RAG, start by connecting structured and unstructured data that RAG uses to ground LLM prompts.

Data 360 uses a vector database to manage unstructured data. The vector database contains a collection of structured and unstructured content (a search index) that is indexed in a search-optimized way. Content can be ingested from a variety of sources and file types. Some examples of unstructured content used with RAG include service replies, cases, RFP responses, knowledge articles, emails, and meeting notes.

Offline preparation involves these steps:

1. Connect your unstructured data.
2. Create a search index configuration to chunk and vectorize the content.
    
    Chunking breaks the text into smaller, semantically meaningful units, and vectorization converts chunks into numeric representations of the text that capture semantic similarities.
3. Store and manage the search index in Data 360.
    
    Retrievers serve as the bridge between search indexes and prompt templates. Retrievers further refine the search criteria and retrieve the most relevant information used to augment prompts. To support a variety of use cases, you create custom retrievers in AI Models (formerly Einstein Studio). To learn more, see [Retrieve Data](https://help.salesforce.com/s/articleView?id=data.c360_a_ai_retriever.htm&language=en_US).

## Online Usage

The final piece of the RAG implementation is to call a retriever in a prompt template. For a given prompt template, the prompt designer can customize retriever query and result settings to populate a prompt with the most relevant information.

Online usage involves these steps:

1. The retriever is invoked with a dynamic query initiated from the prompt template.
2. The query is vectorized (converted to numeric representations). Vectorization enables search to find semantic matches in the search index.
3. The query retrieves the relevant context from Data 360’s vector database.
4. The original prompt is populated with the information retrieved from the search index.
5. The prompt is submitted to the LLM, which generates and returns the prompt response.

Many LLMs were trained generally across the Internet on older content. With RAG, prompt template users can provide the LLM with the most accurate, up-to-date information, as well as bring proprietary data to the LLM without retraining and fine-tuning the model, creating generated responses that are more pertinent to their context and use case.

#### See Also

- [_Salesforce Help_: Manage Retrievers in Einstein Studio](https://help.salesforce.com/s/articleView?id=data.c360_a_search_index_ground_ai.htm&release=264.0.0&type=5 "Grounding Data 360 search on unstructured and structured data enhances your use of generative AI, analytics, and automation tools across Salesforce. Grounding brings customer-specific data, including diverse forms of unstructured data (such as text documents, multimedia files, social media content, web content, chat logs, sensor data, and customer feedback), into applications like Agentforce, Tableau, and Flow Builder. This alignment results in more accurate and relevant AI-generated content, deeper insights from analytics, and more efficient automation workflows for your teams and customers.")
- [_Salesforce Help_: Ground with Retriever Augmented Generation (RAG) in Data 360](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_ground_rag.htm&type=5&language=en_US)
- [_Trailhead_: Retrieval Augmented Generation: Quick Look](https://trailhead.salesforce.com/content/learn/modules/retrieval-augmented-generation-quick-look)