Skip to content

Tech choices · November 20, 2026 · 5 min read

How do you build an AI assistant that answers from your company's own documents?

The short answer

You build it with retrieval augmented generation (RAG). Documents are split into chunks and indexed, each question retrieves the most relevant chunks, and a language model writes an answer from only those chunks, with citations. Good systems say they do not know when nothing relevant is found, and respect who is allowed to see which document.

Shelf of folders linked by light threads to a tablet showing a chat interface

Key takeaways

  • RAG looks up your documents first, then answers from only what it found, with citations.
  • Most wrong answers come from poor retrieval, so chunking and clean source files matter.
  • Enforce permissions at retrieval, not after the answer is written.
  • Test with real questions and known answers, including ones with no answer.
  • For a small, stable set of questions, a plain FAQ is the better tool.

What is RAG in plain English?

RAG is an open-book exam for an AI model. Instead of asking the model to answer from memory, you first look up the relevant pages from your own documents, hand them to the model, and tell it to answer using only those pages. The name stands for retrieval augmented generation, which sounds more complicated than it is.

This matters because a general model knows nothing about your price list, your refund policy or last quarter's contract terms. Training a model on that material is slow and awkward to keep current. Retrieval is simpler: when a document changes, you update the index, and the next answer reflects it.

How does a RAG assistant work, step by step?

A RAG assistant follows the same five steps every time, and knowing them helps you ask better questions of any vendor.

  1. 1Ingest. Pull documents from where they live: PDFs, a help center, shared drives, a wiki, support tickets.
  2. 2Chunk. Split each document into passages small enough to be specific, usually a few paragraphs, with their headings and source kept attached.
  3. 3Embed. Turn each chunk into a list of numbers that captures its meaning, and store those in a vector index such as pgvector inside PostgreSQL.
  4. 4Retrieve. When someone asks a question, turn it into numbers the same way and fetch the chunks closest in meaning.
  5. 5Answer. Give the question and those chunks to a language model, and have it write a reply that cites the source documents.

How do you stop it from making things up?

You make it prove its answers and give it permission to say it does not know. The first is citations: every claim links to the passage it came from, so a person can check in seconds. The second is a retrieval threshold: if nothing relevant comes back, the assistant replies that it could not find an answer in the documents, and offers to pass the question to a person.

Wrong answers usually come from retrieval, not from the model. The right passage was never fetched, because it was chunked badly, buried in a scanned PDF with no text, or phrased differently from the question. Fixing that means better chunking, cleaner source documents and sometimes combining keyword search with meaning-based search.

Source quality deserves its own mention. If your documents contradict each other, for instance an old pricing PDF and a new one both sitting in the same folder, the assistant will happily quote whichever it finds first. Before building anything, we usually ask who owns each document set, which version is current, and how stale files get retired. It is dull housekeeping, and it improves answers more than any model upgrade.

A short instruction helps too. Tell the model to answer only from the provided passages and to quote the source. It will not make hallucination impossible, which is why testing matters.

How do you handle permissions for each user?

Permissions have to be enforced at retrieval, before the model ever sees a document. If an intern asks about salaries, the system should only search the chunks that intern is allowed to read. Filtering the answer afterward is too late, because the information has already gone to the model.

Think about the failure you cannot afford. For a support assistant it might be quoting a refund policy that does not apply to this customer. For an internal assistant it might be surfacing a draft contract to the wrong team. Naming that failure early tells us where to spend the testing effort.

In practice, each chunk carries metadata about who may see it: a team, a role, a customer account. The search adds a filter from the signed-in user's identity. This is ordinary access control applied to search, and it is the part most often skipped in demos. Ask about it early, because retrofitting it means re-indexing everything.

If your assistant will use customer data or anything sensitive, also decide where it runs and which providers see the text. We can set it up inside your own AWS, Azure or Google Cloud account, with providers and settings that do not train on your data.

How do you test that it works?

You test it with real questions and known answers, before launch and after every change. Gather thirty to fifty questions your staff or customers actually ask, write down the correct answer and the source document for each, and run them through the assistant. Score two things separately: did it retrieve the right passage, and did it answer correctly from it.

Include awkward cases on purpose. Questions with no answer in the documents, questions where two documents disagree, and questions phrased the way a frustrated customer would type them. This list becomes a regression test, so when someone edits the chunking or swaps the model, you can see right away whether quality moved.

Keep a human in the loop at the start. For the first few weeks, let staff review a sample of conversations each week, mark answers as good, wrong or incomplete, and feed the misses back into the question list. Real users ask things you did not predict, and that sample is where the best improvements come from.

We measure each system against the manual process it replaces, so the comparison is concrete: how many questions it handles correctly, how many it hands off, and how many hours that saves.

What does it cost to run?

Running costs have a few parts: the model calls that write each answer, the embedding calls that index documents, the vector storage, and the hosting. For a modest document set and moderate traffic, these are usually small next to the build and the ongoing care of the content.

The cost that surprises people is volume and model choice. A larger model on every question adds up faster than a smaller one with good retrieval, and caching common questions helps. We set cost controls and monitoring from the start, so you see usage before the invoice does. We will not quote a figure here, because it depends on your documents and traffic, and a fixed USD estimate comes after a short discovery call.

When is a simple FAQ better than a RAG assistant?

A simple FAQ is better when you have a small, stable set of questions, such as thirty answers that rarely change. A well-written FAQ page or a search box is cheaper, faster and fully predictable, and it never invents anything.

RAG earns its place when the knowledge is large, scattered across many files, changes often, or needs to be combined across documents. It also suits internal teams who lose hours hunting through shared drives. If you are unsure, start with the use-case review in our AI automation work, where we test a prototype on your real documents before you commit. For broader context, see our notes on AI agents for small business and the Model Context Protocol, or contact us with a sample of your documents.

Questions people also ask

  • Usually not. RAG gives an existing model the right passages at question time, so there is no training run, and updates are as simple as re-indexing a changed file.

  • Yes, but scanned pages need text extraction first, and quality varies. Cleaning source documents is often the highest-value task in the whole project.

  • Not if access control is built into retrieval. Each chunk is tagged with who may see it, and every search is filtered by the signed-in user. We test this with deliberately unauthorized questions.

  • Yes. The same assistant can answer in Slack or a website widget, and we integrate with the CRM, email and sheets you already use.

Related services

Written by the Trennect engineering team, Ahmedabad. Published November 20, 2026.