Skip to content

RAG Architecture for Enterprise AI: How to Build a System Your Business Can Trust

RAG Architecture for Enterprise AI

Key takeaways

  • RAG architecture for enterprise AI has two paths and a control plane. The indexing path turns approved sources into permissioned, searchable passages, the query path retrieves and ranks them for each request, and evaluation, observability and audit span both.
  • Most of the architecture sits outside the model. Pilots usually build the model call and a thin retrieval step well and stub out the rest, and the stubs are what break in production.
  • Pick the simplest pattern your questions need. In an April 2026 benchmark, the best GraphRAG variants beat dense retrieval by about 27 points on multi-hop questions and by under half a point on general ones.
  • Tenant separation is an architecture decision. OWASP's 2026 Top 10 for LLM applications says index-level segregation beats classification tags on a shared index, because it removes the misconfiguration path.
  • On AWS, every layer has a managed option. Amazon S3 Vectors has held up to two billion vectors per index since December 2025, and Bedrock Knowledge Bases added GraphRAG in March 2025 and multimodal retrieval in November 2025.

Quick Answer

What is RAG architecture? RAG architecture is the design of a retrieval-augmented generation system. An indexing path ingests, chunks, embeds and indexes approved content in advance, and a query path checks who is asking, retrieves and reranks the relevant passages, and has a language model answer from them with citations. In an enterprise it also includes the controls around both paths: permissions inside the query, evaluation, observability and audit.

RAG architecture for enterprise AI is how a company gives AI systems its own knowledge without handing them every document. The model supplies language and reasoning, the retrieved passages supply the facts, and the architecture decides which passages a given person may see, how current they are and how each answer traces back to its sources.

We've built data and AI systems on AWS since 2008. This guide draws on Mactores' published retrieval work, including the hybrid retrieval architecture designed for Sterne Kessler's trademark practice, Hibu's retrieval connector for agents and the engineering notes our forward-deployed engineers publish on RAG. AWS, OWASP and research figures were checked on December 1, 2026.

What Is RAG Architecture?

RAG architecture is the set of components that let a language model answer from your content: an indexing path that prepares the content ahead of time and a query path that runs on every request.

Retrieval-augmented generation works as a search system with a model attached at the end, so most architecture decisions are search decisions: how documents are split, which indexes run side by side, how candidates are ranked and how much context the model receives.

An enterprise adds a third part, the control plane. It holds the evaluation set, the traces, the audit records, the freshness and deletion rules and the cost limits for both paths, and it's the part a security review, an auditor or a business owner looks at before signing off.

What Does a RAG Architecture Diagram Show?

A useful RAG architecture diagram shows three layers: the indexing path, the query path and the control plane across both. Each box on it is a design decision someone has to own.

Enterprise RAG architecture diagram: the indexing path runs from approved sources through ingest and parse, chunk and enrich metadata, and embed, into vector, keyword and metadata indexes; the query path runs from a user or agent with identity through query understanding, hybrid retrieval with the permission filter inside the query, rerank and context assembly, and generation with citations and guardrails, to an answer, a refusal or an action; the control plane spans both with the evaluation set, traces and observability, audit and lineage, freshness and deletion, and cost limits

 

Component

Path

Decision you own

Source connectors

Indexing

Which systems are authoritative, and who owns each one

Parsing and chunking

Indexing

Split by structure (headings, sections, tables) or by fixed size

Metadata enrichment

Indexing

Which fields travel with each passage: version, effective date, owner, sensitivity, entitlements

Embedding model

Indexing

Text-only or multimodal, and how you re-embed when the model changes

Indexes

Indexing

Vector, keyword and metadata indexes, shared or separate per tenant

Identity and query understanding

Query

How identity, tenant and purpose reach the query, and how vague questions get rewritten

Hybrid retrieval

Query

Dense and keyword search with permission filters inside the query

Reranking and context assembly

Query

