Signal board
ENGINEERING NOTE / AI EngineeringLONGFORM

Enterprise RAG Architecture: Permissions, Hybrid Retrieval, Reranking, Freshness & Evaluation

A production RAG architecture guide covering permission-aware retrieval, ingestion, hybrid search, reranking, freshness, provenance, evaluation, latency, and multi-tenant design.

Enterprise RAG Architecture: Permissions, Hybrid Retrieval, Reranking, Freshness & Evaluation featured visual

Enterprise retrieval-augmented generation is not a vector-database feature. It is an information-access system that has to preserve source permissions, keep indexed knowledge fresh, retrieve the right evidence, rank it well, show where answers came from, and prove that generated responses remain grounded in authorized content.

A simple demo can upload a few documents, embed them, retrieve the nearest chunks, and send those chunks to a model. A production RAG system has to answer harder questions: who is allowed to retrieve each document, how updates and deletions propagate, how keyword-heavy queries behave, how duplicate or stale chunks are handled, how retrieval quality is measured, and what happens when no trustworthy evidence exists.

This guide explains the architecture choices behind a secure, measurable enterprise RAG system. For the broader vendor-selection context, see How to Evaluate an AI Development Company for a Production AI System. For implementation scope, see Enterprise RAG.

1. Start with source authority, not embeddings

Before choosing an embedding model or vector store, define which systems are authoritative for which kinds of information. A RAG index is a derived search surface. It should not silently become a second source of truth.

For each source, document:

  • who owns the data;
  • how users are authorized in the source system;
  • which content is eligible for indexing;
  • which metadata and permissions must be preserved;
  • how updates, deletions, and access changes are detected;
  • how quickly those changes must appear in retrieval;
  • what provenance must be returned with an answer.

This source map determines the ingestion, identity, freshness, and audit architecture. It also prevents a common failure mode where a search index continues serving content that was deleted, moved, or restricted in the source system.

2. Build ingestion as a durable pipeline

Ingestion should be repeatable and observable. Treat it as a data pipeline rather than a one-time file upload.

A practical ingestion record usually needs more than text:

  • source system and source identifier;
  • document version or content hash;
  • title, section, path, and content type;
  • owner, tenant, or workspace;
  • permission or group metadata;
  • created and modified timestamps;
  • language and domain metadata;
  • chunk identifiers and parent-document identifiers;
  • indexing status and last synchronized time.

Those fields make incremental synchronization, debugging, permission filtering, freshness checks, and citation rendering possible. Without them, the vector index becomes difficult to govern.

3. Chunk for retrieval behavior, not a universal token number

Chunk size changes what the retriever can find and what the model sees. Too-small chunks can lose important context. Too-large chunks can dilute relevance and consume unnecessary context-window budget.

Chunking should reflect document structure. Policies, manuals, contracts, support articles, source code, tables, and transcripts often need different strategies. Useful signals include headings, paragraph boundaries, semantic sections, code symbols, table rows, and parent-child relationships.

OpenAI's current Retrieval API exposes configurable chunk sizes and overlap rather than treating chunking as fixed. That is the correct mental model: chunking is a retrieval parameter that should be evaluated against your corpus and query set.

4. Preserve permissions during ingestion and enforce them during retrieval

Permission-aware retrieval is one of the most important differences between enterprise RAG and a public knowledge chatbot.

If a user cannot read a document in the source system, the RAG layer should not retrieve that document for the user. Do not rely on the model to hide unauthorized content after retrieval. Authorization should happen before restricted text enters the model context.

Microsoft's current Azure AI Search guidance describes document-level access control as essential for RAG and agentic systems, with permission metadata synchronized into the search layer and evaluated at query time. The implementation details vary by platform, but the architecture principle is general:

  1. capture the source permission model;
  2. store permission metadata alongside searchable content;
  3. resolve the caller's identity and groups;
  4. apply permission filters on every retrieval request;
  5. return only authorized chunks.

For multi-tenant systems, tenant isolation should be enforced by the search query or index topology itself, not by a prompt that says "only answer about Tenant A."

5. Use metadata filters before asking similarity search to solve everything

Vector similarity is useful for semantic meaning, but many enterprise questions contain strong structured constraints: customer ID, product, region, language, date range, document type, business unit, version, or status.

Use metadata filters when the application already knows those constraints. OpenAI's current vector-store search API supports attribute filters specifically for this purpose.

