Retrieval-Augmented Generation (RAG) is the most important pattern for building useful AI on your own data — it grounds an LLM in trusted, current information.
The RAG Pipeline
Grounding AI in your own data.
Tap or hover a part to learn more.
Docs → embeddings.
Split your documents into chunks and convert each to an embedding (a meaning vector), stored in a vector database. Done once, up front.
Check your understanding
1. What does the 'retrieve' step do?
2. Why use RAG over fine-tuning?
Keep learning
How RAG works
- Index — split your documents into chunks and store them as embeddings in a vector database.
- Retrieve — when a question comes in, find the most relevant chunks by semantic search.
- Augment — add those chunks to the prompt as context.
- Generate — the LLM answers using the retrieved facts, not just its training.
RAG dramatically reduces hallucination, keeps answers current without retraining, and lets AI cite sources. It's how most enterprise AI assistants (including document Q&A) are built.
