Enterprise RAG

RAG architecture for secure enterprise knowledge bases

This reference architecture shows how Retrieval Augmented Generation can be implemented reliably in an enterprise context: documents are processed deterministically, stored with versions, and exposed to agents only through read-only retrieval APIs and MCP.

What is a RAG architecture?

A RAG architecture describes the technical structure that allows an AI system to answer from verified enterprise sources instead of relying only on model memory.

At its core, Retrieval Augmented Generation combines controlled document ingestion, a centralized knowledge store, a semantic search index, and a retrieval layer for applications, chatbots, or agents. For enterprise use cases, a vector database alone is not enough: versioning, citations, permissions, reindex jobs, and a read-only access path must be designed as architecture decisions.

Key question
understand RAG architecture for enterprises
Target system
secure AI knowledge bases with sources and permissions
Core principle
ingestion writes, retrieval reads, agents do not modify the knowledge base
Enterprise RAG architecture diagram with deterministic ingestion, knowledge store, retrieval layer, agent clients, model runtime, and cloud foundation

Agents have no direct write access to the database or object storage.

Open diagram in new tab

Components of an enterprise RAG architecture

The diagram condenses the architecture visually. The same structure is also described here as a clear architecture overview for decision makers, domain teams, and technical teams.

1

Sources and admin layer

The architecture starts with PDFs, images, text files, Markdown, and controlled upload or bucket-sync processes. The key is that sources remain clearly identifiable.

2

Ingestion worker

The worker extracts text and page images, normalizes content, creates chunks, generates hashes, creates embeddings, and triggers controlled reindex jobs.

3

Knowledge store

Object storage and PostgreSQL with pgvector keep original files, previews, metadata, document versions, chunks, embeddings, and access information together.

4

Retrieval layer

A RAG API and MCP server provide semantic search, document lookup, chunk context, citations, filters, and permissions.

5

Agent clients and model runtime

Clients such as Codex, Claude, or Open Harness use read-only tools only. Models can run self-hosted or as cloud LLMs without receiving direct database access.

6

Operations and compliance

Kubernetes, starkAI Cloud, GDPR alignment, EU AI Act readiness, and ISO-27001-oriented controls belong to the operating model, not to a later add-on layer.

Why this structure holds up

The architecture deliberately separates ingestion, storage, retrieval, and model use. Sources stay traceable, permissions remain auditable, and agents stay controlled in production.

Deterministic ingestion

PDFs, images, and Markdown are normalized, hashed, versioned, and reindexed in a repeatable way. Reindex jobs are controlled instead of implicit.

Centralized knowledge store

Original files, previews, metadata, document versions, chunks, and embeddings stay connected in a clear storage and index layer.

Read-only retrieval

Agents access knowledge through the RAG API and MCP tools. Direct database or storage write permissions are not part of the client path.

How do you evaluate the quality of a RAG solution?

Collect typical questions, expected answers and relevant sources from your team. Assess retrieval and the final answer separately: fluent writing alone does not demonstrate quality.

Does retrieval find the right source?

Compare retrieved passages with approved reference documents selected beforehand. Record relevant information that is missing or displaced by less useful results.

Is the answer supported by the source?

Check correctness, completeness and citations. Even when retrieval finds a relevant passage, the answer must not invent additional facts or omit important qualifications.

Four test cases for a pilot

Illustrative acceptance cases, not measured results.

An approved source contains the answer
Test case
A question about the current travel expense policy has a matching approved reference passage.
Expected behavior
Retrieval finds that passage. The answer accurately represents it and cites the appropriate source and version.
The sources contain no answer
Test case
The question asks for next year's travel budget. No approved source provides that amount.
Expected behavior
The system makes the missing evidence clear and does not invent an amount. A plausible-sounding answer counts as a failure in this case.
A policy has been replaced
Test case
An old and a current policy contain different rules. The old version is no longer valid.
Expected behavior
The answer uses the valid version. After an update, also check whether outdated or deleted content can still be retrieved.
A role cannot access a source
Test case
Ask the same question using an authorized test role and an unauthorized test role.
Expected behavior
The unauthorized role receives neither protected content nor revealing source references. Repeat the test after access is revoked.

Agree acceptance limits with the team before testing. For each case, record the source, retrieval result, answer and unresolved failures, together with response time and operating effort. Repeat tests after changes to sources, retrieval or the model.

Further evaluation guidance: Haystack: Evaluation · Microsoft: RAG design and evaluation

When is this RAG architecture worth it?

An enterprise RAG architecture is useful when knowledge should not only be searched, but also used in an auditable, repeatable, and accountable way.

Internal knowledge bases

Employees need to find policies, project documents, manuals, or process knowledge through search and chat without losing the source trail.

Document-heavy processes

Contracts, invoices, freight papers, technical specifications, or quote documents need to be ingested in a structured way and made reusable.

Agents with controlled access

AI agents should use knowledge without receiving database or storage write permissions. Retrieval becomes the controlled interface between agent and knowledge.

Regulated organizations

When privacy, auditability, tenancy, citations, and version history matter, the RAG architecture has to support those requirements from the beginning.

Common questions about RAG architecture

These answers cover the questions that usually need to be clarified before building an enterprise RAG system.

What is the difference between RAG and a vector database?

A vector database is only one component. A RAG architecture also includes ingestion, chunking, metadata, permissions, citations, retrieval APIs, MCP tools, model access, and operating processes.

Why is deterministic ingestion important?

Deterministic ingestion makes repeated document processing traceable through versions, hashes, and index runs. This matters for audits, debugging, and reliable updates.

What role does MCP play in a RAG architecture?

MCP exposes agent-ready tools such as semantic search, document lookup, and chunk context. Agent clients can use knowledge without direct access to the database or object storage.

Which data belongs in the knowledge store?

Besides embeddings, the knowledge store should keep original files, page previews, extracted assets, document versions, metadata, access information, and generated chunks.

Can the architecture work with cloud LLMs and self-hosted models?

Yes. The retrieval layer decouples knowledge access from the model runtime. Self-hosted models, cloud LLMs, or hybrid setups can be used without changing the enterprise data access path.

Plan a RAG architecture for your knowledge base

stark AI translates distributed documents, permissions, and operating requirements into a robust RAG target architecture with ingestion, knowledge store, retrieval, and operating model.

Start architecture discussion