A query for "the termination clause in the 2026 supplier agreement" should not ask semantic similarity alone to discover the year, document class, and supplier scope if those fields already exist as metadata.

6. Hybrid retrieval is often a stronger default than vector-only search

Semantic search is good at paraphrases and conceptual similarity. Keyword retrieval remains strong for identifiers, exact product names, error codes, acronyms, clause numbers, and domain terminology.

Hybrid search combines both signals. Microsoft Azure AI Search runs text and vector searches and merges the candidate lists with Reciprocal Rank Fusion. OpenAI's current Retrieval API also exposes hybrid-search weights that let applications balance semantic embedding matches against text overlap.

This matters because enterprise query workloads are mixed. A user may ask a conceptual question in one turn and paste an exact incident code in the next.

Do not assume hybrid is always better. Build an evaluation set and compare keyword, vector, and hybrid strategies against real queries.

7. Separate candidate retrieval from reranking

Initial retrieval is usually optimized for recall: find a broad set of potentially relevant chunks. The model context should be optimized for precision: include the strongest evidence and remove noise.

Reranking provides that second stage. Microsoft's RAG guidance explains the trade-off clearly: broad retrieval improves recall, while a reranker re-evaluates candidates against the actual query to improve ordering and reduce marginally relevant context.

A common pipeline is:

  1. retrieve a larger candidate set with keyword, vector, or hybrid search;
  2. apply permission and metadata constraints;
  3. rerank the authorized candidates;
  4. deduplicate overlapping chunks;
  5. select the final evidence set within a context budget.

Reranking adds latency and sometimes external processing cost, so evaluate whether the quality improvement justifies it for each workload.

8. Assemble context deliberately

The final context sent to the model should not simply be "top K chunks."

Context assembly should consider:

  • relevance score;
  • document authority;
  • recency;
  • duplicate or overlapping evidence;
  • source diversity;
  • parent-section context;
  • token budget;
  • whether the evidence actually supports an answer.

If all retrieved chunks come from the same outdated document, adding more chunks does not increase confidence. If two authoritative sources conflict, the answer should surface that conflict rather than blending them into a false consensus.

9. Freshness is part of correctness

A RAG answer can be perfectly grounded and still be wrong for the business if the grounding data is stale.

Define freshness objectives per source. A policy library might tolerate hourly synchronization. Inventory, pricing, operational incidents, or access-control changes might need much shorter windows or direct live queries instead of indexed retrieval.

Your synchronization design should handle:

  • new documents;
  • content updates;
  • renames and moves;
  • deletions;
  • permission changes;
  • failed ingestion jobs;
  • reindexing after chunking or embedding changes.

Permission freshness deserves special attention. Microsoft documents that query-time authorization depends on synchronized permission metadata; access changes in the source only affect search after the relevant metadata is refreshed. Every platform has an equivalent consistency boundary that must be understood.

10. Return provenance with every important answer

Enterprise users should be able to inspect the evidence behind a generated answer.

Useful provenance includes:

  • document title and source;
  • section or page reference when available;
  • source URL or record identifier;
  • document version or modified date;
  • the exact retrieved passage or a link to it;
  • confidence or retrieval metadata where useful.

Provenance improves trust, review, debugging, and feedback collection. It also helps distinguish retrieval failures from generation failures: if the correct source was never retrieved, prompt tuning is unlikely to solve the root problem.

11. Treat retrieved content as untrusted input

Internal documents can contain malicious instructions, accidental prompt-like text, copied emails, code, or content from external sources. Retrieval does not make that content trusted.

Microsoft's RAG security guidance explicitly recommends treating retrieved content as untrusted input. The application should preserve a strict boundary between system instructions and retrieved evidence, validate any downstream actions, and avoid allowing retrieved text to redefine tool permissions or workflow policy.

This becomes especially important when RAG is connected to an agent. A retrieved document should be able to inform an answer; it should not be able to grant the agent new authority.

12. Evaluate retrieval and generation separately

If a RAG response is wrong, you need to know whether the problem happened before or after the model saw the evidence.

Build two layers of evaluation:

LayerQuestions
RetrievalWere the right documents retrieved? Were important documents missed? Were irrelevant chunks ranked too high?
GenerationDid the answer stay grounded in the retrieved evidence? Was it relevant, complete, and properly cited?

Microsoft's current RAG evaluators distinguish document-retrieval metrics from response groundedness, relevance, and completeness. That separation is essential for diagnosis.

