BLOG ·
7 MIN READ
Enterprise RAG: How to Build Retrieval-Augmented Generation That Works in Production
A research-led guide for enterprise teams evaluating production AI systems.

Drew Brooker
ML Engineer
- RAG DEVELOPMENT
- RETRIEVAL AUGMENTED GENERATION
- ENTERPRISE RAG ARCHITECTURE
- RAG EVALUATION
Enterprise RAG connects a language model to company information at runtime.
The basic concept is simple. A user asks a question, the system retrieves relevant evidence, and the model answers with that evidence in context.
Production RAG is harder because every stage between the source document and the final answer can fail.
Documents can be parsed incorrectly. Tables can lose structure. Chunks can split related evidence. Search can miss the right passage. Reranking can bury it. Permission filters can leak or hide information. The model can receive the correct evidence and still use it incorrectly.
A production RAG system should therefore be treated as a retrieval system and a generation system with separate tests.
Enterprise RAG architecture

FIGURE 1
A production RAG system contains several independently testable stages.
| Layer | Purpose | Example failure |
|---|---|---|
| Sources | Authoritative company information | Wrong source selected |
| Parsing | Extract usable structure | Table lost |
| Chunking | Create retrievable units | Evidence split |
| Metadata | Preserve source attributes | Missing date or owner |
| Index | Make content searchable | Incomplete indexing |
| Query | Express information need | Weak search request |
| Retrieval | Find candidate evidence | Correct passage absent |
| Permission filter | Enforce access | Unauthorized content exposed |
| Reranking | Order candidates | Distractor ranks first |
| Context assembly | Select model evidence | Too much noise |
| Generation | Answer from evidence | Unsupported claim |
| Citation | Point back to source | Wrong source attached |
| Evaluation | Measure behavior | Failure remains invisible |
Start with the knowledge problem
Before selecting a vector database or embedding model, define the knowledge the application needs.
Create a source inventory.
| Source | Update rate | Authority | Permissions | Structure |
|---|---|---|---|---|
| Product docs | Weekly | Product team | Internal/public | HTML/Markdown |
| Contracts | Event-driven | Legal | Account-specific | PDF/DOCX |
| CRM | Continuous | Sales/ops | Role-based | Structured |
| Support tickets | Continuous | Support | Internal | Text |
| Policies | Monthly | Compliance | Role-based | Documents |
| Inventory | Continuous | Operations | Internal | Database |
The inventory determines ingestion, freshness, permissions, and retrieval design.
EVALUATE PARSING ON REPRESENTATIVE SOURCE TYPES
Parsing matters
A PDF is not a sequence of clean paragraphs.
It can contain headers, footers, tables, multi-column layouts, footnotes, images, captions, and scanned pages.
A parser that flattens a pricing table into meaningless text can destroy the evidence before retrieval begins.
Evaluate parsing on representative source types.
Questions include:
- Are headings preserved?
- Are table rows understandable?
- Are page references retained?
- Are lists preserved?
- Are repeated headers removed?
- Are document dates and versions captured?
- Are images or diagrams relevant to the use case?
THERE IS NO UNIVERSAL CHUNK SIZE
Chunking is an information-design problem
Chunks should preserve enough local context to answer likely questions.
Very small chunks can lose relationships. Very large chunks can reduce retrieval precision and consume context.
There is no universal chunk size.
A contract clause, API reference, support article, product catalog, and research report have different structures.
Structure-aware chunking gives the retrieval system more useful units than blind character windows.
FILTERING, FRESHNESS, DEBUGGING, AND CITATIONS
Metadata turns retrieval into a controllable system
Useful metadata can include:
- source ID;
- document title;
- section;
- owner;
- creation date;
- last updated date;
- product;
- region;
- customer;
- document type;
- version;
- permission group;
- validity period.
Metadata supports filtering, freshness, debugging, and citations.
A PRODUCTION SYSTEM CAN USE BOTH
Combine retrieval methods
Enterprise search benefits from combining methods.
| Method | Strength |
|---|---|
| Semantic retrieval | Conceptual similarity |
| Keyword retrieval | Exact terms, codes, names |
| Metadata filters | Scope and permissions |
| Database queries | Structured facts |
| Graph traversal | Explicit relationships |
| Reranking | Better ordering of candidates |
A user asking about invoice INV-49328 needs exact matching. A user asking which policy applies to an unusual refund case needs semantic retrieval. A production system can use both.
Permission-aware retrieval
Permission filtering belongs inside the retrieval path.
The agent should not retrieve documents the current user cannot access and rely on the model to keep them secret.
A useful path is:
identity ↓ authorized query ↓ candidate retrieval ↓ permission filter ↓ rerank ↓ evidence
This is especially important when a shared index contains information from several departments, customers, regions, or security classes.
RERANKING AIMS FOR PRECISION
Reranking
Initial retrieval aims for recall: find a useful candidate set.
Reranking aims for precision: put the strongest evidence near the top.
This separation lets a fast method gather candidates and a more precise one order them.
A reranker can score candidates against the actual query after the initial search.
Context assembly
More context is not automatically better.
The system should send the model evidence that is relevant, current, authorized, and sufficiently complete.
Excess context adds cost and can dilute the strongest evidence.
Anthropic's work on context engineering describes context as a finite resource and argues for curating high-signal information during inference.
Citation design
Citations should preserve a path back to the underlying source.
A useful citation object can include:
{
"source_id": "policy-2026-04",
"title": "Refund Policy",
"section": "Enterprise Accounts",
"updated_at": "2026-04-12",
"passage_id": "p-184"
}The model can then attach source references to claims that depend on retrieved material.
CREATE TEST QUERIES WITH KNOWN RELEVANT EVIDENCE
Evaluate retrieval before generation

