A ai coolAId

RAG (Retrieval-Augmented Generation)

In One Sentence
Fetching relevant external documents at query time and injecting them into the LLM's prompt so answers stay grounded and up-to-date.
ELI5 (Intuition)
Giving a student an open-book exam: instead of memorizing every policy update from last Tuesday, they look up the exact page and summarize it.
ELI18 (Technical)
Pairs a retriever \(R(q) \to \{d_1, \dots, d_k\}\) (hybrid BM25 lexical + dense vector search, often followed by a cross-encoder reranker) with a generator \(P_\theta(y \mid q, d_{1:k})\). Separates parametric reasoning from non-parametric, mutable knowledge.
In Practice
Use RAG when facts change frequently, require citations, or vary by user permissions (docs Q&A, customer support, codebase search). Use fine-tuning when you need to change behavior, format, or style.