RAG (retrieval-augmented generation)
Retrieval-augmented generation (RAG) is a technique where an AI model retrieves relevant passages from a knowledge base, such as product documentation, and uses them to generate a grounded answer.
For documentation, RAG works in two steps. First, the docs are split into chunks and indexed as embeddings; when a user asks a question, the system retrieves the most relevant passages. Second, a language model writes an answer using only those passages as context.
The retrieval step gives a docs chatbot current documentation as context instead of relying on model training alone. That helps answers track documentation updates and makes source citations possible, but it does not eliminate model error.
RAG quality depends mostly on the retrieval side: how the docs are chunked, how well the index covers the site, and whether the system admits when nothing relevant was found. Biel.ai's chatbot is built on this pattern: it retrieves from your docs, cites sources, and is designed to decline unsupported questions.
Frequently asked questions
How is RAG different from fine-tuning?
Fine-tuning bakes knowledge into model weights and goes stale as docs change. RAG looks up current documentation at question time, so updating the docs updates the answers.
Does RAG prevent hallucinations?
It reduces them substantially but does not eliminate them. Retrieval grounds the model in real passages, but the system also needs to decline to answer when retrieval finds nothing relevant.
What does RAG stand for?
Retrieval-augmented generation. The model's text generation is augmented with content retrieved from a knowledge base, such as your documentation site.