How many candidates to rerank, the context budget and the freshness threshold

Generation and guardrails

Query

Model choice, citation format, refusal path and output checks

Evaluation, observability and audit

Control plane

Release gates, a trace per request and how long evidence is kept

"Seven layers, and the model is just one of them. Pilots usually build two of the seven well, the model call and a thin retrieval step, and stub out the rest. The stubs are what break in production."
Suraj Chaudhary, Generative AI FDE, Mactores

Retrieval is where most enterprise projects quietly fail, because a system can return text that reads like the question while missing the clause, effective date, jurisdiction or entitlement that decides the answer. A hybrid retrieval layer combines several capabilities.

Retrieval capability

Best use

Example

Vector or semantic search

Conceptual questions and paraphrased language

"How do we handle a delayed shipment?"

Keyword or lexical search

Exact identifiers and specialized terms

Part number, SKU, policy clause, invoice ID

Metadata filtering

Permission, jurisdiction, version and business context

California policy, active contract, approved document

Reranking

Precision when many candidate passages exist

The passages that decide the answer

Query rewriting

Ambiguous or multi-part questions

Expanding "refund" into policy, region and product

Tool or API retrieval

Live system-of-record facts

Account balance, order status, entitlement, inventory

Why Do Enterprises Need RAG Architecture Now?

Because the knowledge that answers business questions is private, permissioned, versioned and constantly changing, and a general-purpose model knows none of it.

It sits in SharePoint, Confluence, ServiceNow, Salesforce, data warehouses, contracts, tickets and legacy systems. Retraining a model every time a policy changes isn't practical, and pasting whole collections into a long context window gets more expensive with every token on every call, so retrieval remains how most enterprise systems ground answers in current content.

Business need

What RAG enables

What it prevents

Internal knowledge search

Employees find approved answers faster

Duplicate work and conflicting guidance

Customer support

Agents get grounded, policy-aware responses

Incorrect promises and compliance exposure

Sales and customer success

Teams reach current product and contract context

Stale answers and missed signals

Financial operations

Analysts query governed metrics and documentation

"Shadow" definitions of revenue, churn or margin

Regulated workflows

Source-linked, permission-aware answers

Unsupported claims and audit failures

Operational AI agents

Agents retrieve the rules before they act

Automation based on incomplete context

RAG fits best where the answer has to match today's documents or records. When the workflow needs an action across systems, retrieval becomes one tool inside an agent, and the same index serves both.

What Are the Main Types of RAG Architecture?

Most enterprise systems use one of six patterns, and the right one is the simplest that answers the questions people actually ask.

Pattern

How retrieval works

Use it when

What it adds

Basic RAG

One vector search, top passages to the model

A small, clean, single-source corpus

Little, and it misses exact identifiers

Advanced (hybrid) RAG

Query rewriting, dense plus keyword search, metadata filters, reranking

Enterprise search, policy and support knowledge

An evaluation set and index tuning

Structured hybrid RAG

Metric and record questions go to SQL or APIs, documents to retrieval

Questions about numbers, balances or status

Governed definitions and query checks

GraphRAG

Vector search plus traversal over entities and relationships

Multi-hop questions across related entities

Graph construction and upkeep

Agentic RAG

An agent plans searches, checks evidence and searches again

Questions spanning systems, answers that lead to action

More tokens, latency and audit surface

Multimodal RAG

Text, images, audio and video embedded and retrieved as segments

Manuals with diagrams, recorded calls, video

Multimodal parsing and embeddings

 

Six RAG architecture patterns arranged from simplest to most complex: basic RAG, advanced hybrid RAG, structured hybrid RAG with SQL and APIs, GraphRAG, agentic RAG and multimodal RAG, each with the signal that justifies moving up and what it costs; a band notes that the evaluation set decides when to move up

When does GraphRAG beat standard RAG?

