Large language models sometimes generate plausible but false statements (hallucinations). Retrieval-Augmented Generation (RAG) mitigates this by retrieving relevant external documents (knowledge bases, databases, documents) before generating responses. The pipeline: (1) User query is embedded into a vector space, (2) A retriever searches a vector database of documents to find topically relevant passages, (3) The retriever's results are concatenated with the original query as context, (4) An LLM generates a response grounded in the retrieved documents. RAG is transformative for customer service, internal documentation Q&A, and domain-specific systems where accuracy is critical. It also provides transparency—responses cite source documents, enabling users…
Read the full lesson
Sign up free: one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in