Retrieval-Augmented Generation (RAG) is an AI framework that grounds large language models (LLMs) by retrieving external, factual data from a knowledge base bef
A RAG pipeline runs in two stages. At index time, documents are parsed, split into chunks, converted to embeddings, and stored in a vector database. At query time, the user's question is embedded, the most relevant chunks are retrieved (often via hybrid keyword + vector search plus a reranker), and those chunks are inserted into the model's context so it answers from real sources instead of memory. Production systems add citation, permission filtering, and evaluation loops on top.
RAG is the default enterprise AI architecture in 2026 because it solves three blockers at once: hallucination (answers cite retrieved sources), staleness (update the index, not the model), and privacy (your data never trains a third-party model). Most corporate assistants, support bots, and knowledge copilots are RAG systems under the hood.
RAG injects knowledge at query time by retrieving documents into context; fine-tuning bakes patterns into the model's weights through training. Use RAG for facts that change and need citations; fine-tune for style, format, or domain behavior. Many production systems combine both.
Usually because retrieval failed, the right passage wasn't found, was chunked badly, or lost to a weak embedding model, so the LLM improvises. Fixing chunking, hybrid search, and reranking typically reduces hallucination more than changing the model.
A pattern where the model drives retrieval iteratively: reformulating queries, running multiple searches, verifying sources, and self-correcting before answering. It outperforms single-shot retrieval on complex questions and became the mature enterprise pattern by 2026.