InsightsRAG architecture

RAG architecture in production: how the big ones build it.

How an AI system prepares your documents, plans each question, searches only permitted sources, checks the evidence and answers with citations. Plus how OpenAI, Anthropic, LangGraph, Microsoft, AWS and Google implement it.

30 minutes · remote · Ludwig Oswald, Munich

For
IT leadership, architects, product owners
As of
22 Oct 2026
Sources
Vendor documentation, research papers
By
Ludwig Oswald, Cloud & Solution Architect
01 Short

The architecture in three points.

  1. Retrieval-augmented generation (RAG) runs on two lanes: documents are prepared and indexed offline, questions are answered online.
  2. Retrieval only covers what the user may see. Web search is a tool you switch on deliberately, not a required part.
  3. If the evidence is too weak, the system re-plans a limited number of times. Then it says openly that it found no answer instead of guessing.
02 Diagram

The flow at a glance.

Top: preparing the documents. Below: answering a question. Bottom: evaluating and observing.

RAG architecture in production
RAG architecture in productionIndexing offline: sources are parsed, chunked, enriched with context and access rights, embedded and indexed for vector and keyword search. Query online: the question is classified and searched directly, decomposed or rewritten; chit-chat needs no retrieval. Retrieval returns only what the user may see: hybrid search over the index, SQL or graph, web search, live systems through connectors or MCP. Hybrid results are fused and reranked; results from SQL, graph, web and live systems go straight to the evidence check. If the evidence is enough, the model answers with citations; if not, the question is re-planned a limited number of times, otherwise there is no answer. Evaluation and observability run across the whole system.INDEXING · OFFLINE, ON EVERY CHANGEQUERY · ONLINEPLANRETRIEVE · ACLFUSE · RERANKfeeds hybrid searchonly what the user may seenot ranked lists:straight to the checkyeschit-chat:no retrievalno: re-plan,capped, elseno answerSourcesdocs · wikis · DBsParselayout · OCRChunkstructure-awareEnrichcontext · ACLEmbedembedding modelIndexvector + keywordQuestionPlanclassify · routeDirectsingle queryDecomposesub-questionsRewriteclarify · HyDEHybrid searchvector + BM25SQL · graphnumbers · relationsWeb searchoptional · allow-listLive systemsconnectors · MCPFuseRRFRerankreranker modelEvidence checkenough to answer?Generategrounded in resultsAnswerwith citationsEVALUATE & OBSERVEtraces · recall@k · faithfulness · routing accuracy · LLM judge + human review · injection guards
The moving arrowheads show where the data flows. Dashed: shortcut without retrieval and the capped way back. With reduced motion the animation starts only on request.
03 Building blocks

Six building blocks, and what each one does.

Index, offline

Sources are parsed, chunked, enriched with context, metadata and access rights, embedded and indexed for vector and keyword search. This runs on every change, not on every question.

  • Parsing
  • Chunking
  • Embeddings
  • Hybrid index

Anthropic, Contextual Retrieval, read 22 Oct 2026 · AWS, Chunking in Knowledge Bases, read 22 Oct 2026

Plan

Each question is classified: search directly, split into sub-questions or rewrite. Chit-chat needs no retrieval. The classification is often wrong, 54.52 % accuracy in one study, so a way back belongs in the design.

  • Routing
  • Decomposition
  • Rewriting

Jeong et al., Adaptive-RAG, NAACL 2024, read 22 Oct 2026

Retrieve with permissions

Hybrid search over the index, SQL or graph for numbers and relations, web search only when needed, live systems through connectors or the Model Context Protocol (MCP). Access rights apply at retrieval: only what the user may see is found.

  • Hybrid search
  • SQL
  • MCP
  • Access rights

Microsoft, Data, privacy and security for Microsoft Copilot, read 22 Oct 2026 · Anthropic, Model Context Protocol, read 22 Oct 2026

Fuse and rerank

Result lists from vector and keyword search are merged with reciprocal rank fusion and re-sorted by a reranker. Results from SQL or a graph are not ranked lists and go straight on.

  • RRF
  • Reranker

Cormack, Clarke, Büttcher, SIGIR 2009, read 22 Oct 2026 · Nogueira, Cho, Passage Re-ranking with BERT, read 22 Oct 2026

Check the evidence

Are the hits enough for an answer? If not, the question is re-planned a limited number of times, for example rewritten or sent to another source. Azure does exactly one retry. Then the system says openly that it found no answer.

  • Corrective RAG
  • Way back

Yan et al., Corrective RAG, read 22 Oct 2026 · Microsoft, Agentic retrieval, read 22 Oct 2026

Answer and measure

Every statement points to the passage that supports it. Retrieval (recall@k) and answers (faithfulness) are measured separately, and every step is traced.

  • Citations
  • Recall@k
  • Faithfulness

Anthropic, Citations, read 22 Oct 2026 · Es et al., RAGAS, EACL 2024, read 22 Oct 2026

04 How the big ones do it

How OpenAI, Anthropic, LangGraph, Microsoft, AWS and Google implement it.

Two points each, checked against the vendors’ documentation.

01

OpenAI

File search combines semantic and keyword search, with adjustable weights. Default chunks: 800 tokens with 400 overlap.

OpenAI, File search, read 22 Oct 2026 · OpenAI, Retrieval, read 22 Oct 2026

02

Anthropic

The Research feature works with a lead agent, parallel subagents and a separate citation step. Claude Code finds files just in time with grep and glob, without a vector index.