On multi-hop questions, by a wide margin, and on simple lookups, barely at all. In an April 2026 benchmark from NYU Shanghai, the best of five GraphRAG variants on each dataset beat dense retrieval by about 27 points on multi-hop question answering and by under half a point on general questions. The same study found that agentic search "narrows the performance gap to GraphRAG" and that GraphRAG carries substantial offline construction and latency overhead.

"Vector search returns things that read alike; a graph returns things that genuinely relate."
Ammar Nizami, Senior Forward-Deployed Engineer, Data Engineering practice, Mactores

 

Bedrock Knowledge Bases has offered GraphRAG on AWS since March 2025, combining vector similarity search with graph traversal over entities and relationships it stores in Amazon Neptune Analytics. We'd add a graph when the evaluation set shows multi-hop questions failing, which tends to mean supply networks, fraud rings, provider directories and ownership structures.

When should RAG hand off to SQL or a tool?

Whenever the answer is a number, a record or a live state. For a metric question, retrieval finds the text of a definition while a governed query returns the figure, which is why text-to-SQL against governed definitions sits next to document retrieval in a structured hybrid architecture. Account balances, order status and inventory belong behind a tool call that returns the current value, since an index only knows what it last saw.

When is agentic RAG worth the extra cost?

Agentic RAG earns its cost when questions span two or more systems of record and someone acts on the answer. Amazon Bedrock Managed Knowledge Base, generally available since June 17, 2026, includes agentic retrieval that plans queries, evaluates interim responses and reranks for multi-hop questions, so a managed option exists before you build your own agent loop.

Sterne Kessler's patent practice runs the multi-agent form: specialized agents for extraction, reasoning, drafting, validation and compliance draw on historical Office Actions, examiner patterns and past successful arguments, with attorney review at every decision point. Average response time per Office Action dropped from 8 to 12 hours to 2 to 4.

What changes for multimodal content?

Mainly the parsing and the embeddings. Bedrock Knowledge Bases has handled text, images, audio and video since November 2025, returning matching segments of each, which suits equipment manuals full of diagrams, recorded support calls and training video. Permissions, evaluation and audit stay the same.

Which Enterprise Controls Belong in the Architecture?

Four controls shape the architecture itself rather than sitting on top of it: where permissions are evaluated, how tenants are separated, how fresh each source must be, and where data may live.

Authenticate the user before retrieval and pass identity and entitlements into the retrieval request, so the candidate set only ever holds passages that person may open. Filtering results afterwards lets forbidden passages crowd out the permitted ones and turns one missed filter into a disclosure.

"Permissions belong in the data layer, not in the app or the prompt."
Ram Tiwari, Forward-Deployed Engineer, Spark Data Engineer, Mactores
At minimum, the architecture should support these controls.
  • Single sign-on and role-based access control
  • Document-level permissions inherited from the source system
  • Tenant isolation for multi-tenant platforms
  • Geographic and regulatory boundaries
  • Purpose limitation for sensitive data
  • Full retrieval and generation audit logs
  • Deletion and export workflows aligned to privacy obligations

For multi-tenant platforms, the choice is one shared index with tenant filters or separate indexes per tenant or trust zone. OWASP's 2026 guidance on vector and embedding weaknesses prefers separation: "Index-level segregation beats classification tags on a shared index because it removes the misconfiguration path." It recommends physically separated indexes for high-sensitivity workloads.

Freshness sets the ingestion design. Decide the acceptable staleness for each source first, because fifteen minutes means streaming ingestion and incremental updates while overnight means a batch job. Keep a mapping from each document and user to the chunks derived from them, so a deletion request reaches embeddings, caches and indexes, and decide early whether embeddings, indexes, logs and model calls must stay in one Region.

These controls are cheapest to build before the index exists, which is why how to implement RAG in production starts with the source inventory and the permission model rather than the model.

What Does an Enterprise RAG Architecture Look Like on AWS?

Every component has a managed AWS option, and the real choice is how much of the pipeline you run yourself. The right-hand column shows one production-grade design that Mactores built.