FIGURE 2
Retrieval and generation should be tested separately.
Create test queries with known relevant evidence.
For each query, record the document or passage that should be retrieved.
Then measure:
| Measure | Question |
|---|---|
| Recall@k | Did the candidate set contain the needed evidence? |
| Precision@k | How much retrieved content was useful? |
| MRR | How high did the first relevant result rank? |
| NDCG | Did the ranking order relevant evidence well? |
| Permission accuracy | Were unauthorized results excluded? |
| Freshness accuracy | Did current evidence outrank obsolete material? |
Only after retrieval works should final-answer evaluation carry much weight.
PRESERVE THE CASE AS REGRESSION COVERAGE
RAG failure matrix

FIGURE 3
The fix depends on whether evidence exists, is retrieved, and is used correctly.
Failure A: evidence is absent from the corpus
Fix ingestion or source coverage.
Failure B: evidence exists but retrieval misses it
Fix query construction, indexing, filters, retrieval, or ranking.
Failure C: evidence is retrieved but the answer is wrong
Fix context assembly, instructions, model choice, or answer evaluation.
Failure D: evidence and answer are correct
Preserve the case as regression coverage.
THE SYSTEM NEEDS SEVERAL KINDS OF RETRIEVAL
Hybrid search example
Suppose an employee asks:
HYBRID SEARCH EXAMPLE
What warranty applies to the XR-440 unit sold to Acme in Germany last March?
The system needs several kinds of retrieval.
- 1Exact entity lookup for XR-440.
- 2Customer lookup for Acme.
- 3Region filter for Germany.
- 4Date filter for the sale.
- 5Semantic retrieval over warranty language.
- 6Current-policy check.
- 7Permission check for account records.
Pure vector similarity is an incomplete architecture for this question.
Freshness
Changing information needs a freshness policy.
Possible mechanisms include:
- event-driven updates;
- scheduled synchronization;
- document versioning;
- validity dates;
- source priority;
- stale-document suppression;
- deletion propagation.
A RAG system that retrieves a superseded policy accurately is still wrong.
"JUST IN TIME" RETRIEVAL
RAG for agents
An agent can use retrieval as a tool and pull context as it works.
Anthropic's context-engineering guidance describes "just in time" retrieval, where an agent maintains lightweight references and loads information as needed during execution.
That approach is useful for long-running work because it avoids filling the context window with information that never becomes relevant.
Production RAG checklist
Corpus
- Are authoritative sources defined?
- Is source ownership clear?
- Are update paths known?
- Are deletions propagated?
Parsing
- Are tables preserved?
- Are headings retained?
- Are dates and versions captured?
- Are scanned documents handled?
Retrieval
- Are semantic and lexical methods tested?
- Are structured sources queried directly where appropriate?
- Is reranking measured?
- Are permissions enforced before context reaches the model?
Evaluation
- Is there a query/evidence test set?
- Is retrieval measured independently?
- Are freshness cases included?
- Are permission cases included?
- Are unsupported answers measured?
Operations
- Can a bad answer be traced to the exact evidence?
- Can the team inspect ranking?
- Are source and index versions recorded?
- Are regressions tested before release?
FAQ
Enterprise RAG is retrieval-augmented generation built around company knowledge, systems, permissions, freshness requirements, and production evaluation.
No. RAG supplies evidence. Retrieval can fail, and a model can misuse correct evidence. Both retrieval and generation need evaluation.
No. A retrieval system can combine vector search, keyword search, metadata filtering, database queries, graph methods, or other search mechanisms.
Measure retrieval with known query/evidence pairs, then measure answer grounding and task success. Keep the layers separate so failures can be diagnosed.
Use RAG when the application depends on current, proprietary, sourceable, or permission-sensitive information that should be supplied at inference time.
Sources
- PAN ET AL.
- Characterizing Agents in Production, ICML 2026, IBM Research.
- LANGCHAIN
- State of Agent Engineering, June 2026.
- ANTHROPIC
- Building Effective Agents.
- ANTHROPIC
- Effective Context Engineering for AI Agents.
- ANTHROPIC
- Demystifying Evals for AI Agents, January 2026.
- OPENAI
- Evaluate Agent Workflows and Optimizing LLM Accuracy.
- NIST
- Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile, NIST AI 600-1.
- GOOGLE CLOUD
- Fine-tuning LLMs and AI Models.
Editorial note
Charts based on survey findings identify their source in the caption. Mathematical examples are labeled as illustrations. Architecture diagrams and decision frameworks are original explanatory assets created for this post.