Back to all articles

An intro to RAG: The best first step in AI transformation

Jonathan Whiteside
Jonathan Whiteside
Global SVP Technology & Engineering
Length
6 min read
Date
19 November 2024

Of the over 300 million companies in the world, 67% have been using LLMs to work with human language and produce content. However, less than a quarter of the companies using LLMs are planning to deploy commercial models.

Among the barriers keeping companies from leveraging the vast capabilities of LLMs at scale is the quality of LLM responses—particularly with specificity, relevance, and accuracy. 

By overcoming these basic challenges with LLMs, retrieval-augmented generation (RAG) unlocks the opportunity for greater AI-driven innovation in the future and greater day-to-day utility within your organisation. 

In this way, RAG has emerged as a low-risk, high-impact implementation that offers you a clear-cut step forward in your AI transformation using LLMs at an enterprise level.

How it works

LLMs are great because they come pre-trained, but the knowledge that they’ve been trained on is generalised. 

For example, let’s say you want to use an LLM to generate a script for an upcoming presentation about the results of a marketing campaign. ChatGPT won’t be much help: its knowledge base lacks basic information about the campaign and other useful context, like your brand’s identity and business model. 

To get the output you’re looking for, you’d need to be able to incorporate information from your brand that exists outside the knowledge base that the LLM was initially trained on—which is precisely where RAG comes into play.

A diagram displaying the RAG process. From a user's initial query, the retrieval mechanism identifies and pulls relevant information from an additional database to ground the LLM's response based on this information.

Essentially, RAG tailors the LLM to a more specific application by grounding its responses in an additional knowledge base of handbooks, reports, articles, and other selective external sources not part of the LLM’s original training regimen.

Once prompted, the LLM can retrieve relevant information from the additional knowledge base to generate a higher-quality response grounded in that new knowledge.

RAG in action

RAG has become a popular method for integrating AI into a wide array of applications across industries—and for good reason. 

The ability to be selective with which sources are included in the LLM’s additional knowledge helps you address the following key concerns with the quality of the model’s responses.

Specificity
Using RAG, you can integrate the latest product manuals or troubleshooting guides into your LLM so that its responses deliver clear, direct instruction using language that is unique or proprietary to your brand. 

The surge of AI-driven customer support chatbots offers a prime example of this capability. Implementing RAG enables chatbots to draw upon specific model names, parts, and frequently occurring issues to assist customers effectively.

Relevance
Incorporating recent articles or reports into your LLM ensures that its responses draw upon the most relevant information for a topic. 

If you’re using an LLM primarily for content creation within your brand, improving the relevancy of the model’s responses is hugely valuable. Incorporating sources from within a limited date range—whether that’s the most recent five months or five years—helps ensure that your brand’s content is timely and worthwhile.

Accuracy
Perhaps most importantly, RAG also enables you to improve the accuracy of your LLM’s responses by grounding the model in authenticated, peer-reviewed research or studies. 

For use cases within healthcare, the accuracy and reliability of LLM responses is a critical issue. At DEPT®, we used RAG to overcome that barrier when we helped CaryHealth develop an ultra-accurate AI reference app that relies on exclusively verified sources.

Getting started

To get started building your own RAG implementation, you’ll need the following ingredients.

Preparing these ingredients will take a matter of months, depending on the complexity of your data and the current state of your architecture. The good news, however, is that this is the most time-consuming part of the process. Once your objectives and data are in order, actually implementing RAG and testing the system takes just a week or two. 

Even better, these foundational elements aren’t just crucial steps for RAG, they carry over to virtually every other aspect of your organisation’s AI transformation.

A set of clearly defined objectives
With RAG, the more specific you can be with what you want to achieve, the better. Whether it’s improving customer support, creating personalised content, or enhancing data-driven decision-making, knowing when and how you will eventually engage with the system will provide the guidance you need for the duration of the implementation process.

The right LLM
It may seem obvious, but you’ll need to select the LLM that is best suited for your use case and that can be integrated with a retrieval system. You can select an open-source LLM like Mistral or Llama, or a commercially available option like ChatGPT.  Some important factors to consider in your decision are scalability, integration capabilities, cost, and (of course) your set of clearly defined objectives.

A foundation in data engineering
The best way of approaching RAG is by thinking of it as a data engineering exercise. Given the current state of AI, with most organisations in the early stages of their AI transformation, the most significant barrier to using RAG is getting your data organised and structured so that it is compatible with an LLM.

With a foundation in data engineering, the bulk of your RAG implementation work is about building a source for an additional knowledge base that exists upstream within your organisation and is populated by a live data set that is continuously updated. 

Depending on your objectives, you may also want to consider creating multiple data sources for use across multiple knowledge bases. Having separate knowledge bases for product information and brand guidelines, for example, may help you unlock new applications for your RAG-enabled LLM.

An opportunity for innovation

As AI continues to improve, so does RAG. In October 2024, researchers at Cornell University introduced contextual document embedding, a new technique that enables the system to identify better-quality pieces of information for retrieval. 

Continuous evolution like this further demonstrates that RAG is your organisation’s Step One for getting more out of LLMs and advancing your overall AI prowess—and it just keeps getting better. 

While it’s not necessarily low-effort, every hour of work that you put into it helps further your overall AI transformation and unlock new opportunities for innovation.

AI TRANSFORMATION

DEPT® TRENDS 2025

At DEPT®, we’re all in on the positive potential of AI to transform businesses for the better. For more, download our 2025 report, The future belongs to the impatient, where we explore insights, predictions, and actionable insights for tackling AI in the coming year.

Download report

More insights