Component

AWS options

In the Sterne Kessler design

Ingestion and parsing

Amazon Textract, AWS Step Functions, AWS Lambda

Textract on legal documents in Amazon S3, triggering Step Functions and Lambda workflows

Embeddings

Amazon Titan or Amazon Nova embeddings in Amazon Bedrock

Titan Text Embeddings

Vector and keyword index

Amazon OpenSearch Service, Amazon S3 Vectors, Aurora PostgreSQL with pgvector

OpenSearch vector search and BM25 over 76,000 USPTO records

Reranking

A cross-encoder reranker

Cross-encoder reranking for precision

Generation and orchestration

Amazon Bedrock, Amazon Bedrock AgentCore

Claude 3.5 Sonnet in multi-agent orchestration on Amazon Bedrock

Guardrails and encryption

Amazon Bedrock Guardrails, AWS KMS

Bedrock Guardrails and end-to-end KMS encryption

Structured data and caching

Amazon Aurora, Amazon DynamoDB

Aurora Serverless v2 and DynamoDB for structured data and low-latency caching

That column comes from Sterne Kessler's trademark classification system, designed for a practice classifying applications across the 45 Nice Classes. Its seven-week assessment confirmed classification could fall from 60 to 120 minutes per application to under 10, at 85%+ accuracy.

Vector storage got much cheaper at scale when Amazon S3 Vectors became generally available in December 2025, with up to two billion vectors per index, sub-second responses for infrequent queries, about 100 milliseconds for frequent ones, and up to 90% lower cost to upload, store and query vectors by AWS's figures. We'd use it for very large collections where a little more latency is acceptable, and keep OpenSearch for low-latency hybrid search.

For agents, retrieval increasingly sits behind a tool interface. Hibu's conversational analytics gives Claude hybrid keyword and semantic search across an OpenSearch index through a purpose-built MCP connector inside Hibu's own VPC, with Microsoft Entra ID app roles mapped to read-only OpenSearch roles and no write path for the agent. For agent memory and retrieval we typically use AgentCore Memory, Amazon Bedrock Knowledge Bases, Amazon OpenSearch Serverless and Amazon Aurora with pgvector, chosen per workload.

Where Does RAG Fit Next to Fine-Tuning, Agents and an Ontology?

Each solves a different problem, and most enterprise systems combine them.

Approach

Choose it when

Typical enterprise use

RAG

The answer depends on internal knowledge that changes often

Policy assistants, support copilots, sales enablement, document intelligence

Fine-tuning

You need consistent style, domain language or a specialized task pattern

Classification, extraction, controlled drafting, narrow domain adaptation

AI agents

The workflow needs actions across systems, beyond answers

Claims intake, procurement, ticket triage, customer onboarding

Semantic layer or ontology

Metrics, entities and rules must mean the same thing everywhere

Finance, product analytics, customer success, regulated reporting

Retrieval is usually the starting point for knowledge access. Fine-tuning earns its place when behavior misses a target, such as a format or a classification, while retrieval keeps supplying the facts, which is how most RAG vs fine-tuning decisions end.

Retrieval also has a limit that no index tuning fixes: it finds the passage, and it can't tell the model which definition or rule applies. That's why AI grounding for agents adds governed definitions, rules and live records next to the documents.

What Does Each Architecture Choice Cost?

Model inference is one line among seven. Data preparation, indexing, retrieval, security, evaluation and change management decide most of the budget, and the architecture decides how fast each one grows.

Cost category

What drives it

How to control it

Data ingestion and preparation

Source complexity, document quality, refresh frequency

Start with high-value sources and automate incremental ingestion

Vector storage and indexing

Corpus size, update frequency, retention requirements

Tier storage, prune stale content, use metadata-aware indexing

Retrieval and reranking

Query volume, latency targets, reranker complexity

Cache common queries and escalate only when needed

LLM inference

Token volume, model choice, context size

