What is Retrieval Augmented Generation (RAG) for documents?
💡 Model Answer
Retrieval Augmented Generation (RAG) is a technique that combines a language model with an external knowledge base to improve factual accuracy. The process starts by indexing a corpus of documents—often using vector embeddings from models like Sentence‑BERT or BM25 for keyword retrieval. When a user query arrives, a retrieval component fetches the top‑k relevant passages. These passages are concatenated with the prompt and fed to a generative model (e.g., GPT‑3 or a fine‑tuned LLM). The model then generates an answer conditioned on both the query and the retrieved context. RAG reduces hallucinations because the LLM is anchored to real documents. It is widely used in question‑answering systems, legal document review, and customer support bots. Implementations can be built with open‑source stacks (FAISS + HuggingFace) or managed services like AWS Bedrock’s Retrieval Augmented Generation feature.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.
Get Assisting AI — Starts at ₹500