DEV Community

Jasdeep Singh Bhalla
Jasdeep Singh Bhalla

Posted on

What is RAG?

๐Œ๐จ๐ฌ๐ญ ๐€๐ˆ ๐ฆ๐จ๐๐ž๐ฅ๐ฌ ๐๐จ๐งโ€™๐ญ ๐š๐œ๐ญ๐ฎ๐š๐ฅ๐ฅ๐ฒ โ€œ๐ค๐ง๐จ๐ฐโ€ ๐ฒ๐จ๐ฎ๐ซ ๐๐š๐ญ๐š.

They generate answers based on what they were trained on โ€”

which means they can be:

โ€ข outdated
โ€ข incorrect
โ€ข or missing context

๐Ÿ’ก ๐“๐ก๐š๐ญโ€™๐ฌ ๐ฐ๐ก๐ž๐ซ๐ž ๐‘๐€๐† (๐‘๐ž๐ญ๐ซ๐ข๐ž๐ฏ๐š๐ฅ-๐€๐ฎ๐ ๐ฆ๐ž๐ง๐ญ๐ž๐ ๐†๐ž๐ง๐ž๐ซ๐š๐ญ๐ข๐จ๐ง) ๐œ๐จ๐ฆ๐ž๐ฌ ๐ข๐ง.

๐Ÿ‘‰ Instead of answering directly, RAG works in 3 steps:
Search โ†’ Find relevant information (docs, PDFs, databases)
Retrieve โ†’ Pull the most useful pieces
Generate โ†’ Answer using that information

๐Ÿง  Simple idea:
Normal AI โ†’ guesses
RAG โ†’ looks up info first, then answers

๐Ÿ“Œ Example:
Ask: โ€œ๐˜ž๐˜ฉ๐˜ข๐˜ตโ€™๐˜ด ๐˜ฐ๐˜ถ๐˜ณ ๐˜ค๐˜ฐ๐˜ฎ๐˜ฑ๐˜ข๐˜ฏ๐˜บโ€™๐˜ด ๐˜ญ๐˜ฆ๐˜ข๐˜ท๐˜ฆ ๐˜ฑ๐˜ฐ๐˜ญ๐˜ช๐˜ค๐˜บ?โ€

Without RAG โ†’ generic answer โŒ
With RAG โ†’ pulls actual company document โœ…

๐Ÿš€ Why it matters:
โ€ข More accurate answers
โ€ข Uses real-time/private data
โ€ข Reduces hallucinations
โ€ข Powers AI agents & copilots

๐ˆ๐Ÿ ๐ฒ๐จ๐ฎโ€™๐ซ๐ž ๐›๐ฎ๐ข๐ฅ๐๐ข๐ง๐  ๐€๐ˆ ๐ญ๐จ๐๐š๐ฒ, ๐œ๐ก๐š๐ง๐œ๐ž๐ฌ ๐š๐ซ๐ž ๐ฒ๐จ๐ฎโ€™๐ซ๐ž ๐ฎ๐ฌ๐ข๐ง๐  ๐‘๐€๐† โ€” ๐ž๐ฏ๐ž๐ง ๐ข๐Ÿ ๐ฒ๐จ๐ฎ ๐๐จ๐งโ€™๐ญ ๐ซ๐ž๐š๐ฅ๐ข๐ณ๐ž ๐ข๐ญ.

Top comments (0)