vibedonaldsvibedonalds.com
Term

RAG

Retrieval-Augmented Generation — a pattern where the application retrieves relevant text chunks from a knowledge base (vector DB, search index) and includes them in the LLM prompt at query time, so the model answers from grounded sources instead of pure memorisation.

Background

RAG combines an information-retrieval step with a generation step. At query time, the user's question is embedded and used to find top-K matching chunks from a corpus. Those chunks are concatenated with the question into a single prompt. The model answers grounded in retrieved context, reducing hallucinations and allowing fresh data without retraining. In coding tools, RAG indexes the codebase so the model can answer "where is auth handled?" with real file references.