Why a general model does not know your documents
A general AI model is trained on large amounts of public text up to a certain date. It has never seen your internal procedures, price agreements or product sheets, and when asked about them it either says it does not know or writes something plausible that is wrong. Fine-tuning, training the model further on your own material, is often suggested as the fix but rarely is one. It teaches the model style and patterns rather than reliable facts, it has to be redone when the documents change, and it cannot show where an answer came from. For questions about what the documents say, the model should instead be handed the right passages at the moment the question is asked.
How RAG works, step by step
The documents are first split into passages of a few paragraphs each. Every passage is turned into an embedding, a list of numbers that describes its meaning, and stored in a search index together with a reference to the document and the place it came from. When someone asks a question, the question is turned into an embedding in the same way, and the index returns the passages whose meaning is closest, often combined with ordinary keyword search so that article numbers and names are found too. The model then gets the question and those passages, with the instruction to answer only from them and to state which documents it used. The model writes the answer; the search decides what it has to work with.
Which documents suit it, and keeping them current
RAG works best on text that answers questions: manuals, procedures, policies, product and service descriptions, agreements and support articles. Scanned documents need text recognition first, and tables and spreadsheets often need their own handling, since splitting them into passages breaks the link between a figure and its heading. Old versions are a common source of wrong answers, because the index cannot tell which of two contradictory documents applies. Each document should therefore have an owner and a date, outdated versions should be removed, and the index should be updated automatically when a document is added, changed or deleted, not rebuilt by hand now and then.
Access rights follow the user
A search index that contains every document in the company will happily quote a salary list or a board memo to anyone who asks the right question. The rule is that a user only gets answers from documents that user is allowed to open. In practice the index stores who may read each passage, taken from the same permissions as the file storage or the system the document comes from, and the search filters on the logged-in user before anything reaches the model. Filtering afterwards in the answer is not enough, because the model has then already read the text. When permissions change in the source, the index has to follow.
How you know it answers correctly
Before anyone relies on the answers, a test set is built from real questions that employees ask, each with the correct answer and the document it should come from. The test set is run every time the splitting, the search or the model is changed, so it is clear whether the change made things better or worse. Each answer should show its sources with a link to the passage, so that the reader can check and so that wrong answers can be traced back to an outdated document or a weak search. Just as important is that the assistant says when the answer is not in the documents, instead of filling the gap from general knowledge.
Where the documents are processed
Internal documents often contain personal data, customer information and business secrets. With RAG they pass through several steps: the service that creates the embeddings, the search index and the AI model that writes the answer. For each step it should be clear where the data is stored and processed, whether the AI provider may keep or train on it, how long questions and answers are logged and who can read the logs. The same questions arise for every AI use, and a review of your AI setup is where we go through them together with the rest of the plan, including what applies under GDPR.
Internal assistant or website chat
An assistant on internal documents and a chat on the public website are built on the same idea but differ in who asks and what may be shown. The internal assistant needs login, access rights and often several sources, such as file storage, an intranet and a ticket system. A website chat answers anyone, but only from pages that are already public, which makes it simpler to start with; the guide to AI chat on your website covers that variant, and our Anno Chat answers from the website's pages. Connecting AI to internal documents and systems is described under AI and automation.