What is RAG?
RAG (Retrieval-Augmented Generation): an AI term, explained in plain English.
A way to make an AI answer from trusted documents: it first looks up the relevant pages, then writes its answer from them.
AI Drafted with AI help · Reviewed by Keshav Aggarwal · Updated
In simple words
Imagine a student in an open-book exam. Before answering, they look up the right page in the book, then write the answer.
RAG lets an AI do the same: look things up first, then answer.
The technical side
Retrieval-augmented generation adds a search step before the model writes. Documents are split into chunks and stored, often as embeddings in a vector database. For each question, the closest chunks are retrieved and placed in the model’s context window together with the question.
RAG lets a model use private or very recent information without retraining it, and makes it easier to show sources. It lowers the risk of hallucination but does not remove it.
RAG kya hai?
RAG mein AI pehle sahi documents dhoondhta hai, phir unhi ko padh ke jawab likhta hai. Jaise open-book exam mein bachcha pehle kitaab dekhta hai, phir likhta hai.
Related terms
- LLM (Large Language Model)AIAn AI model trained on huge amounts of text so it can read and write language, like the models behind ChatGPT, Claude and Gemini.
- HallucinationAIWhen an AI model states something false or made up as if it were true, such as a fake fact, quote or source.
- Context WindowAIHow much text an AI model can look at in one go: your question, the conversation so far and any files, counted in tokens.
