Definition·
LLM

RAG (Retrieval-Augmented Generation)

RAG is a technique that combines an LLM with a search engine over your own documents: the model retrieves the relevant information first, then generates an answer grounded in that information.

Detailed explanation

Retrieval-Augmented Generation injects your own knowledge into an LLM without retraining it. Workflow: (1) your documents are split into chunks and turned into embeddings stored in a vector database; (2) at query time, the most relevant chunks are retrieved; (3) those chunks are added to the prompt sent to the LLM, which generates an answer grounded in your data. RAG drastically reduces hallucinations, allows source citation, and keeps knowledge up to date without re-training. It is the most common architecture for enterprise AI assistants.

Examples

Internal assistant that answers HR or IT questions from company documentation
Legal chatbot that cites the exact articles of law
Technical support tool searching the product knowledge base

Frequently asked questions

What is the difference between RAG and fine-tuning?

RAG injects knowledge at query time without retraining. Fine-tuning changes the model itself to adopt a style or behavior. They are complementary.

Which vector database should I choose for RAG?

pgvector (PostgreSQL) for simplicity, Qdrant or Weaviate for scale, Pinecone for fully managed. Choose based on your existing stack.

Related terms

Last updated: 7/15/2026

Talent AI

Turn theory into practice

Post a mission or join the community of top AI, Data and Machine Learning experts.