Retrieve fewer, better passages and route simple queries to smaller models

Security and compliance

Identity integration, audit depth, residency, monitoring

Build controls into the platform once, not into each use case

Evaluation and operations

Test coverage, monitoring, incident response

Set golden questions and release gates before launch

Change management

Adoption, training, workflow redesign

Embed the assistant in existing systems and measure task completion

Route by question. Send lookups down the standard retrieval path, escalate to multi-step or agentic retrieval only when the question needs it, and measure cost per resolved task rather than per query, because an answer that gets escalated also carries the reviewer's time.

How Do You Secure a RAG Architecture?

Design each threat out at the layer where it enters. Most RAG security failures start in the index or the retrieval step, well before the model writes anything.

Threat

Where it enters

Architectural control

Prompt injection in documents

Ingestion and context assembly

Treat retrieved text as data, allowlist tools, test for injection before release

Corpus poisoning

Source connectors

Accept approved sources only, validate content on ingest, audit the index

Permission leakage

Retrieval

Entitlements inside the query, chunk-level access, entitlement tests in CI

Residency violations

Indexes, logs and model calls

Pin indexes, logs and inference to the required Region

Overconfident answers

Generation

Citations, confidence thresholds and a refusal path

Audit gaps

Control plane

Immutable logs of prompts, retrieved chunks, responses and tool calls

Access sprawl

Identity

Roles per use case, least privilege, separate indexes for sensitive data

Run a red-team evaluation before each material release, and keep a person on decisions with real consequences.

How Do You Measure Whether the Architecture Works?

Measure the workflow as well as the model. Each layer of the architecture has a metric that shows whether it's doing its job.

Metric

What it tells you

Target discipline

Retrieval precision

Whether the top results are relevant

Review against a curated evaluation set

Answer groundedness

Whether every material claim is supported by retrieved evidence

Require citations and test unsupported-answer rates

Permission accuracy

Whether the system exposes only authorized content

Test across roles, tenants and geographies

Time to answer

Whether the experience meets the workflow's needs

Set latency targets by use case

Cost per resolved task

Whether the economics hold

Track tokens, retrieval calls and escalations

Task completion

Whether the user finished the job

Measure workflow outcomes, not thumbs up or down

Escalation rate

How often the system routes to a person

Separate healthy escalation from failure

Freshness

Whether answers rest on current approved content

Monitor index lag and source-version drift

Leadership needs five of these on one view: adoption, resolution quality, cost, risk exceptions and business impact. Programs whose sponsors can't see those tend to lose them.

What Should You Decide Before You Build?

Start with one bounded workflow where the value is clear, the data is governed and success can be measured, then answer these questions in writing.

  • Which decision or workflow will this improve?
  • Which sources are authoritative?
  • Who owns each source and each business definition?
  • Which users may see which content?
  • What happens when retrieval returns no confident answer?
  • Which actions require human approval?
  • How will the system handle conflicting or outdated documents?
  • What evidence will prove the system created value?
  • Who responds when it produces a wrong or unsafe answer?

About 12 weeks to production is realistic for a scoped use case when the authority boundary, the source systems and the evaluation set are settled in the first two weeks. Twelve weeks is also the median from kickoff to production across Mactores engagements.

How Can Mactores Help You Build a RAG Architecture?

We design and build RAG architectures on AWS as part of our AI agents for apps work, starting from one workflow: its authoritative sources, its permission model and its evaluation set. From there we choose the pattern the questions need, from hybrid retrieval to GraphRAG or an agent, and build the controls around it.

Aedeon, the agent platform we deliver with, handles knowledge ingestion, retrieval indexing, evaluation harnesses and observability. Forward-deployed engineers own the architecture decisions: what the system may do, what people must approve and how it behaves when it doesn't know. When the knowledge sits in a legacy application that can't expose clean, permissioned content, we treat that as application and database modernization with a retrieval outcome attached.

