Back

Rahul Agarwal

Founder | Agentic AI...ย โ€ขย 5h

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.

Reply
9
14
2

More like this

Recommendations from Medial

Image Description

Kimiko

Startups | AI | info...ย โ€ขย 6m

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
Image Description

Sushant Kumar

ย โ€ขย 

VIVID MYNDย โ€ขย 8m

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...ย โ€ขย 21d

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
1
7
Image Description
Image Description

Krish Jaiman

Passionate about tec...ย โ€ขย 11m

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...ย โ€ขย 6m

๐Ÿšจ 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
Image Description
Image Description

Rahul Agarwal

Founder | Agentic AI...ย โ€ขย 3m

Well, Lovable is great for building apps. But how does Lovable actually produce full apps? I'll break down the entire process of how lovable works step by step. 1. ๐—จ๐˜€๐—ฒ๐—ฟ ๐—œ๐—ป๐—ฝ๐˜‚๐˜ (๐—ฃ๐—ฟ๐—ผ๐—บ๐—ฝ๐˜ ๐—ฆ๐˜๐—ฎ๐—ด๐—ฒ) โ€ข You type your idea in Lovable (e.g.

See More
2 Replies
4
14

Chirotpal Das

Building an AI eco-s...ย โ€ขย 9m

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...ย โ€ขย 1m

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

Rahul Agarwal

Founder | Agentic AI...ย โ€ขย 3m

Fine-tune vs Prompt vs Context Engineering. Simple step-by-step breakdown for each approach. ๐—™๐—ถ๐—ป๐—ฒ-๐—ง๐˜‚๐—ป๐—ถ๐—ป๐—ด (๐— ๐—ผ๐—ฑ๐—ฒ๐—น-๐—Ÿ๐—ฒ๐˜ƒ๐—ฒ๐—น ๐—–๐˜‚๐˜€๐˜๐—ผ๐—บ๐—ถ๐˜‡๐—ฎ๐˜๐—ถ๐—ผ๐—ป) ๐—™๐—น๐—ผ๐˜„: 1. Collect Data โ†’ Gather domain-specific info (e.g., legal docs). 2. Sta

See More
Reply
2
13

NAMAN PANCHOLI

Passionate Frontend ...ย โ€ขย 1y

Step-1: Open the app Step-2 : In the bottom of the display Go to showcase Step-3 : There would be a drop down written "I'm feeling lucky" Click on that and change it to "Most Upvoted" Step-4 : At 2nd place "Abata AI" on the list that appears, Click

See More
Reply
3

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