Enterprise RAG for Company Knowledge: Build It Right
Enterprise RAG over company knowledge: when search is enough, the architecture, per-user access control, evaluation and how a scoping sprint and pilot work.
Enterprise RAG is worth building when staff lose hours looking for an answer that already exists in a policy, a contract or an old ticket. Every one of those searches is paid time, and a wrong answer from memory costs more: a rep quotes last year's refund rule, or an engineer follows a retired runbook.
Retrieval-augmented generation (RAG) is a common pattern for internal AI assistants. The system retrieves relevant passages from your documents, then a language model writes an answer from those passages and cites them. The idea comes from Lewis et al., "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks".
A demo takes an afternoon. A system your security lead will sign off on, and your staff will trust, takes decisions about sources, permissions, freshness and evaluation. This guide covers those decisions, including the cases where you should not build RAG at all.
When plain search or a query is enough
Start by checking whether the question needs a language model. Enterprise RAG earns its cost only when people ask questions in natural language and the answer sits in unstructured text spread over several places.
| The question looks like | Better tool | Why |
|---|---|---|
| "Show contract 4471" or "all invoices from Acme in May" | Structured query or filtered search | The answer is a record, not a passage |
| "Find the onboarding doc" | Keyword search with good titles and tags | The user wants a document, not an answer |
| "What is our refund rule for annual plans in the EU?" | Enterprise RAG with citations | The answer lives inside prose, possibly in two documents |
| "Which customers renewed late last quarter?" | SQL or a BI tool | It is aggregation over structured data |
| "Does this clause conflict with our standard terms?" | RAG plus a human reviewer | Needs passages from two sources and a person to decide |
Two more checks before you commit:
- Is the knowledge base small? Anthropic notes that if it is under about 200,000 tokens (roughly 500 pages), you can put the whole thing in the prompt instead of building retrieval (Anthropic, Contextual Retrieval).
- Are the documents any good? RAG surfaces what is written. If your policies contradict each other, the assistant will quote both.
If you are unsure whether the job needs an agent, a workflow or just retrieval, our agent or workflow tool takes a few minutes.
The enterprise RAG architecture that holds up
Every working enterprise RAG system has the same five stages. The trade-offs are in the details.
- Source selection and cleanup. Pick one or two sources with clear owners, such as the policy wiki and the contract repository. Remove duplicates, drafts and superseded versions before indexing. Extraction from PDFs, tables and scans can lose quality before retrieval even starts.
- Chunking and indexing. Split documents along their structure (headings, clauses, table rows), not at a fixed character count. Store metadata with each chunk: source, owner, version, date and who may read it.
- Retrieval. Combine keyword and embedding search, then rerank the candidates. Anthropic's tests showed that combining embeddings with BM25 beat embeddings alone, and adding reranking cut top-20 retrieval failures further. Their 67% figure is a result on their own test data, so measure it on yours.
- Answer with citations. The model answers only from the retrieved passages, links each claim to its source, and says "I could not find this" when the passages do not support an answer.
- Feedback and logging. Record the question, the passages retrieved, the answer and the user's rating, so you can debug failures.
In enterprise RAG, retrieval quality limits answer quality. If the right passage is not in the top results, no prompt fixes it. Research also shows that models use information in the middle of a long context less reliably than at the start or end (Liu et al., "Lost in the Middle"). So send fewer, better passages instead of padding the prompt.
Access control in enterprise RAG: filter before the model sees anything
This is the part that decides whether security approves the project. The rule is simple: the assistant must never show a user something they could not open themselves.
The safe pattern is to enforce permissions at retrieval time, before text reaches the model:
- Store each chunk's access list (or group IDs) as metadata, copied from the source system.
- Resolve the signed-in user's groups on every query.
- Apply the filter inside the search call, so forbidden chunks are never returned.
- Never rely on a prompt instruction such as "do not reveal HR documents". A prompt is not an access control.
OWASP lists this under its LLM08:2025 Vector and Embedding Weaknesses entry. It describes how shared vector stores can leak context between users or groups, and recommends permission-aware stores with strict partitioning. It also recommends validating documents before they enter the knowledge base, since hidden instructions in a file can be treated as content.
Permissions create their own failure modes:
| Failure mode | What happens | Control |
|---|---|---|
| Stale permissions | A user leaves a group; the index still lists them | Sync access lists on a schedule, or check the source system at query time for sensitive collections |
| Leaky citations | The answer is hidden but the cited title reveals a confidential document | Filter titles and snippets with the same rule |
| Mixed-tenant index | Two customers' data share one partition | Separate indexes or enforced tenant filters, tested in evaluation |
| Poisoned document | A file contains instructions aimed at the model | Validate on ingestion; treat retrieved text as data, never as instructions |
Our agent security guide covers the wider permission model for agents that take actions.
Freshness and deletion in enterprise RAG
An internal assistant that cites a policy from two versions ago does more damage than no assistant. Plan for change from day one:
- Sync on change. Use webhooks or a scheduled crawl per source, with the cadence set by how often that source changes.
- Version everything. Keep the document version on each chunk and prefer the latest unless the user asks for history.
- Delete properly. When a document is removed or a person asks for erasure, its chunks, embeddings and cached answers must go too. Test this with a deletion drill.
- Show dates. Each citation shows the document date, so the reader can judge whether it is current.
Book an AI scoping call
Bring one workflow. We'll tell you if an agent should run it.
Book an AI scoping call →How to evaluate enterprise RAG before launch
Do not judge by trying a few questions yourself. Build a question set from what staff actually ask: support tickets, chat channels and search logs. Fifty to a hundred real questions is a workable start; refine it as you learn.
For each question, record the expected source passage, then score three things separately:
| Check | Question it answers | Fails when |
|---|---|---|
| Retrieval | Was the right passage in the results? | The answer is right by luck or wrong because the passage was missing |
| Grounding | Does every claim trace to a cited passage? | The model adds facts from its own training |
| Refusal | Does it decline when the corpus has no answer? | It invents a plausible policy |
Add permission tests: for a set of users with different roles, confirm that restricted questions return nothing. Run the whole set before every change to chunking, models or prompts. Our evaluation and quality gates guide explains how to wire this into release checks.
Enterprise RAG cost and usage
Cost has three parts: indexing (a one-off per document plus re-indexing on change), storage and search, and per-question model calls. The per-question part grows with the number of passages you send and the length of the answer. Track cost per question and per team from the first week. The AI agent cost calculator helps you model it, and our cost control guide covers caps and routing.
Also decide who owns content quality. When the assistant gives a wrong answer because the policy is wrong, the fix is a document edit by its owner, not a model change. Name an owner per source before the pilot starts.
How ByteandRise would approach enterprise RAG for your company
We would run it in three stages, each ending with something you can act on.
1. Scoping sprint.
- Pick the first knowledge source and its owner, using the table above to confirm RAG is the right tool.
- Map who may see what: groups, systems and where permissions live today.
- Collect a first question set from real staff queries and agree what "good" means.
- Choose where it runs: where your data lives, on Azure AI Foundry, Google Vertex AI, AWS Bedrock or Claude Platform, or in your own environment.
- Output: a written plan, architecture, risks and a cost model your team can use with or without us.
2. Pilot.
- Build retrieval, citations and permission filtering on that one source for a small group of users.
- Run the evaluation set on every change and review failures with the content owner.
- Add logging and a cost view per team.
- Output: a working assistant, evaluation results on your questions and a go or no-go decision.
3. Production.
- Add the remaining sources, sync and deletion jobs, monitoring and alerts.
- Set review routes: low-confidence answers go to a person.
- Hand over runbooks, then run and improve it with you if you want that.
We have not published RAG results from client work, so we will not quote any here. What we do is build with an evaluation set and a way to review every answer. See how we work and our AI agent services for the wider offer. If you are also weighing pilot risks, read from AI pilot to production.
Enterprise RAG launch checklist
- One source, one named owner, duplicates and drafts removed
- Chunks carry source, version, date and access list
- Permission filter applied inside the search call, tested per role
- Citations on every answer, with dates; refusal when unsupported
- Sync, versioning and a tested deletion path
- Question set from real queries, scored for retrieval, grounding and refusal
- Cost per question and per team visible
- Review route for low-confidence answers
Book an AI scoping call
Bring one knowledge source for enterprise RAG and the questions your staff ask most. On a scoping call we will walk through whether RAG fits, how permissions would work on your systems, and what a scoping sprint and pilot would cover. You leave with a recommended first source, a draft architecture and a list of risks to resolve.
FAQ
What is enterprise RAG?
Enterprise RAG is retrieval-augmented generation over a company's own documents. The system retrieves relevant passages the user may see, and a language model answers from them with citations.
When is search enough instead of RAG?
When users want a document or a record, not an answer. Keyword search or a structured query is cheaper and easier to audit. RAG fits natural-language questions whose answers sit in prose across several sources.
How do you enforce access control in RAG?
Store each chunk's access list as metadata, resolve the user's groups per query and filter inside the search call. Do not rely on prompt instructions, and test restricted questions per role.
RAG or fine-tuning for company knowledge?
RAG is usually the better fit for facts that change, because you update the index instead of retraining, and you can show citations and delete documents. Fine-tuning suits style or task behavior, not a changing knowledge base.
How do we measure whether an internal RAG assistant works?
Build a question set from real staff queries and score retrieval, grounding and refusal separately, plus permission tests. Run it before every change to chunking, models or prompts.
