RAG
Retrieval-augmented generation — an AI pattern that searches a document store for relevant passages before generating an answer, so the answer is grounded in real content.
RAG is a common technique for making a language model answer accurately from a specific corpus of documents. Instead of relying only on what the model learned during training, a RAG system runs the user's question through a search step first — finding the most relevant chunks from a document store — and then hands both the question and those chunks to the model to generate the answer.
The pattern solves two problems at once. It grounds the answer in specific documents (reducing hallucination on facts within those documents), and it lets a general model answer questions about material that wasn't in its training data (a company's internal wiki, a set of legal filings, a research library).
The three components of a typical RAG system: an embedding model that converts text into vectors so it can be searched by meaning; a vector database that stores and searches those vectors; and the generation model itself that produces the final answer. Real systems add ranking, filtering, and context-window management on top.