RAG
An architecture that improves AI responses by searching an external database for relevant facts and inserting them into the prompt before the model answers.
What it is
Retrieval-Augmented Generation (RAG) grounds an LLM in specific, private data it wasn't trained on. When a user asks a question, the system first queries a database (often using embeddings) to find relevant documents. It then bundles those documents with the user's question, forcing the model to generate its answer based strictly on the retrieved context.
When you would use it
You use RAG when you need an AI model to answer questions about proprietary, real-time, or highly specialized data without going through the expensive process of fine-tuning the model itself.
Common operations
- Building a chatbot that answers questions based purely on internal company wikis.
- Reducing LLM hallucinations by forcing citations to specific retrieved documents.