A technique that enhances AI model responses by first retrieving relevant information from a knowledge base, such as your code base, documentation, or other resources, and then using that information to generate more accurate and contextual responses. RAG typically involves indexing your code and documentation, capturing frozen semantic meaning, and then retrieving the most relevant pieces of content when AI needs to answer questions or generate code. This helps AI maintain consistency with your existing code base and follow your team’s patterns and conventions. RAG is particularly important for enterprise development where AI needs access to proprietary code and documentation that wasn’t part of its training data.
— Vibe Coding, Gene Kim, Steve Yegge