Retrieval-Augmented Generation (RAG) is an artificial intelligence architecture that enhances a large language model's (LLM) factual accuracy and relevance by dynamically retrieving information from an external knowledge source and conditioning its text generation on that retrieved context. This process directly addresses the LLM's limitations of static, parametric knowledge and hallucination by grounding responses in verifiable, up-to-date data. The core workflow involves a retriever component, often a vector search over a vector database, fetching relevant documents which are then injected into the LLM's context window as augmented prompts.
