Definition
Retrieval augmented generation (RAG) is a technique in which a system first retrieves information relevant to a user's question from a knowledge source, then supplies that information to a large language model along with the question, so the model can base its answer on it. It allows a model to use an organisation's own, current documents without retraining the model.
A typical RAG pipeline splits documents into passages, converts each into an embedding, a numerical representation of its meaning, and stores them in a searchable index such as a vector database. At question time, the system finds the most relevant passages using semantic search, keyword search or a hybrid of both, sometimes reorders them with a reranking model, and inserts the best ones into the prompt. Good implementations cite their sources and instruct the model to say when the material does not contain the answer. RAG reduces hallucination but does not eliminate it; answer quality depends heavily on document quality, passage splitting and retrieval accuracy.
Example
A hypothetical resort's website assistant is asked whether pets are allowed in the villas. The system retrieves the current pet policy and villa terms from the resort's documents, passes them to the model, and the assistant answers from that text, linking to the policy page.
Why it matters
A general model knows nothing about a specific hotel's policies, a building's service charges or a fund's reporting calendar. RAG lets an assistant answer from that material and show where the answer came from. Results depend on keeping source documents accurate and current, controlling which documents each user may retrieve, and testing retrieval quality on real questions. Citations also let staff and customers check an answer against the original document.