Enterprise RAG
Enterprise RAG that respects permissions
We build retrieval-augmented generation over your documents that keeps source access rights intact, cites its sources and runs on infrastructure you control.
Last reviewed by SysArt AI Architecture TeamHow we review
In short
Enterprise RAG (retrieval-augmented generation) answers questions from your own documents by retrieving relevant passages at question time and passing them to a language model, which drafts a cited answer. In an enterprise, retrieval must respect each user's access rights, be evaluated against a test set and be protected against instructions hidden in documents.
DefinitionRetrieval-augmented generation (RAG) is a technique in which a system retrieves passages relevant to a question from an external knowledge source and gives them to a language model as context, so that the answer is grounded in those passages rather than only in what the model learned during training.
Key takeaways
- Permissions must come from the source systems and be enforced during retrieval, before any passage reaches the model.
- Answer quality is capped by retrieval quality, so parsing, chunking, hybrid search and reranking deserve as much attention as the choice of model.
- A test set of real questions with known answers and sources turns RAG quality from opinion into release criteria.
- Retrieved documents are untrusted input: indirect prompt injection is a design constraint, not an edge case.
- Documents, permissions and embedding models all change, and the index has to follow each of them.
What an enterprise RAG implementation delivers
We scope each implementation to the questions your users need answered and the sources behind them. These are the parts we build and connect.
-
Connectors and permission sync
Connectors for your document systems that carry each document's access rights into the index and keep them in step with the source.
-
Parsing and chunking pipeline
Extraction that keeps headings, tables and page references, split into passages that suit your documents and questions.
-
Hybrid search and reranking
Keyword and vector search combined, with a reranking step that orders candidates by relevance before the model sees them.
-
Cited answer generation
A private LLM answers from the retrieved passages only, links each statement to its source and says when the sources are silent.
-
Evaluation set and quality gates
Real questions with expected answers and sources, scored for retrieval, groundedness and answer quality before every release.
-
Security and operations
Prompt-injection defences, audit logging, re-indexing and embedding-model upgrades, documented in runbooks.
- 01 Ingest Parse documents, split them into passages and keep their source access rights.
- 02 Embed and index Turn passages into vectors with an embedding model and store them with their permissions.
- 03 Retrieve Find the passages most relevant to a question, filtered by the user's permissions.
- 04 Generate A private LLM drafts the answer from the retrieved passages only.
- 05 Cite and log Show the sources behind the answer and record the request for audit.
What is enterprise RAG?
Enterprise RAG is retrieval-augmented generation built for an organisation’s own content and rules: a question triggers a search over your documents, and a language model answers from the passages it finds, citing them. The term comes from a 2020 research paper that combined what a model learned in training with a searchable index of documents, so that answers can draw on knowledge the model never saw during training.
What makes it “enterprise” is everything around that basic loop:
- Access control that mirrors the source systems, so the assistant never becomes a way around them.
- Retrieval quality that holds up on the documents you actually have: scanned PDFs, tables, intranet pages, tickets and contracts in several languages.
- Evidence: a citation for every answer, an evaluation set that shows how well the system works, and logs that show what was retrieved for whom.
- Security against instructions hidden in documents and against leaks between users.
- Operations that keep the index current as documents, permissions and models change.
For a plain-language introduction, read what retrieval-augmented generation is.
Why must RAG permissions flow from the source systems?
Because the index is a copy of your documents. If it ignores the access rights of the systems those documents came from, anyone who can query the assistant can read content they could not open at the source. OWASP’s Top 10 for LLM applications includes weaknesses in vector and embedding stores, such as weak access control, and recommends permission-aware stores with strict logical partitioning.
Permission-aware retrieval has three parts:
- Capture. Connectors read each document’s access control list (users, groups, inheritance and explicit denials) together with its content, and store it with every passage cut from that document.
- Filter. At question time, the retrieval service resolves the user’s identity and group memberships from your directory and filters the search itself, so passages the user may not read are never candidates. Filtering after the search instead can leave too few results to answer from.
- Synchronise. Permission changes, deletions and leavers have to reach the index quickly. For the most sensitive sources, a live check against the source system before the answer is shown closes the remaining gap.
Some cases need explicit decisions: sharing links that grant access to anyone who has them, nested groups, documents without an owner, and caches. A response cache keyed only on the question can serve one user an answer built from documents that only another user may see.
What does an enterprise RAG architecture look like?
It is a pipeline of six stages, and each one can limit answer quality. The diagram above shows the flow; the detail sits in these choices:
- Ingestion and parsing. Connectors pull documents from file shares, intranets, document management, ticketing systems and databases. Parsing extracts text while keeping structure: headings, lists, tables and page numbers. Scanned documents need optical character recognition (OCR), and tables need handling that keeps rows and columns together.
- Chunking. Documents are split into passages small enough to retrieve precisely and large enough to make sense on their own. Splitting along the document’s own structure, such as sections, clauses or ticket fields, keeps related text together; fixed-length splits are simpler but can cut a table or a clause in half. Each passage keeps its title, section path, date and permissions as metadata.
- Embeddings. An embedding model turns each passage into a vector, a list of numbers that places passages with similar meaning close together. Choose it for your languages and domain, and run it inside your boundary: an external embedding API receives every document you index. See what a vector embedding is.
- Vector and hybrid search. Vector search finds passages by meaning; keyword search finds exact terms such as product codes, clause numbers and names. Hybrid search runs both and merges the results, for example with reciprocal rank fusion. The index can live in a vector extension of a database you already run, a search engine with vector support, or a dedicated vector database.
- Reranking. A reranking model reads the question together with each candidate passage and reorders the shortlist by relevance. It adds latency, but it lets the first search cast a wide net while the model receives only the best few passages.
- Generation with citations. A private LLM answers from the retrieved passages only, cites each one, and says so when the passages do not contain the answer. More context is not automatically better: research on long inputs found that models use information in the middle of a long context less reliably than information at its start or end, so ranking matters as much as recall.
The private LLM that writes the answers, the embedding model and the reranker can share one serving platform; the on-premises AI reference architecture shows how the layers fit.
Should enterprise RAG run on-premises?
On-premises deployment fits when the documents are sensitive or regulated, and every component can run there. Parsing, embedding, indexing, reranking and generation all work on servers you control with open-weight models, including in air-gapped networks. Two parts are easy to overlook: the embedding model, which sees every document during indexing, and the logs, which hold questions, retrieved passages and answers. Both belong inside the same boundary as the documents themselves.
A hosted model can still suit collections of low sensitivity. The deciding questions are the same as for any AI workload: which data is involved, where it may be processed, and at what volume.
How do you evaluate an enterprise RAG system?
With a test set of real questions, each paired with the expected answer and the documents that support it, scored at three levels:
- Retrieval quality. Does the passage that holds the answer appear among the top results? Measuring recall at a fixed number of results, and the rank of the right passage, separates search problems from model problems.
- Groundedness. Is every statement in the answer supported by a retrieved passage? Unsupported statements are the measurable form of hallucination in RAG.
- Answer quality. Is the answer correct, complete and cited to the right source, and does the system say it does not know when the documents do not contain the answer?
Build the set with the people who will use the system, before the pipeline exists. Include questions that should be declined, and permission tests: questions one test user should be able to answer and another should not. Automated judges, including frameworks such as Ragas that score faithfulness and context relevance without reference answers, speed the work up, but calibrate them against human ratings on a sample. The same set runs again before every change to parsing, chunking, models or prompts.
How do you secure RAG against prompt injection and data leakage?
Treat every retrieved passage as untrusted input. In a RAG system, indirect prompt injection means an attacker plants instructions in a document that will later be retrieved, without ever needing access to the assistant itself. NIST’s taxonomy of attacks says that no current mitigation offers full protection, and OWASP’s guidance adds that retrieval does not remove the risk. Design for it:
- Keep instructions and retrieved text separated and labelled in the prompt, and instruct the model to treat passages as data.
- Scan content at ingestion for hidden text and instruction-like patterns, and assign trust levels to sources.
- Give a question-answering assistant no tools that can act, send or delete. If an AI agent uses retrieval, its consequential actions need approval.
- Answers should not load external links or images automatically. Researchers have shown injected instructions making a model send data to an address controlled by the attacker.
Data leakage has its own paths: indexing more than users may see, indexes shared between departments or tenants, and logs that copy sensitive passages. Embeddings deserve the same protection as the text, because OWASP warns that embedding inversion can recover much of the original content. Our AI security work covers the threat model and the testing in depth, and our RAG security guide sets out each threat with its control and test, ending in a checklist.
How do you keep an enterprise RAG index current?
By planning for three kinds of change from the start:
- Content changes. Incremental indexing picks up new, changed and deleted documents from change feeds or scheduled scans, with a periodic full reconciliation to catch what was missed. Deletions matter as much as additions: when personal data must be erased under the GDPR’s right to erasure, the copies in the index and in any caches must go too, and backups need a defined handling process.
- Permission changes. Access changes are synchronised separately from content, and faster, because a stale permission is a leak.
- Model changes. Vectors from different embedding models cannot be compared, so a new embedding model means embedding the whole corpus again. Build the new index next to the old one, run the evaluation set on both, and switch over only when the new one scores at least as well. Changes to parsing or chunking follow the same procedure.
Log the index version, embedding model, prompt version and language model with each answer, so any answer can be traced and reproduced. Then monitor index freshness, parsing failures, the share of questions left unanswered and user feedback.
How SysArt implements enterprise RAG
We start from the questions your users need answered and the access rules that apply, build the evaluation set early, and choose components that fit your environment, from open-source search and vector stores to commercial platforms. Where it fits, VDF.AI, an on-premises AI platform built by VDF AI AB, which grew out of SysArt’s work, can serve as an accelerator for the retrieval pipeline. Your team then takes the system over with runbooks and training, or SysArt operates it for you.
How an enterprise RAG implementation runs
-
Scope
Agree the questions the system must answer, the sources behind them, who may see what, and how success will be measured.
You receive
- Use-case and source inventory
- Access model
- Success criteria
-
Build the test set
Collect real questions with expected answers and supporting documents from future users, before the pipeline is built.
You receive
- Evaluation set
- Baseline scores
-
Build the pipeline
Connect the sources, parse and chunk the documents, index them with their permissions, and configure hybrid search, reranking and generation.
You receive
- Ingestion pipelines
- Permission-aware index
- Answer service with citations
-
Evaluate and harden
Score retrieval, groundedness and answers against the test set, run prompt-injection and data-leakage tests, and fix what fails.
You receive
- Evaluation report
- Security test results
- Release criteria
-
Operate
Monitor quality and index freshness, re-index on change, and manage embedding and model upgrades, run by your team or by SysArt.
You receive
- Runbooks
- Monitoring dashboards
- Change procedure
RAG, fine-tuning or long-context prompting?
| RAG | Fine-tuning | Long-context prompting | |
|---|---|---|---|
| How knowledge reaches the model | Relevant passages are retrieved from an index for each question | Training changes the model's weights | Whole documents are placed in each prompt |
| Keeping content current | Re-index the documents that changed | Train, evaluate and release a new model version | Current by default, because documents are read on every request |
| Per-user permissions | Enforced during retrieval, per user and per passage | Not enforceable: what is in the weights is available to every user | Must be checked before documents enter the prompt |
| Citations | Each statement can link to its source passage | No reliable link from an answer back to the training data | Possible, if the model is asked to quote its sources |
| Main cost driver | Ingestion pipelines and search infrastructure | Data preparation, training runs and re-evaluation | Tokens and GPU memory per request, which grow with document length |
| Best fit | Large, changing document collections with access rules | Style, format, terminology and narrow, stable tasks | A few documents per task, such as one contract or report |
The options combine. A fine-tuned model can answer over retrieved passages, and a longer context window lets RAG pass more passages per question.
Frequently asked questions
What is enterprise RAG?
Enterprise RAG is retrieval-augmented generation built for an organisation's own documents and rules. A question triggers a search over indexed internal content, the most relevant passages go to a language model, and the model drafts an answer that cites them. The enterprise part is everything around that loop: access control from source systems, evaluation, security testing, audit logging and operations.
Can RAG run fully on-premises?
Yes. Every component, from document parsing and the embedding model to the vector index, the reranker and the language model, can run on servers you control, including air-gapped networks. Open-weight embedding and language models make this practical. Documents, questions and answers then stay inside your boundary, which keeps third-party model providers out of the data flow.
How does permission-aware retrieval work?
Each passage in the index carries the access rights of the document it came from, synchronised from the source system. At question time the search is filtered by the user's identity and group memberships, so only passages they may read are retrieved. Permission changes must reach the index quickly, and the most sensitive sources can be re-checked live before an answer is shown.
Which vector database should we use for RAG?
It depends on scale, existing skills and the filtering you need. A vector extension to a database you already run, such as pgvector for PostgreSQL, suits many collections. Search engines such as OpenSearch combine keyword and vector search in one system. Dedicated vector databases specialise in vector search alone. Check permission filtering and hybrid search support as carefully as speed.
How do you measure whether a RAG system is good enough?
With a test set of real questions, each with an expected answer and the sources that support it. We score retrieval (did the right passages come back?), groundedness (is every statement supported by a retrieved passage?) and answer quality (is it correct, complete and cited?). Thresholds agreed with the business become release criteria, and the set runs again before every change.
Is RAG better than fine-tuning?
They solve different problems. RAG brings in knowledge that changes and must respect access rights, and it can cite its sources. Fine-tuning adapts how a model behaves, such as its format, tone or domain terminology, but cannot enforce per-user permissions on what it learned. Many systems use both: a tuned model that answers over retrieved passages.
How do you protect RAG against prompt injection?
Retrieved text is treated as data, never as instructions. It is separated and labelled in the prompt, ingestion flags hidden or instruction-like content, and the assistant gets no tools that can act or send data without approval. Answers do not load external links or images automatically. Because no defence is complete, we test with planted malicious documents before go-live.
What happens when we change the embedding model?
Vectors from different embedding models cannot be compared, so the whole corpus has to be embedded again. We build the new index next to the old one, run the evaluation set against both, and switch over only when the new index scores at least as well. Changes to parsing or chunking follow the same procedure.
Sources
- Lewis et al.: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (NeurIPS 2020) · checked 27 October 2026
- OWASP GenAI Security Project: LLM08:2025 Vector and Embedding Weaknesses · checked 27 October 2026
- OWASP GenAI Security Project: LLM01:2025 Prompt Injection · checked 27 October 2026
- NIST AI 100-2 E2025: Adversarial Machine Learning, a Taxonomy and Terminology of Attacks and Mitigations · checked 27 October 2026
- Liu et al.: Lost in the Middle, How Language Models Use Long Contexts (TACL) · checked 27 October 2026
- Es et al.: Ragas, Automated Evaluation of Retrieval Augmented Generation · checked 27 October 2026
- pgvector: open-source vector similarity search for PostgreSQL · checked 27 October 2026
- OpenSearch documentation: hybrid search · checked 27 October 2026
- EDPB: Respect individuals' rights (GDPR right to erasure, Article 17) · checked 27 October 2026
Scope a permission-aware RAG system
Bring a set of real questions, the document sources behind them and your access rules. In a briefing we outline the architecture, the evaluation approach and the security controls that fit.