RAG combines information retrieval with language generation so models can use external, domain-specific, or up-to-date information.
Retrieval-augmented generation (RAG) is a technique that improves large language model responses by retrieving relevant information from external sources before generating an answer. These sources may include databases, uploaded documents, web pages, knowledge graphs, or frequently updated organizational data. The retrieved content is added to the user's prompt, enabling the model to use domain-specific or current information that may not have been present in its original training data. RAG was formally introduced in a 2020 research paper combining a parametric language model with a non-parametric external memory accessed during inference. A typical RAG pipeline converts source documents into embeddings, stores them in a vector database, retrieves documents relevant to a user query, and supplies the retrieved context to the language model for generation. RAG can improve factual grounding, transparency, and updateability while reducing the need for frequent model retraining. However, it does not eliminate hallucinations: models may misinterpret context, combine conflicting or outdated sources, retrieve misleading content, or answer confidently when evidence is insufficient. Retrieval quality, chunking, reranking, hybrid search, source evaluation, and uncertainty handling are therefore important to reliable RAG systems.
RAG combines information retrieval with language generation so models can use external, domain-specific, or up-to-date information.
The standard workflow involves embedding and indexing data, retrieving relevant documents, adding them to the prompt, and generating an answer grounded in the retrieved context.
RAG can improve factual accuracy, transparency, and updateability without requiring complete model retraining whenever new information becomes available.
RAG is not a complete solution to hallucinations because models can misinterpret retrieved passages, ignore context, merge conflicting information, or rely on misleading sources.
Performance can be improved through effective chunking, dense and sparse retrieval, approximate nearest-neighbor search, reranking, query expansion, late interaction, and hybrid keyword-semantic search.
A method that retrieves relevant external information and provides it to a language model as context for generating a response.
A numerical representation of text or other data that captures useful semantic or lexical relationships for comparison and retrieval.
A database designed to store embeddings and efficiently retrieve items that are similar to a query embedding.
The component of a RAG system that selects documents or passages relevant to a user's query.
A user query supplemented with retrieved external context before it is sent to the language model.
The process of dividing source documents into smaller passages that can be independently embedded, retrieved, and supplied to the model.
A secondary ranking process that reorders retrieved passages to prioritize the information most relevant to the query.
A retrieval approach that combines semantic vector search with traditional keyword or full-text search.
The introduction or retrieval of misleading, manipulated, or strategically biased content that causes a RAG system to generate unreliable conclusions.
βCan you explain what "RAG combines information retrieval with language generation so models can use external, domain-specific, or up-to-date information." means in simple terms?β