Member-only story

Generative AI: RAG made easy

Namrata
4 min readMar 2, 2025

--

Retrieval-Augmented Generation (RAG) is not just one AI model but a combination of multiple AI models working together. It is commonly used for interactive applications like chatbots, but it can be applied to other domains as well.

RAG blends static knowledge (retrieved from a database) with dynamic conversation generation (from an AI model).

How RAG Works (Basic Process)

  • User submits a query → e.g., “What are the pricing plans for this product?”
  • The system retrieves relevant documents from a knowledge base (e.g., customer support docs, internet, product database).
  • A generative AI model (like GPT) processes this information and generates a response.
  • User receives a natural language response that is grounded in factual data.

Example:
A customer asks an AI chatbot about product pricing.

  • The chatbot retrieves relevant documents about pricing from the database.
  • It uses an AI model (e.g., GPT) to generate a response.
  • The user sees a natural response that is backed by real company data.

The Three Key Components of RAG

1️⃣ Indexer (Data Ingestion)

  • Converts raw text (e.g., Wikipedia articles, support docs) into a structured format (often vectors).
  • Stores this information in a vector database or other storage systems.

2️⃣ Retriever (Search & Retrieval)

  • Finds relevant documents from the indexed data when a user asks a question.
  • Uses vector search, graph databases, or keyword matching to find relevant content.

3️⃣ Generator (LLM Response)

  • Uses a large language model (LLM) like GPT, Claude, Llama, or Command R.
  • Takes retrieved documents as context and generates a natural language response.

These three components work together to ensure responses are accurate and contextually relevant.

Which models are used in RAG?

  • Retriever → Uses autoencoding LLMs (e.g., BERT) to…

--

--

Namrata
Namrata

Written by Namrata

Engineering @Microsoft A software developer writing her daily bits . https://www.linkedin.com/in/namrataagarwal5/

No responses yet

Write a response