Where labeled relevance data exists, evaluate metrics such as recall, NDCG, ranking quality, and missed relevant documents. Where labels are unavailable, use calibrated human review or model-based evaluators, then validate those evaluators against human judgment.

For the broader release discipline around these evaluations, see AI Reliability & LLMOps.

13. Build a query set from real work

A RAG system should not be evaluated only on questions written by the implementation team.

Your query set should include:

  • common user questions;
  • exact identifiers and abbreviations;
  • paraphrased questions;
  • multi-part questions;
  • questions requiring multiple sources;
  • questions whose answer should be "not found";
  • permission-sensitive queries;
  • stale-versus-current document conflicts;
  • ambiguous queries that require clarification.

Save production failures back into the evaluation set. Over time, this creates a regression suite that reflects the actual operating environment rather than a demo.

14. Measure latency and cost by pipeline stage

RAG latency is the sum of several components: query processing, embedding, keyword/vector search, filtering, reranking, context assembly, model generation, and sometimes source-system calls.

Measure each stage independently. If the final response is slow, you need to know whether the bottleneck is reranking, a remote source, retrieval volume, or model generation.

Useful controls include candidate-set size, reranking depth, context size, cache strategy, query routing, and whether some authoritative data should be fetched live instead of indexed.

15. Choose the multi-tenant index topology deliberately

There is no universal rule for one shared index versus one index per tenant.

A shared index can simplify operations and improve resource utilization, but it demands strong tenant filters and careful permission testing. Separate indexes provide stronger physical or logical isolation at the search layer but create more operational overhead, especially when tenants have different schemas or lifecycle requirements.

Choose based on isolation requirements, query volume, tenant count, data residency, schema variability, operational cost, and the search platform's filtering guarantees.

16. A production RAG request flow

  1. Authenticate the user. Resolve tenant, identity, groups, and application permissions.
  2. Normalize the query. Preserve exact identifiers while optionally rewriting ambiguous natural language.
  3. Apply routing and metadata constraints. Select the right corpus, tenant, language, document type, or time range.
  4. Run retrieval. Execute keyword, vector, or hybrid search against authorized content.
  5. Rerank and deduplicate. Improve precision and remove redundant evidence.
  6. Assemble context. Fit the strongest evidence within a controlled token budget.
  7. Generate with citation requirements. Instruct the model to answer only from the supplied evidence when the use case requires strict grounding.
  8. Validate. Apply output checks, policy, and escalation rules.
  9. Return answer plus provenance. Let users inspect the source.
  10. Trace and evaluate. Record retrieval candidates, selected evidence, latency, answer quality, and user feedback.

17. RAG architecture red flags

Red flagWhy it matters
"We use a vector database, so we have RAG"Ignores ingestion, permissions, ranking, freshness, provenance, and evaluation.
Permissions applied after retrievalUnauthorized content may already have entered the model context.
Vector-only retrieval for every queryExact identifiers and keyword-heavy queries may perform poorly.
No reranking or retrieval evaluationContext quality is being assumed rather than measured.
No deletion or ACL synchronization strategyStale or restricted content can remain retrievable.
Only answer-level testingRetrieval failures cannot be isolated from generation failures.
No source citationsUsers and operators cannot inspect the evidence behind answers.
Retrieved text can trigger tools directlyPrompt injection can cross from data into action authority.

18. Questions to answer before production

  • Which systems are authoritative sources?
  • How are source permissions represented in the index?
  • How are tenant boundaries enforced?
  • What is the freshness objective for each source?
  • How are deletions and permission changes propagated?
  • When do we use keyword, vector, or hybrid retrieval?
  • What candidate set is reranked, and why?
  • How are duplicate chunks removed?
  • What provenance is shown to users?
  • How do we test retrieval quality separately from answer quality?
  • What happens when the system cannot find sufficient evidence?
  • Which metrics block a release?

A production RAG system should have concrete answers to those questions before it becomes an enterprise knowledge interface.

Sources and further reading

For implementation, review OSYSTIC Enterprise RAG, AI Reliability & LLMOps, or send a technical brief.

RELATED EVIDENCE

Continue from guidance to implementation proof.

Related capabilityAI SystemsDelivery evidenceTrust & controlsOwnership & handoverHow We Work
OSYSTIC / PROJECT CHANNELOPEN
START A PROJECT

Have a related engineering problem?

Bring the real constraints and operating context. We can turn the discussion into an actionable architecture path.

Send a Technical Brief