Mactores has built on AWS since 2008 and is an AWS Premier Tier Services Partner. Engagements run on a fixed date, a fixed fee and customer-signed acceptance, and 94% of projects have been delivered on or ahead of schedule. Bring one workflow and its sources, and a forward-deployed engineer will reply with the authority boundary and the platform work it implies.

FAQs

What is RAG architecture?

RAG architecture is the design of a retrieval-augmented generation system: an indexing path that prepares approved content in advance and a query path that retrieves the relevant passages for each request and has a model answer from them with citations. Enterprise versions add permissions inside the query, evaluation, observability and audit around both paths.

What are the main components of a RAG architecture?

On the indexing side, source connectors, parsing and chunking, metadata enrichment, an embedding model and the indexes. On the query side, identity, query understanding, hybrid retrieval, reranking, context assembly, generation and guardrails. Evaluation, observability and audit span both.

What are the 5 steps of RAG?

Ingest, index, retrieve, augment and generate. Content is parsed, split into passages and indexed; the passages most relevant to a question are retrieved and reranked; they're added to the prompt; and the model writes an answer that cites them.

What are the main types of RAG architecture?

Basic RAG, advanced or hybrid RAG, structured hybrid RAG that routes to SQL or APIs, GraphRAG, agentic RAG and multimodal RAG. Most enterprise systems start with hybrid RAG and add the others when an evaluation set shows they're needed.

Is GraphRAG better than RAG?

For multi-hop questions about related entities, usually yes, and for single-fact lookups, rarely. A 2026 benchmark found the best GraphRAG variants far ahead of dense retrieval on multi-hop questions and about level on general questions, with a higher offline construction and latency cost.

Is ChatGPT a RAG system?

A chat assistant works as RAG when it searches a source at question time, such as the web, uploaded files or a company index, and answers from what it found. Without that retrieval step, the model answers from its training data alone.

Can RAG prevent hallucinations?

It reduces them but doesn't eliminate them. Grounding answers in retrieved passages cuts unsupported claims, and you still need retrieval evaluation, citations, confidence thresholds, a refusal path and human review for high-risk decisions.

How should a multi-tenant RAG architecture separate customers?

Use separate indexes per tenant or trust zone for sensitive data, and enforce tenant scope inside the query, validated on the server, wherever an index is shared. Filtering results after retrieval leaves one misconfiguration away from a cross-customer disclosure.

Which AWS services support an enterprise RAG architecture?

Amazon Bedrock and its knowledge bases for managed retrieval and generation; Amazon OpenSearch Service, Amazon S3 Vectors or Aurora PostgreSQL with pgvector for indexes; Amazon Neptune Analytics for GraphRAG; Amazon Bedrock AgentCore for agents; and Bedrock Guardrails, AWS KMS and Amazon CloudWatch around them. The mix depends on latency, scale, residency and how much of the pipeline you want to run yourself.

 

Gautham B, Forward-Deployed Engineer, Data Engineering practice.

Written by

Gautham B

Forward-Deployed Engineer, Data Engineering practice.

Gautham ships production data platforms for Mactores customers. Five years in complex data engineering, with a working depth on Apache Iceberg that shows up in the scalability of the foundations he builds. On engagement, he takes the discovery Mactores produces and turns it into the schema, partition, and lineage decisions the customer’s operations team runs on after cutover. His engagements close on customer-signed acceptance — the delivery commitment every Mactores FDE ships against.

Let's deliver

Bring us the process. We will bring the authority model.

The agent-native AWS modernization firm. Data platforms moved. Legacy retired. AI agents in production. AWS Premier Tier Services Partner since 2026, on AWS since 2008.

  • 01 AWS Premier Tier Services Partner, on AWS since 2008.
  • 02 Forward-deployed engineers own architecture, cutover and the date.
  • 03 Acceptance criteria per phase, with the signer named in the SOW.
  • 04 The golden set and the trace data belong to you.