Detailed Explanation
Retrieval-Augmented Generation (RAG) is a framework that improves the quality of LLM-generated responses by grounding the model on external sources of knowledge. When a user asks a question, a RAG system first searches a database (often a vector database) for relevant documents. It then retrieves those documents and feeds them to the LLM alongside the user's prompt. This ensures the AI uses up-to-date, factual, and private data, significantly reducing hallucinations.