Back

Rahul Agarwal

Founder | Agentic AI... • 1m

Most people don't even know these basics of RAG. I've explained it in a simple way below. 1. 𝗜𝗻𝗱𝗲𝘅𝗶𝗻𝗴 Convert documents into a format that AI can quickly search later. Step-by-step: • 𝗗𝗼𝗰𝘂𝗺𝗲𝗻𝘁: You start with files like PDFs, Word docs, notes, websites, etc. • 𝗘𝘅𝘁𝗿𝗮𝗰𝘁 → 𝗧𝗲𝘅𝘁: The system pulls raw text out of those documents. • 𝗖𝗵𝘂𝗻𝗸𝘀: The long text is broken into 𝘀𝗺𝗮𝗹𝗹 𝗽𝗶𝗲𝗰𝗲𝘀 (chunks). This is important because AI can’t understand very large text at once. • 𝗩𝗲𝗰𝘁𝗼𝗿𝗶𝘇𝗲 / 𝗘𝗻𝗰𝗼𝗱𝗲: Each chunk is converted into numbers called 𝘃𝗲𝗰𝘁𝗼𝗿𝘀. These numbers represent the 𝘮𝘦𝘢𝘯𝘪𝘯𝘨 of the text. • 𝗘𝗺𝗯𝗲𝗱𝗱𝗶𝗻𝗴 𝗠𝗼𝗱𝗲𝗹: A special model does this text → vector conversion. • 𝗦𝗮𝘃𝗲 𝗶𝗻 𝗩𝗲𝗰𝘁𝗼𝗿 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲: All vectors are stored in a 𝘃𝗲𝗰𝘁𝗼𝗿 𝗱𝗮𝘁𝗮𝗯𝗮𝘀𝗲 so they can be searched later. ________________ 2. 𝗥𝗲𝘁𝗿𝗶𝗲𝘃𝗮𝗹 (𝗥) Fetch the most relevant chunks for a user’s question. Step-by-step: • 𝗨𝘀𝗲𝗿 𝘀𝘂𝗯𝗺𝗶𝘁𝘀 𝗮 𝗾𝘂𝗲𝘀𝘁𝗶𝗼𝗻: Example: “𝘞𝘩𝘢𝘵 𝘥𝘰𝘦𝘴 𝘵𝘩𝘦 𝘤𝘰𝘯𝘵𝘳𝘢𝘤𝘵 𝘴𝘢𝘺 𝘢𝘣𝘰𝘶𝘵 𝘵𝘦𝘳𝘮𝘪𝘯𝘢𝘵𝘪𝘰𝘯?” • 𝗤𝘂𝗲𝘀𝘁𝗶𝗼𝗻 → 𝗩𝗲𝗰𝘁𝗼𝗿𝗶𝘇𝗲𝗱: The question is also converted into a vector using the same embedding engine. • 𝗩𝗲𝗰𝘁𝗼𝗿 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲 𝗦𝗲𝗮𝗿𝗰𝗵: The system compares: 1. Question vector 2. Stored document vectors • 𝗠𝗮𝘁𝗰𝗵𝗶𝗻𝗴 / 𝗦𝗶𝗺𝗶𝗹𝗮𝗿𝗶𝘁𝘆 𝗦𝗲𝗮𝗿𝗰𝗵: The database finds chunks whose meaning is closest to the question. • 𝗔𝗽𝗽𝗿𝗼𝗽𝗿𝗶𝗮𝘁𝗲 𝗖𝗵𝘂𝗻𝗸𝘀 𝗢𝘂𝘁𝗽𝘂𝘁: Only the 𝗺𝗼𝘀𝘁 𝗿𝗲𝗹𝗲𝘃𝗮𝗻𝘁 𝗽𝗶𝗲𝗰𝗲𝘀 𝗼𝗳 𝘁𝗲𝘅𝘁 are returned. ________________ 3. 𝗔𝘂𝗴𝗺𝗲𝗻𝘁𝗮𝘁𝗶𝗼𝗻 (𝗔) Enhance the user’s question with relevant information. Step-by-step: • 𝗥𝗲𝗹𝗲𝘃𝗮𝗻𝘁 𝗖𝗵𝘂𝗻𝗸𝘀: The retrieved text pieces are collected. • 𝗠𝗲𝗿𝗴𝗲 𝘄𝗶𝘁𝗵 𝗦𝗼𝘂𝗿𝗰𝗲 𝗖𝗼𝗻𝘁𝗲𝗻𝘁: These chunks are combined into a clean context block. • 𝗣𝗿𝗼𝗺𝗽𝘁 𝗖𝗿𝗲𝗮𝘁𝗶𝗼𝗻: The system builds a new prompt: 1. User’s original question 2. Retrieved context • 𝗔𝘂𝗴𝗺𝗲𝗻𝘁 𝘁𝗵𝗲 𝗣𝗿𝗼𝗺𝗽𝘁: This enriched prompt gives the AI 𝘣𝘢𝘤𝘬𝘨𝘳𝘰𝘶𝘯𝘥 𝘬𝘯𝘰𝘸𝘭𝘦𝘥𝘨𝘦. ________________ 4. 𝗚𝗲𝗻𝗲𝗿𝗮𝘁𝗶𝗼𝗻 (𝗚) Generate a correct, grounded response. Step-by-step: • 𝗘𝗻𝗿𝗶𝗰𝗵𝗲𝗱 𝗣𝗿𝗼𝗺𝗽𝘁 𝗦𝗲𝗻𝘁: The prompt (question + context) is sent to the LLM. • 𝗟𝗟𝗠 𝗠𝗼𝗱𝗲𝗹𝘀 (𝗢𝗽𝗲𝗻𝗔𝗜 / 𝗼𝘁𝗵𝗲𝗿𝘀): The language model reads: 1. The question 2. The retrieved knowledge • 𝗙𝗶𝗻𝗮𝗹 𝗢𝘂𝘁𝗽𝘂𝘁: The model generates a response 𝗯𝗮𝘀𝗲𝗱 𝗼𝗻 𝗽𝗿𝗼𝘃𝗶𝗱𝗲𝗱 𝗰𝗼𝗻𝘁𝗲𝘅𝘁, not guesses. Why RAG Is Powerful? <> Normal LLMs rely only on training data BUT, <> RAG lets LLMs use 𝘆𝗼𝘂𝗿 𝗽𝗿𝗶𝘃𝗮𝘁𝗲 𝗼𝗿 𝗳𝗿𝗲𝘀𝗵 𝗱𝗮𝘁𝗮 and it's easy to update knowledge anytime. ✅ Repost for others so they can understand the very basics of RAG.

