How To Get Better AI Answers Using Retrieval Augmented Generation | Salesforce

Retrieval Augmented Generation lets AI answer questions using your actual data instead of guessing. Salesforce's Data Cloud connects unstructured data, runs semantic search through embeddings, and builds grounded prompts so answers come with citations.
Chapters
What is Retrieval augmented generation? And how can Salesforce help us use it to get better answers from generative AI? Retrieval augmented generation is a technique that allows us to use semantic search to retrieve relevant snippets of content that we can use to get generative AI answers that are grounded in our unstructured data. But hold on, let's rewind. Why do we need retrieval augmented generation? Well, we know that great AI requires great data, and we know that most of our data is unstructured data. Call transcripts, emails, documents. And we know there are questions, like this sales rep, asking about renewal contract concerns based on previous conversations that will only be answerable if AI can tap into this data. So how do we use retrieval augmented generation to help generative AI compose answers based on this data? Well, this involves three major unstructured data, semantic search, and semantic retrievers. Let's talk through them one at a time, starting with unstructured data. These are just a few examples of unstructured data, and there are countless answers and insights scattered across this data, but there isn't a consistent way of accessing any of it, which makes it hard for AI to compose answers based on it. But thankfully, Data Cloud has tools for connecting all this data. Once connected, it will be ingested into a data lake, where it becomes part of our enterprise graph, making all our enterprise data accessible, just like any other data in Salesforce, which is why it's available here on this contact record. But how do we find snippets of content in this data that would answer the sales rep's question? Well, this leads to our second ingredient, semantic search. The search we are most used to is a keyword search. That is what we're doing in a document when we press Ctrl F and search for a word. But this isn't going to help us find renewal contract concerns, because what we need is a much smarter search. So let's run an experiment. I've created a script that accepts a natural language search phrase like renewal contract concerns. And when I press enter, a lot of things are going to happen. First, we'll retrieve those call transcripts. Then we'll turn them into embeddings, which are numeric representations of words and their meaning that will be loaded into a vector database that we'll use to perform a semantic search, which returns snippets of related content that we could use to ground AI in our unstructured data. This is what is involved in a semantic search. But how can Salesforce help? Well, thankfully, Data Cloud makes it easy to set up Semantic search on any unstructured data source. It literally takes about three clicks and we're done. Behind the scenes, those vector embeddings will be automatically created and loaded into a vector database, making our semantic search real and available to enhance our generative AI results. But this leads to our third and final ingredient, semantic retrievers. Behind every generative AI result is a prompt which is just a question we ask of AI. And here inside Prompt Builder, we can use our business data to ask a great question. In this case, I want to take our sales rep's original question and summarize any data related to it. But how do I find that data? Well, thankfully, each time we create a semantic search in data cloud, we're also creating a semantic retriever which we can use to search for content related to our sales rep's question and add it to to our prompt. But let's test it by emulating our sales rep's original question. Now, a lot of things just happened. On the left we can see our sample question, but we also see content snippets related to this question along with where they came from. And it's this new dynamic grounded prompt that is sent to the large language model, enabling AI to know real time permissions based things about our business that it otherwise would not know. And that's why we get generative AI answers with citations that are grounded in our unstructured data. So what is retrieval? Augmented generation? It's just a technique that allows us to use semantic search to retrieve relevant snippets of content that we use to get generative AI answers that are grounded in our unstructured data. And now you've seen how Salesforce can help by connecting our unstructured data and using it to build a semantic search to get better answers from Generative AI. To learn more, visit einstein.com thanks for watching.










