# What is RAG? Definition & Technical Mechanics

> **Source:** [SPIDITS AI AI Glossary](https://spidits.com/ai-glossary)  
> **Category:** Information Retrieval  
> **Canonical Citation:** [https://spidits.com/ai-glossary/rag](https://spidits.com/ai-glossary/rag)

## Definition
Retrieval-Augmented Generation (RAG) is a methodology that optimizes the output of a Large Language Model (LLM) by referencing an authoritative, external knowledge base or Vector Database before generating a response. RAG helps models access real-time information and drastically reduces hallucination.

## Architectural Mechanics & Deep Dive
Retrieval-Augmented Generation solves the primary limitations of LLMs: hallucinations and stale training data. In standard generation, the model relies solely on its internal weights. RAG introduces an external dynamic retrieval phase. When a query is received, it is converted into a vector embedding and used to search a database (such as a vector database containing company documentation or web indexes) for highly relevant text chunks. These chunks are appended directly into the LLM prompt as context. The model then generates an answer grounded strictly in the provided documents, ensuring responses are factual, auditable (with citations), and easily updatable without model retraining.

## Industry Applications & Real-World Use Cases
Enterprise search, dynamic question answering, and customer support

## Frequently Asked Questions

### How is RAG different from fine-tuning?
Fine-tuning modifies the internal weights of the model, which is expensive and slow. RAG acts like an open-book exam, passing relevant documents directly into the prompt context window.

### What is RAG (Retrieval-Augmented Generation) and how does it reduce LLM hallucinations?
RAG is a methodology that fetches relevant context from external databases before generating a response. It grounds the LLM in factual source documents, preventing the model from generating incorrect or hallucinated answers.

## Related Terminology
- [llm](https://spidits.com/ai-glossary/llm)
- [vector-database](https://spidits.com/ai-glossary/vector-database)
- [hallucination](https://spidits.com/ai-glossary/hallucination)

---
*From the SPIDITS AI Knowledge Base (300+ terms indexed). Explore full technical definitions: [https://spidits.com/ai-glossary](https://spidits.com/ai-glossary)*
