You are not training the AI
People often ask how to “train AI on company data”. In most business projects, that is not what happens. The model stays exactly as its maker built it. What changes is what it gets to read before it answers.
The method is called retrieval-augmented generation, or RAG, a term from a 2020 research paper.[1] The idea fits in a sentence: first retrieve the passages most relevant to a question, then have a large language model write an answer from those passages and point back to them.
Think of it as moving the model from a closed-book exam to an open-book one. Three practical things follow.
- Updates are cheap. Change a document, and the next answer can use it once the index catches up. Nothing is retrained.
- Answers can be checked. Because the answer is built from named passages, it can show them, and a person can read the original.
- Access can differ by person. Retrieval runs for each question, so it can respect what this person may read. A model that absorbed your data in training would know it for everyone who uses it.
One question, across your company’s knowledge
- Price list 2026Passage found
- Service agreementsPassage found
- Shared inboxPassage found
- Job trackerSearched, nothing relevant
- Team wikiSearched, nothing relevant
- Payroll and HRNot open to this person, so never searched
What do we charge for after-hours service calls, and is the Hollis account different?
After-hours calls are billed at the emergency rate on the 2026 price list (page 2). The Hollis service agreement sets its own minimum charge (clause 6).
From a folder of files to a cited answer
Most RAG systems follow the same six stages. The diagram is the easy part. The decisions inside each stage are what separate a good system from a demo.
How a question becomes a cited answer
- 1DocumentsFiles, email, wikis, recordings
- 2ChunksSplit into passages
- 3EmbeddingsEach passage becomes numbers for meaning
- 4Vector storeAn index, kept with your permissions
- 5RetrievalThe closest passages this person may read
- 6AnswerWritten from those passages, with citations
Getting the text out
Before anything clever happens, files have to become clean text. This step gets little attention and causes a lot of grief. A scanned PDF needs text recognition. A table can lose the link between a number and its column heading. A recording needs a transcript, and an email thread repeats itself in every reply. If a fact does not survive this stage, nothing later can find it.
Chunks
A model cannot read every file for every question, so documents are split into passages called chunks. Size is counted in tokens, the small pieces of text a model reads, each about a short word or part of a longer one.
No setting is correct for everyone. Microsoft suggests starting at 512 tokens with 25% overlap,[2] while OpenAI’s file search defaults to 800 tokens with 400 overlapping.[3] Both are starting points to test.
The tradeoff is concrete. Small chunks point at the exact sentence but lose the context that gives it meaning. Large chunks keep context but blur the match and cost more to send to the model. A clause saying “the fee in Section 4 applies” is no use if Section 4 landed somewhere else. Good systems split along the document’s own structure: clauses in a contract, headings in a procedure, speakers in a meeting. Anthropic’s contextual retrieval goes further and adds a short generated note to each chunk that says where it sits in the document.[4]
Embeddings and the vector store
An embedding is a list of numbers that stands for the meaning of a passage.[5] Similar meanings land close together, so a question about an “overdue charge” can find a paragraph about “late fees” even though no word matches.
The vector store is the index that holds those lists and finds the nearest ones quickly. It is not a new home for your files, but it does hold text derived from them, so treat it as being as sensitive as the documents themselves.
Retrieval: why two searches beat one
Vector search finds meaning but struggles with exact strings: a part number, an invoice number, a person’s surname, a code section. Keyword search does the reverse. Hybrid search runs both and merges the results. A reranker, a slower and more careful model, then rereads the best candidates and puts them in a better order.
Search quality in Microsoft’s benchmark (higher is better)
Anthropic reports the same pattern. In its tests, the share of relevant passages missing from the top 20 results fell from 5.7% to 1.9% with contextual embeddings, keyword search and reranking combined.[4] That too is a vendor test, run on codebases, fiction and scientific papers rather than company files.
The answer and its citations
The top passages go to the model, with instructions to answer only from them and to cite them. It helps to keep three questions apart. Does the citation point at a real passage? Did the answer read that passage correctly? Is the passage still true?
Software can settle the first. Claude’s citations feature, for instance, is built so that each pointer is valid against the documents supplied.[7] Other providers return file citations too. Nothing automatic settles the other two, which is why the later sections on testing and upkeep matter as much as this one.
Permissions: the locked panel
The locked panel in the first picture is the most important design decision in the system. Retrieval must only consider what this person may read, before any text reaches the model. Filtering afterwards is too late, and telling the model “do not reveal this” is a request, not a control.
There is a catch. An AI inherits your permissions, including the bad ones. Microsoft says Copilot surfaces only what a user can already view,[8] and warns that loose permissions bring irrelevant or sensitive content into responses.[21] Its Copilot deployment blueprint starts with fixing oversharing.[9] A file shared too widely years ago was protected mainly by the fact that nobody stumbled on it. A search that reads everything in seconds removes that accidental protection.
If you build your own
A custom system has extra work to do, because a vector index knows nothing about your file shares unless permissions are copied into it. Four details separate a safe build from a demo.
- Real identity, not a label. Azure AI Search calls the plain filter approach a simulation: the person’s group is just a text value, with no authentication behind it.[10]
- Permissions on every chunk. When a document is split, its permissions must travel with each piece, or the filter has nothing to check.
- A known sync delay. Azure says source permission changes reach results only after the metadata syncs.[11] Someone removed from a group may keep seeing results until then. Ask any vendor how long that window is, and what happens on the day someone leaves.
- Walls between clients. OWASP warns of leakage between users in shared vector databases and recommends permission-aware stores.[12] This matters most to firms that keep one client’s files away from another’s.
Quick fixes do not replace this work. Microsoft describes Restricted Content Discovery, which hides sites from Copilot, as a temporary control: it changes what can be discovered, not who has access, and overusing it hurts answer quality.[13] If you want a second pair of eyes on what is exposed, that is the job of our AI Data Leak Audit, and our security guide covers the wider picture.
Do you need RAG at all?
RAG solves one problem: finding the right passage in a body of text too large to read each time. Plenty of requests that sound like RAG are really something else.
Choosing the right approach
| Approach | Fits when | Watch for |
|---|---|---|
| Put it all in the prompt | The material is small and stable. Anthropic says that under 200,000 tokens you can include the whole knowledge base, and prompt caching makes that cheaper.[4] | No per-person access unless you build it. All of it goes to the model every time. |
| The assistant in your office suite | Your files already live in one suite and sharing has been cleaned up. | Oversharing, and less control over how search works. |
| A custom RAG system | Knowledge is spread across systems, includes photos or recordings, or sits behind client walls. | Someone has to own permissions, testing and upkeep. |
| A query against your records | The question is arithmetic: “which jobs ran over budget last quarter?” | RAG finds passages. It does not add up rows. See AI analyst agents. |
| An AI agent | The job takes several steps across tools. | Microsoft says FAQ bots and document search with summaries need classic RAG, not an agent.[14] |
| Fine-tuning a model | You want a consistent format, tone or sorting behavior. | It adjusts a model’s habits. It adds no citations, no per-person access and no way to stay current. |
A useful test: if you could answer the question by finding one page and reading it, RAG fits. If you would need a spreadsheet, a judgment call or a series of actions, look elsewhere first.
How accurate is it? The best evidence available
We could not find an independent, peer-reviewed measurement of workplace assistants on ordinary company documents. Treat any precise accuracy figure for business RAG with suspicion, and ask where it came from.
The closest evidence is a Stanford study of legal research tools. Read it as a legal-research test, not a measure of business RAG in general. The authors ran more than 200 preregistered legal queries through RAG products from LexisNexis and Thomson Reuters and reviewed the answers by hand.[15] The tools were tested from March to May 2024 and have changed since.
Three legal RAG tools, spring 2024
| Tool | Accurate | Incomplete | Hallucinated |
|---|---|---|---|
| Lexis+ AI | 65% | 18% | 17% |
| Westlaw AI-Assisted Research | About 42% | 25% | 33% |
| Ask Practical Law AI | About 20% | About 62% | 17% |
Four lessons travel beyond law.
RAG helps, and it does not finish the job
The tools were less prone to hallucination than GPT-4, a general-purpose model used without RAG, in the same test. Yet their makers had claimed hallucination-free citations, and the authors concluded that those claims were overstated.[15] “Our system cannot make things up” is not a statement any honest vendor can make.
A system that says less can look safer than it is
Better search will not fix everything
Among the hallucinated answers, poor retrieval contributed to 47% for Lexis, 20% for Westlaw and 34% for Practical Law, while reasoning errors contributed to 28%, 61% and 49%.[15] Causes overlap, and the authors had to infer them from closed systems. Even so, the point stands: finding the right passage and reading it correctly are separate skills.
A citation is a place to check, not a proof
Longer answers give more chances for error and take longer to verify. Westlaw’s averaged 350 words against 219 and 175 for the others.[15] Sourcing problems also show up outside law: a study led by public broadcasters found serious sourcing problems in 31% of AI assistant answers about news.[16] That study covers news rather than company files, so take only the general warning from it: the link deserves a click.
How to test a system before you trust it
Retrieval and answers fail in different ways, so they are scored separately. A wrong answer built from the right passage calls for a different fix than a good answer that never saw the right passage. This routine runs in a sensible order.
- Collect real questions. Pull them from the shared inbox, the help desk and whatever new hires keep asking. Include hard ones: the answer sits in a table, needs two documents, or does not exist.
- Have someone who knows the work mark the right answer and source. This is a golden test set. Microsoft’s document retrieval evaluator requires this kind of human-labeled data.[18] We found no reliable rule for how many questions you need, so cover every type of question you care about.
- Score retrieval alone. Context recall asks whether the needed material was found. Context precision asks whether it ranked near the top.[17]
- Score the answers. Faithfulness, or groundedness, asks whether every claim is supported by the retrieved text.[17] Response completeness asks whether anything important was left out.[18]
- Test refusals. Ask things your files do not answer. The right reply is “I don’t know”. Anthropic advises allowing that reply and restricting the model to the supplied documents, while noting these steps reduce hallucinations rather than eliminate them.[19]
- Test access. Sign in as a junior employee and ask for payroll. Remove someone from a group and time how long their results take to change.
- Run it all again after every change. A new chunk size, model or source can improve one question type and quietly break another.
A faithful answer is not always a true one. Google’s grounding check measures how far an answer agrees with the facts you supply, not whether those facts are right.[20] An answer can match an outdated document perfectly.
Tool defaults are not business decisions either. Microsoft’s evaluators score from 1 to 5 with a default pass mark of 3.[18] What counts as a pass should depend on the cost of a wrong answer. A slightly vague reply about office parking is harmless. A confident wrong fee on a customer quote is not, which is why a quote should pass through a person before it goes out.
Keeping it true
A RAG system has no sense of which document is current unless someone tells it. If the 2023 and 2026 price lists both exist, the older one can rank higher simply because its wording happens to match the question better. The answer will be well cited and wrong.
Freshness is mostly a governance job, not an AI one. Microsoft’s guidance covers versioning, retention and expiry, archiving duplicates, recording an owner and review date in metadata, and sending automated review reminders, for example letting HR policies expire after one year unless renewed.[21] We found no measured figure for how much stale content hurts accuracy, but the mechanism is plain enough.
The running work comes down to three habits.
- One owner per source. A named person who can say which version is current.
- Unanswered questions as a to-do list. Each “I don’t know” shows a gap in your documentation. Reviewing them regularly is the cheapest way to improve the system.
- Feedback that reaches someone. When staff flag a wrong answer, it should end up with the owner of that source, not in a log nobody reads.
How documents are written matters too. We cover that in AI documentation and integrations, along with how to connect these systems to the tools you already use.
If you would like this built, our Company Knowledge Assistant does the work described here: file cleanup, permissions by role, team or client, and a source on every answer. It comes at a fixed price, with a senior scientist on the project and your data kept in your accounts. It does not suit math across many records or judgment calls, and we will say so if that is what you need. Our two-week AI Assessment is the usual way to find out.
Questions
Does RAG train the AI on our data?
No. RAG reads your documents at question time and leaves the model unchanged. Separately, check whether your provider uses what you send for its own training, since that depends on the plan. We only use providers that do not train on client data.
What is the difference between RAG and MCP?
RAG finds information. MCP, the Model Context Protocol, connects AI apps to tools and systems. A system can use both, with MCP as one way to reach a data source and RAG as the method for searching it. Our integrations guide explains MCP.
Does RAG need a vector database?
How accurate is RAG?
It depends on your documents and setup, and no independent figure exists for business use. The closest study, of legal research tools in 2024, found 17% to 33% of queries hallucinated.[15] Measure your own system on your own questions.
Does RAG stop prompt injection?
No. Prompt injection means hiding instructions in content the AI reads, and RAG feeds the model content by design. EchoLeak showed a single crafted email could make Microsoft 365 Copilot leak data with no user action.[22] Treat retrieved text as data, and limit what the assistant can do.
Can it search photos and recordings?
Yes, once they become text. Recordings are transcribed and photos are tagged or described, then indexed like any other document. The answer can link to the exact moment or image, so a person can check it.
Do our files need cleaning up first?
Usually. Duplicates and old drafts compete with current versions in search, and loose sharing becomes visible right away. You do not need perfection before starting, but you do need a current version of whatever matters and an owner for it.
Can we put this on our website?
Yes, as a separate system that uses only approved public content, kept apart from internal files. Since those answers reach customers directly, keep the content narrow and test it hard. You remain responsible for what it says.
Sources
- Lewis et al., NeurIPS, Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, 2020.
- Microsoft Learn, Chunk Documents, June 2026.
- OpenAI, Retrieval, Undated, read November 2026.
- Anthropic (vendor), Introducing Contextual Retrieval, September 2024.
- OpenAI, Vector embeddings, Undated, read November 2026.
- Microsoft (vendor), Raising the bar for RAG excellence (Azure AI Search whitepaper), Undated, copyright 2025.
- Anthropic (vendor), Citations, Undated, read November 2026.
- Microsoft Learn, Data, Privacy, and Security for Microsoft Copilot, Read November 2026.
- Microsoft Learn, Secure & Governed Data Foundation for Microsoft Copilot, Read November 2026.
- Microsoft Learn, Security Filter Pattern, Azure AI Search, Read November 2026.
- Microsoft Learn, Document-Level Access Control, Azure AI Search, Read November 2026.
- OWASP GenAI Security Project, LLM08:2025 Vector and Embedding Weaknesses, 2025.
- Microsoft Learn, Restrict discovery of SharePoint sites and content, October 2026.
- Microsoft Learn, Business plan for AI agents, Read November 2026.
- Magesh et al., Stanford, arXiv, Hallucination-Free? Assessing the Reliability of Leading AI Legal Research Tools (preprint), May 2024.
- European Broadcasting Union and BBC, Largest study of its kind shows AI assistants misrepresent news content 45% of the time, October 2025.
- RAGAS documentation, Available metrics, Read November 2026.
- Microsoft Learn, Retrieval-Augmented Generation (RAG) Evaluators for Generative AI, June 2026.
- Anthropic (vendor), Reduce hallucinations, Undated, read November 2026.
- Google Cloud, Check grounding, Undated, read November 2026.
- Microsoft Learn, Optimizing SharePoint content for Employee Self-Service agents, October 2026.
- Reddy and Gujral, arXiv, EchoLeak: The First Real-World Zero-Click Prompt Injection Exploit in a Production LLM System (preprint), September 2025.
Related pages on this site