4 Replies
21
33
4
Replies (4)

More like this

Recommendations from Medial

Image Description

Kimiko

Startups | AI | info... • 8m

Vector databases for AI memory just got disrupted… by MP4 files?! Video as Database: Store millions of text chunks in a single MP4 file Store millions of text chunks with blazing-fast semantic search — no database required. 100% open source. Zero

See More
1 Reply
3
18

Rahul Agarwal

Founder | Agentic AI... • 14d

6 Chunking Methods for RAG you should know. I’ve explained it in a simple, step by step way. 𝗪𝗵𝗮𝘁 𝗶𝘀 𝗖𝗵𝘂𝗻𝗸𝗶𝗻𝗴? 1. Chunking means splitting large documents into smaller pieces. 2. Helps LLMs search and understand data better. 3. Essent

See More
Reply

Rahul Agarwal

Founder | Agentic AI... • 14d

6 Chunking Methods for RAG you should know. I’ve explained it in a simple, step by step way. 𝗪𝗵𝗮𝘁 𝗶𝘀 𝗖𝗵𝘂𝗻𝗸𝗶𝗻𝗴? 1. Chunking means splitting large documents into smaller pieces. 2. Helps LLMs search and understand data better. 3. Essent

See More
Reply
1
Image Description

Sushant Kumar

 • 

VIVID MYND • 9m

Internship Alert – Vivid Mynd Technologies We're on the hunt for RAG-savvy interns! If you're into LlamaIndex, RAG concepts, and vector DBs like Chroma, this is your shot. Duration: 2 months Stipend: Fixed Who: College students or freelancers with

See More
1 Reply
6

Rahul Agarwal

Founder | Agentic AI... • 13d

Prompt vs Context vs RAG. I've explained it in a simple way below. 1. 𝗣𝗿𝗼𝗺𝗽𝘁 𝗘𝗻𝗴𝗶𝗻𝗲𝗲𝗿𝗶𝗻𝗴 Prompt Engineering is about 𝗰𝗹𝗲𝗮𝗿 𝗶𝗻𝘀𝘁𝗿𝘂𝗰𝘁𝗶𝗼𝗻𝘀, not magic words. • 𝗗𝗲𝗳𝗶𝗻𝗲 𝘁𝗵𝗲 𝗳𝗶𝗻𝗮𝗹 𝗴𝗼𝗮𝗹: What exactly do

See More
Reply
1

Rahul Agarwal

Founder | Agentic AI... • 2m

Turn your laptop into a powerful RAG engine. The world’s smallest vector database. I've explained below. If you’re building RAG today, you’re facing a brutal reality: 𝗖𝗹𝗼𝘂𝗱 𝘃𝗲𝗰𝘁𝗼𝗿 𝗗𝗕𝘀 𝗮𝗿𝗲 𝗲𝘅𝗽𝗲𝗻𝘀𝗶𝘃𝗲 and 𝗼𝗻-𝗽𝗿𝗲𝗺𝗶𝘀𝗲

See More
Reply
2
7
Image Description
Image Description

Krish Jaiman

Passionate about tec... • 1y

AI is reaching heights these days.But have you ever wondered how ChatGPT answers the question from recent affairs? Because see ChatGPT trained on the news of 31st January 2025 but it still answers the question relating to it .How? This is because of

See More
3 Replies
2

Saswata Kumar Dash

Buidling FedUp| AI R... • 8m

🚨 Everyone says "RAG is dead" — but I say: It’s just been badly implemented. I’ve worked on AI systems where Retrieval-Augmented Generation (RAG) either changed the game… or completely flopped. Here’s the hard truth 👇 --- 🤯 Most teams mess up

See More
Reply
5

Chirotpal Das

Building an AI eco-s... • 10m

I feel pride in announcing our Made in India, Real-Time Vector Database - SwarnDB. SwarnDB is a SarthiAI initiative towards an effort to create an end to end eco-system for the future of AI. We tested SwarnDB with 100K vector records of 1536 dime

See More
Reply
3

Rahul Agarwal

Founder | Agentic AI... • 2m

2 ways AI systems today generate smarter answers. I’ve explained both in simple steps below. 𝗥𝗔𝗚 (𝗥𝗲𝘁𝗿𝗶𝗲𝘃𝗮𝗹-𝗔𝘂𝗴𝗺𝗲𝗻𝘁𝗲𝗱 𝗚𝗲𝗻𝗲𝗿𝗮𝘁𝗶𝗼𝗻) (𝘴𝘵𝘦𝘱-𝘣𝘺-𝘴𝘵𝘦𝘱) RAG lets AI fetch and use real-time external information to ge

See More
Reply
1
7

Download the medial app to read full posts, comements and news.