Accurate answers
Answers are grounded in your own sources, not the model's general training. Fewer hallucinations, more answers you can actually use.
Guide
RAG is the technology that lets a language model answer questions from your own documents, with source citations you can verify. Here's how it works, and how PrivateGPT uses it in your own Azure environment.
What is RAG?
Retrieval-Augmented Generation (RAG) is an architecture that combines two steps: finding the relevant material in your own sources, and generating an answer grounded in that material.
Instead of a language model answering only from what it was trained on, it's shown the most relevant excerpts from your documents, websites or SharePoint — and generates an answer using them as the basis. The model never sees your entire knowledge base, only what it needs for the question at hand.
That's why RAG stays accurate at scale, works on large document collections, and why PrivateGPT's RAG can run in your own Azure environment under your control.
How it works
Your documents are split into smaller pieces (chunks) and turned into embeddings — mathematical vectors that represent meaning. They're stored in a search or vector index together with metadata used for filtering — e.g. source, document library, workspace, assistant scope and access-related attributes.
When a user asks a question, it's converted to the same vector format. The system finds the most relevant chunks — a semantic match, not just keywords — filtered by the scope and rights the user and assistant have access to.
A second model reviews the candidates and reorders them by actual relevance to the question, not just vector similarity. This is where modern RAG differs from earlier generations.
The language model receives the question plus the top-ranked chunks as context and generates an answer grounded in that material — with citations back to the source documents.
Benefits
Answers are grounded in your own sources, not the model's general training. Fewer hallucinations, more answers you can actually use.
Every answer points back to the material it's based on. Users can verify directly.
New knowledge can be used as soon as the document is indexed. No retraining of the model is required — but the actual sync and indexing frequency depends on your chosen setup.
In PrivateGPT, RAG runs in your own Azure environment. Documents, index and access control stay under your control, and documents aren't used for model training — only the context needed per answer is used.
Access filtering happens before material reaches the model. Users only see what they already have rights to.
RAG makes it possible to work with large document libraries because the system only retrieves the most relevant excerpts per question. The actual scale depends on architecture, data sources, indexing and operations.
Modern RAG
The basic principle is still retrieval + generation. But the technique has evolved significantly — where RAG in 2023 was mostly about finding text excerpts that looked like the question, modern RAG does much more to hit the right answer.
A combination of semantic vector search and classical keyword search (BM25). Semantics understand what the user means; keywords catch names, codes and exact terminology. Together they beat either method alone.
A cross-encoder model reorders candidates by actual relevance, not just vector similarity. Catches nuances that semantic search misses.
The user's question is reformulated before retrieval — expanded with synonyms, split into sub-questions, or enriched with context from the conversation history. Better input gives better results.
Filtering happens before material is presented to the model, not in the response. Data the user can't see never reaches the language model.
Modern RAG returns not just an answer but also which excerpts back each claim. Users can follow the source in a single click.
Complex questions aren't answered in one retrieval call. The system retrieves, reasons, retrieves again — until it has the material it needs.
When RAG fits
RAG in PrivateGPT
PrivateGPT is built around RAG as one of the core platform features. It's available both to end users and as a foundation for your own assistants.
PrivateGPT can use both Azure AI Search and Qdrant as the search and vector layer, depending on your setup. Regardless of the search layer, PrivateGPT handles the RAG pipeline itself: document ingestion, chunking, embeddings, retrieval, filtering, source handling, assistant scope and access control.
An HR assistant, for example, can be scoped to HR policies and onboarding material, while a legal assistant works with contract templates and compliance documents.
Ready to see it in practice?
Book a demo — we'll start from a couple of your real documents and show how RAG answers your own questions, with source citations, access control and everything that goes with it.