The idea in one paragraph
Instead of asking the model to answer from memory, a RAG system first searches your own content, such as manuals, policies, tickets and product data, finds the passages most relevant to the question, and gives them to the model together with the question. The model then writes an answer based on those passages and can point to where each part came from.
The pieces of a RAG system
- Ingestion: collect documents from your systems and split them into sensible chunks, keeping titles, dates and permissions.
- Embeddings: turn each chunk into a vector, a list of numbers that captures its meaning, so similar ideas sit close together.
- Retrieval: store vectors in a vector database or a search index, and combine meaning-based search with keyword search for better recall.
- Re-ranking: reorder the candidates so the best passages come first.
- Generation: the model writes the answer from the retrieved passages and cites them.
Why RAG instead of fine-tuning
Fine-tuning changes how a model behaves; it is a poor way to teach it facts that change. With RAG, updating the knowledge means updating the documents. Answers can show sources, and you can control who may see what by filtering on permissions at retrieval time.
Where RAG systems fail
- Poor chunking: passages cut in the wrong place lose their meaning.
- Stale or duplicated content: the system faithfully retrieves outdated answers.
- Missing permissions: users see snippets from documents they should not access.
- No evaluation: nobody measures whether the right passage is retrieved or whether the answer is faithful to it.
Related service
AI & Machine Learning
Practical AI built into your products and operations.