What is RAG? 4 analogies for this powerful AI approach

How RAG works and why it’s key to enterprise AI.

Kenny Wong

AI Engineer at Coda

What is RAG? 4 analogies for this powerful AI approach

By Kenny Wong

Share this article

Share on TwitterShare on LinkedInShare on Facebook
AI · 6 min read
If you’re even vaguely familiar with the developments in artificial intelligence (AI), you’ve likely heard of “RAG,” which stands for Retrieval Augmented Generation. RAG is getting everyone excited—including us at Coda—due to its ability to provide much more relevant, accurate responses without having to build custom large language models (LLMs.) Our AI product lead, Glenn Jaume, predicts that RAG will be the fastest growing product category this year. As an AI engineer, I often find myself having to describe what RAG is and how it works to my colleagues, friends, and family. It can be a little complex to explain so I’ve developed four different analogies for explaining RAG in different scenarios: the librarian, the detective, the GPS, and the chef. But first, let’s go over the basics of RAG and why it’s so powerful.

What is RAG?

RAG is a technique that directs an AI to retrieve specific sets of data first, and then looks at those sources for the answer to the user’s question. Put simply, you ask a question, the AI goes and finds the relevant data/content, and then analyzes and synthesizes that data to give you the most relevant answer.

Source: Leveraging LLMs on your domain-specific knowledge base - ML6.eu

Combining generative LLMs with traditional retrieval systems in this way enables much more personalized AI responses—engineers can direct the AI where to look for the information to give customers a smarter, more contextually aware AI experience.

How we use RAG at Coda.

We use RAG within Coda Brain, which is our turnkey AI platform that understands your company data and allows anyone to act on it. RAG enables Coda Brain to pull applicable information from your docs and any tools you’ve connected to Coda before generating its own insights, responses, or actions based on these. This ensures that the responses are not only contextually relevant but also grounded in real, verifiable data. That’s why we call it your “favorite know-it-all.” We also use RAG in Coda’s AI features—which are built into every Coda doc and included free for Doc Makers—to provide accurate answers about the content of your Coda docs. That means you can ask it questions like “What’s our remote policy?” and get the answer based on content within your workspace. That’s something you can’t do with consumer AI tools like ChatGPT, which have access to the internet but not to your own content. In short, Coda AI knows your team—and is more helpful because of it.

4 analogies for how RAG works.

In Coda Brain, we use RAG to power everything from surfacing accurate answers from your workspace to synthesizing huge amounts of data to generating brand new content tailored to exactly what you need. Here are four analogies I like to use to explain how RAG works in these different scenarios. Feel free to steal them for your own explanations!

1. Generating content with RAG, the helpful librarian.

To explain the basics of how RAG generates content, I like to use the analogy of a librarian:
  • A student approaches a librarian with a research topic (query).
  • The librarian goes and finds books, journals, and articles that are relevant to the topic (retrieval).
  • The librarian then helps the student synthesize this information to create a well-informed and accurate research paper (augmented generation).
In the case of Coda Brain, this could be generating a summary of your meeting notes based on a Zoom transcript and your agenda, or creating a writeup of potential new features to build based on user feedback, hackathon ideas, and win/loss data from your CRM.

2. Finding answers with Detective RAG.

In the above example, the librarian is helping generate new content by synthesizing multiple sources. RAG can also be used for finding a single answer that lives within your workspace or connected tools, such as your vacation policy or last month’s sales figures. Think of it like a detective looking for the vital clue to crack the case:
  • You ask the detective to find out who committed the crime (query).
  • The detective looks through evidence from various sources, such as witnesses, surveillance footage, and databases (retrieval).
  • Detective RAG finds the single CCTV clip that shows who the perpetrator was and delivers the answer to you (augmented generation).
  • The mystery is solved!
Note that with Coda Brain, the retrieval step here is also permissions-aware. That means it will only retrieve sources and content that the question-asker has access to already, whether that be other Coda docs and/or data from tools you’ve connected with Packs. This is essential for enterprise AI, as it ensures private information isn’t accidentally surfaced to an unintended audience. Which brings me to my third analogy...

3. Getting the best (legal) route with RAG GPS.

To give another example of RAG’s ability to be permissions-aware, let’s imagine it as a GPS:
  • You input your destination (query).
  • The GPS retrieves data from a map database to find all possible routes (retrieval). Because it is aware of your permissions, the GPS won’t retrieve data like private roads or walkways that you can’t access.
  • It then uses this information to generate the most efficient route based on real-time traffic conditions and provides you with turn-by-turn directions (augmented generation).
You get to where you’re going in the quickest time possible (without breaking any trespassing laws!).

4. Generating tailored content with Chef RAG.

In addition to being permissions-aware, one of the most powerful things about the RAG approach is that it can be context-aware too. That means responses can be tailored based on the context in which a question is asked, making them much more relevant. Think of it like a chef catering to your dietary needs:
  • You order the pasta dish at a restaurant (query).
  • The chef consults the recipe and then gathers the necessary ingredients (retrieval).
  • Using their culinary skills, the chef combines the ingredients to create the dish. Because Chef RAG knows who’s ordering it and what you usually like, they tailor the dish to your preferences and dietary restrictions (context-aware augmented generation).
  • You get to enjoy some delicious pasta, exactly how you like it!
Bringing this back to a work setting, being context-aware means Coda Brain can generate a blog post in the tone and voice detailed in your brand style guide. It can also provide an overview of what your team delivered last week because it already knows which team you’re in. Coda Brain can even go beyond just text responses, like providing a table of your team’s open Jira issues, for example.

Bringing it all together with Coda Brain.

When you bring together all these elements of RAG—the ability to retrieve and synthesize relevant sources, being permissions-aware, and knowing your context—you can unlock some truly powerful use cases that weren’t previously possible. For example, let’s imagine we’re planning our roadmap and we want to know some of our most requested features:
  • You ask Coda Brain for the top feature requests. It brings back a list with the top one being a desktop app.
  • You then ask “Have we explored a desktop app before?” Coda Brain synthesizes previous writeups, hackathon docs, meeting notes, and more to provide an overview of previous explorations.
  • You decide to write a product requirements doc (PRD); Coda Brain can write it for you, using your team’s PRD template.
  • And then, you ask for customers who’ve requested a desktop app in the past to add evidence of why you should build this. Coda Brain returns a table with customer requests from Salesforce that you can drop into your doc.
All of this can be done without leaving the Coda Brain interface. Just imagine how much time you could save if finding answers and taking action was always this easy! If that piques your interest in Coda Brain, sign up to join the private preview here or learn more here.

Related posts

Explore more stories about AI.
Enterprise AI can do more

With access to your team’s data, enterprise AI becomes a powerful tool.

Enterprise AI vs consumer AI

Consumer AI tools don’t have context for your tasks at work.

Introducing Coda Brain

Coda Brain turns data into action across the enterprise.