An AI chatbot that answers from your company documents (RAG): what it is, what you need and mistakes to avoid
Evaluate a document assistant: sources, permissions, testing and limits before putting it in users’ hands.
What a RAG system actually does
A RAG assistant retrieves relevant passages from a collection of documents and uses them as context to draft an answer. The initials stand for retrieval-augmented generation. This does not mean the model has memorized every document, and it does not guarantee that every answer is correct.
Imagine someone asks about an internal policy. The system searches for related content, gives the passages it found to the model and generates an answer. If it shows its sources, the reader can check where the answer came from. If it cannot find enough information, it should say so rather than fill the gaps.
What you need before building
Start with real questions and a specific group of users. Are they looking for internal procedures, product information or answers for customers? Each use case needs different sources, permissions and supervision. Collect example questions and answers an expert would consider acceptable.
Identify current documents, their owners and where they live. A folder full of conflicting versions does not become a reliable source because you connect a chatbot. Decide how documents are updated, what happens when one is withdrawn and who resolves contradictions.
Access and data
The assistant must respect the permissions of the person asking. Hiding a link is not enough: retrieval must also filter content that person cannot access. Review what data goes to providers, where it is processed and how long it is retained. Involve the people responsible for security and privacy before loading sensitive information.
Sources people can check
Scans, tables and poorly structured files can be extracted incorrectly. Inspect a sample of retrieved text and keep references to each source’s version and location. The design should help someone find the original, not simply trust a convincing sentence.
Mistakes that make a demo fail in production
First, testing only easy questions. Include ambiguity, missing information, contradictory documents and requests outside a user’s permissions. Check both the answer and retrieved passages: if search brings back the wrong material, changing the assistant’s wording will not fix the source of the problem.
Second, requiring an answer every time. A useful response can be “I do not know” with a route to a person. Define when the assistant must abstain and which topics require human review. Test attempts to introduce malicious instructions through documents or questions, and limit what the assistant can do with external tools.
Plan a first trial
Choose a limited collection and assign someone to validate answers. Prepare representative questions before tuning the system. Record whether it finds the right source, whether the answer is supported and whether it respects permissions. Keep cases used for tuning separate from cases reserved for evaluation.
Start with a small group, collect corrections and review unanswered questions. Decide how feedback is handled and how to remove access or disable the service. Add sources only when their quality and permissions can be maintained.
The work continues after launch
Documents change, people move roles and new questions appear. You need an update process, failure monitoring and periodic review. Watch external service usage and response time too: both affect the experience and the effort of operating it.
RAG can fit when answers live in changing documents that people need to consult. If a clear page answers the question or the task calls for expert judgment, a chatbot may not be needed. Our AI service starts by checking that.
Example: searching manuals without mixing versions
Imagine a small business with product manuals and internal procedures spread across folders. The support team spends time finding the current version. A first use case could help locate instructions for a specific product and show the source document and section. The answer would remain available for the person handling the request to review.
Before connecting folders, identify which manual belongs to each product version and who updates it. An answer based on an old manual can sound convincing and still be wrong. If two files conflict, the assistant should flag the uncertainty or refer the question instead of choosing a rule because it seems more likely.
Test incomplete names, similar products and procedures that are not documented. Include a question whose answer exists only in a restricted folder. Check that a person without permission cannot receive the content, even as a summary. These cases teach more than a demo using one perfect document.
A checklist for documents and evaluation
Assign an owner to each collection. Mark the current version, remove or separate drafts and define what happens when a document expires. Check that extracted text retains headings, tables and references that change the meaning of an answer. If a scan is read badly, fix the source or extraction process before evaluating the model.
Prepare real questions with expected answers and verifiable sources. Include different wording, questions with no answer, conflicting information and requests requiring different permissions. For each case inspect what was retrieved, what was answered and whether the citation leads to the right place. Record when the assistant should abstain.
Decide who reviews the test set when a source, access rule or provider changes. Provide a way to correct answers and remove documents. A system that worked at launch may stop being useful when information changes and nobody is responsible for maintaining it.
What to ask a RAG provider
Ask them to show how permissions are enforced during retrieval, not just on screen. How are documents updated and deleted? How are versions identified? What happens when there is insufficient evidence? Request examples of answers with citations and of questions the system refuses or passes to a person.
Ask which services receive your data, which retention terms apply and how logs, credentials and administrative access are handled. Clarify whether a provider can use content for other purposes and how that is checked. Review the answers with the people responsible for security and privacy in your company.
Request a test plan using cases prepared by your team, acceptance criteria and responsibilities after launch. Ask how an incorrect answer will be investigated and who can disable the assistant. A polished interface does not answer those questions or turn disorganized information into a reliable knowledge base.
Decide what the assistant is allowed to do
Searching and summarizing is different from changing records or sending a message. Treat each additional action as a separate decision. Define the user who authorizes it, the information it may use and the checks required before anything changes. A confirmation screen can help, but only if the person can see enough context to understand the action.
Keep a route to the original document and a human contact for unresolved questions. If the answer affects a sensitive decision, design the workflow so an authorized person checks the source. Start with a narrow audience and expand only when the evidence from real use supports it. Stopping or narrowing a trial is a useful outcome when it exposes an unreliable source.
Turn feedback into a maintenance routine
A report that an answer is wrong needs enough context to investigate. Record the question, the sources retrieved and the document version, subject to your data-retention rules. Then decide whether the issue came from the source, retrieval, permissions or the answer itself. Each cause calls for a different correction.
Assign the correction to an owner and repeat the relevant test after the change. Review unanswered questions too: they may reveal a missing document, an unclear question or a boundary the assistant should keep. Avoid measuring success only by how often it responds; an appropriate refusal can be the right result.
Frequently asked questions
Does RAG guarantee correct answers?
No. Retrieval and generation can fail. Visible sources, tests and supervision reduce risk but do not eliminate it.
Must the model be trained on our documents?
RAG retrieves information for each query; it does not require training the model on those documents.
Can it search private documents?
Only with appropriate access controls designed and tested alongside the data-processing terms of the providers used.