Anthropic, Multi-agent research system, read 22 Oct 2026 · Anthropic, Effective context engineering, read 22 Oct 2026

03

LangGraph

Corrective RAG grades the hits; if they are weak, the question is rewritten and searched on the web. Adaptive RAG routes web search as a branch of its own.

LangGraph, Corrective RAG, read 22 Oct 2026 · LangGraph, Adaptive RAG, read 22 Oct 2026

04

Microsoft

Azure AI Search splits a question into parallel subqueries and reranks each; planning with a language model is still in preview. Microsoft Copilot only surfaces data the user can at least view.

Microsoft, Agentic retrieval, read 22 Oct 2026 · Microsoft, Copilot privacy, read 22 Oct 2026

05

AWS

Bedrock Knowledge Bases offer query decomposition, reranking and metadata filters, plus text-to-SQL on Redshift and GraphRAG with Neptune.

AWS, Configure queries, read 22 Oct 2026 · AWS, Structured data store, read 22 Oct 2026

06

Google

Grounding with Google Search keeps logs for up to three days, and this cannot be switched off. Web Grounding for Enterprise logs no customer data.

Google Cloud, Zero data retention, read 22 Oct 2026 · Google Cloud, Web Grounding for Enterprise, read 22 Oct 2026

As of 22 Oct 2026. Vendors change their services all the time; every card names where it comes from and the day I read it.

05 What we don’t claim

Four common assumptions, checked.

01

“Web search is always part of it.”

It is an optional tool. With Azure and Microsoft Copilot the generated search queries leave the compliance boundary, and web pages can carry hidden instructions.

Microsoft, Web knowledge source, read 22 Oct 2026 · Microsoft, Web search in Copilot, read 22 Oct 2026

02

“Permissions are checked after the search.”

The big vendors filter at retrieval: only what the user may see is found. A filter afterwards lets content into processing first.

Microsoft, Copilot privacy, read 22 Oct 2026 · Glean, How connectors power Glean, read 22 Oct 2026

03

“Every RAG system needs a vector database.”

Claude Code searches the files directly, without an index. For numbers and metrics a SQL query is often the more precise way.

Anthropic, Claude Code FAQ, read 22 Oct 2026 · AWS, Structured data store, read 22 Oct 2026

04

“More planning is always better.”

Multi-step retrieval cost 3.3 to 8.8 times a single search in Adaptive-RAG. Planning pays off for hard questions, not for every one.

Jeong et al., Adaptive-RAG, NAACL 2024, read 22 Oct 2026

06 Questions

Questions about the architecture.

Do we need our own platform, or is a cloud service enough?

Amazon Bedrock Knowledge Bases, Google RAG Engine and Azure AI Search ship many building blocks ready-made. The differences are in the details: Bedrock offers hybrid search only with certain vector stores, only Azure documents fusion with RRF, and Azure’s language-model planning is still in preview. A check against your requirements shows which gaps remain for you.

AWS, Configure queries, read 22 Oct 2026 · Microsoft, Hybrid search scoring, read 22 Oct 2026

How do we stop people getting answers from documents they may not see?

Access rights belong on every chunk in the index and apply at retrieval. Azure AI Search offers document-level security filters for this. For Bedrock, AWS explicitly describes the ACL filter of the managed knowledge base as not being authorization; the check then stays with your application.

Microsoft, Document-level access control, read 22 Oct 2026 · AWS, ACL awareness, read 22 Oct 2026

How do we measure whether the system answers well?

Separately for retrieval and answers: recall@k shows whether the right chunks are found, faithfulness shows whether the answer stays with the evidence. Language models as judges help to scale, but have known biases; a human sample belongs in the process.

Es et al., RAGAS, EACL 2024, read 22 Oct 2026 · Zheng et al., Judging LLM-as-a-Judge, NeurIPS 2023, read 22 Oct 2026

Read on: Chunking strategies · Claude with EU processing · Your own AI environment

Terms in this article 11
Chunking
Splitting documents into sections that are embedded and searched one by one. How they are split affects whether search finds the right passage.
Embedding
A representation of a text as a vector of numbers. Texts with similar meaning lie close together, which is what vector search relies on.
GraphRAG
RAG that also searches a knowledge graph of entities and their relationships. It helps with questions about connections spread across many documents.
Hybrid search
A combination of vector search by meaning and keyword search, usually with BM25. The two result lists are merged afterwards.
LLMLarge Language Model
A model trained on large amounts of text that understands and generates text, for example Claude, GPT or Gemini.
LLM-as-a-judge
A language model rates a system’s answers against fixed criteria, for example whether the evidence supports them. It does not replace human spot checks.
MCPModel Context Protocol
An open protocol through which AI applications use tools and data sources. An MCP server provides, for example, a calendar, tickets or a database.
RAGRetrieval-Augmented Generation
A language model answers on the basis of passages retrieved from your sources beforehand and cites them, so the answer rests on your documents rather than on training knowledge.
RAGAS
A set of metrics to evaluate RAG systems, for example whether answers are supported by the retrieved evidence and whether the results fit the question.
Reranker
A model that reads the results of a first search together with the question and re-sorts them. More precise than the first search but costlier, so it runs only on the top candidates.
RRFReciprocal Rank Fusion
A method that merges several result lists by the rank of each result, not by its score. This is how vector and keyword search can be combined.

All terms in the glossary →

07 Contact

Planning a RAG system?

In the intro call we work out which building blocks your cloud provider ships ready-made and which gaps remain.

I use your details only to answer your enquiry. More in the privacy policy.