What is Retrieval-Augmented Generation (RAG)?
An architecture that retrieves relevant documents and injects them into an LLM's context to ground answers in external knowledge.
Definition
RAG bolts a search step onto generation: documents are chunked, embedded, and indexed in a vector store; at query time the most similar chunks are retrieved and placed in the prompt, letting the model answer from private or fresh data it was never trained on, with citations. This curbs hallucination and sidesteps retraining when knowledge changes. Production pipelines layer on hybrid retrieval (BM25 plus vectors), rerankers like Cohere Rerank, and chunking strategies tuned to document structure; frameworks such as LangChain and LlamaIndex assemble the pieces. Evaluation focuses on retrieval precision and answer faithfulness, since bad retrieval poisons even a strong model.

