---
title: "Discussion on \"What the Heck is RAG? And How to Build It\" | Hashnode"
description: "Discussion on \"What the Heck is RAG? And How to Build It\". What You’ll Learn\n\nOverview of Retrieval-Augmented Generation (RAG)\n\nComponents of RAG (indexing, retrieval, augmentation, generation)\n\nHow to build a naive RAG workflow in Python\n\n\nTL;DR\nRetrieval-Augmented Generation (RAG) is a technique that enhan..."
url: "https://hashnode.com/posts/what-the-heck-is-rag-and-how-to-build-it/65dd65495dd6217ce265cb00"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [What the Heck is RAG? And How to Build It](https://samborges.hashnode.dev/what-the-heck-is-rag-and-how-to-build-it?utm_source=hashnode&utm_medium=feed)

What You’ll Learn Overview of Retrieval-Augmented Generation (RAG) Components of RAG (indexing, retrieval, augmentation, generation) How to build a naive RAG workflow in Python TL;DR Retrieval-Augmented Generation (RAG) is a technique that enhan...

Feb 27, 2024 · 6 min read · samborges.hashnode.dev  
Read the article

-   [#retrieval-augmented-generation](https://hashnode.com/tag/retrieval-augmented-generation)
-   [#llm](https://hashnode.com/tag/llm)
-   [#python](https://hashnode.com/tag/python)
-   [#openai](https://hashnode.com/tag/openai)
-   [#langchain](https://hashnode.com/tag/langchain)

## Written by

[Sam Borges](https://hashnode.com/@samborges)

@samborges

  
[View profile](https://hashnode.com/@samborges)

shadowy super coder

## Responses

Markdown supported · ⌘↵ to post

[Tinz Twins](https://hashnode.com/@tinztwins)

[Feb 28, 2024](https://hashnode.com/posts/what-the-heck-is-rag-and-how-to-build-it/65dd65495dd6217ce265cb00/comment/65df9c44d477a6de59b59fc8)

RAG is powerful! Thanks for sharing.

[Parth Kamal](https://hashnode.com/@parthkamal)

[Feb 27, 2024](https://hashnode.com/posts/what-the-heck-is-rag-and-how-to-build-it/65dd65495dd6217ce265cb00/comment/65ddf122925513713f7b2f17)

so does rag acts like a new training data which llm uses to give the response. aur it is just to make the query more contextualised. during rag enabled user interaction with a llm. does llm runs on that vector db which rag gives to it? just a query , I am new into it.

[Sam Borges](https://hashnode.com/@samborges)

[Feb 27, 2024](https://hashnode.com/posts/what-the-heck-is-rag-and-how-to-build-it/65dd65495dd6217ce265cb00/comment/65ddf122925513713f7b2f17#reply-65ddfbd1cb70ca8db92f2b34)

That's a great question. The LLM does not interact with the vector database. The query is more contextualize before going to the LLM.

The original query gets augmented/changed but appending the additional context BEFORE it gets to the LLM.

Here's a quick example:

Original query: "what is my sick leave policy?" RAG query: "using the provided context, answer the question. Question: what is my sick leave policy? Context: <TEXT RETRIEVED FROM DOCUMENTS IN RAG>"

Then this RAG query is sent to the LLM.

Hope that helps! Let me know if you have any other questions.

[Parth Kamal](https://hashnode.com/@parthkamal)

[Feb 28, 2024](https://hashnode.com/posts/what-the-heck-is-rag-and-how-to-build-it/65dd65495dd6217ce265cb00/comment/65ddf122925513713f7b2f17#reply-65deba93bbe42a73fc398567)

now I understood. thanks for replying !
