Definition & Explanation
Retrieval-Augmented Generation (RAG) combines the power of LLMs with the ability to search and retrieve relevant information from external databases or documents. Instead of relying solely on training data, RAG systems first search a knowledge base for relevant context, then feed that context to the LLM alongside the user query. In AI coding tools, RAG is used to search codebases, documentation, and internal knowledge bases to give the AI relevant context for coding tasks.