Blog & Insights

How do you get an AI assistant to answer from your own documents?

You put a search over your documents in front of the model. For each question the system finds the relevant passages and the model answers from them, with citations. The model is not retrained.

You put a search over your documents in front of the model. For each question, the system first finds the passages most likely to hold the answer, then gives those passages to the model and asks it to answer from them, with a citation for each point. This is called retrieval, or retrieval-augmented generation (RAG). The model is not retrained on your documents, and most of the work is in the documents and the search.

What retrieval is

A language model knows what it was trained on. That does not include your policies, your contracts or your procedures. Retrieval hands it the relevant ones at the moment someone asks.

  1. A person asks a question.
  2. The system searches your content for the passages that best match it.
  3. Those passages go to the model together with the question.
  4. The model writes an answer from the passages and cites where each part came from.

Nothing about the model changes. When a document is updated and indexed again, the next answer uses the new text.

What has to be in place for it to work

  • Text a machine can read. The system has to get the words out of PDFs, Word files, intranet pages and scans. Scanned pages and tables are where that goes wrong.
  • Passages cut in sensible places. Documents are split into pieces small enough to search. Cut in the wrong place, a rule ends up in one piece and its exception in another.
  • An index that searches by meaning and by keyword. Each passage is stored as an embedding, a list of numbers that represents what it means, in a vector index. That finds a passage that answers the question in different words. Keyword search finds the exact part number or name. Using both usually beats either one.
  • Permissions. The search should return only what the person asking is allowed to open.
  • Instructions to the model. Answer only from the passages, cite them, and say so when they do not contain the answer.
  • A way to stay current. Changed documents are indexed again on a schedule, and retired ones are removed.

Retrieval also sends passages of your documents to wherever the model runs. If some content cannot leave your environment, settle that before you choose the model. Do you need a Private LLM? walks through the decision.

Where the answers go wrong

The right passage was not found. The model then answers from a near miss. When someone reports a bad answer, look first at what the search returned.

Old and duplicate documents. If three versions of a policy are in the index, the search cannot tell which one is current, and any of them can be cited.

Questions that need the whole set. Retrieval finds passages. It does not count or total. “What does our travel policy say about rental cars?” is a retrieval question. “How many contracts renew next quarter?” is a question for a database, even if the contracts are documents.

The model goes beyond the passage. It can misread a passage or fill a gap. Citations are what let a person check.

When an assistant you already own does the retrieval

Some assistants come with retrieval built in for the content they sit next to. Microsoft says its Copilot generates responses anchored in your organizational data through Microsoft Graph, and only surfaces data that the individual user has at least view permissions for. If your documents live there, you do not build the search. Your work is the state of the documents and of the permissions.

A custom build makes sense when the content lives outside the products that offer this, when the answers have to appear inside your own application, or when you need control over how documents are split, searched and cited.

How to tell whether it works

Test it with real questions before anyone depends on it. We build the test set from fifty to a few hundred real cases, with the correct answer for each agreed with the person who does the job today. How we test AI before it touches your business describes the method.

For a document assistant, record two things for every test question, and keep them apart.

  • Did the search return the passage that holds the answer?
  • Did the answer say what the passage says?

The first tells you whether to fix the documents and the index. The second tells you whether to fix the instructions or change the model. Include questions the documents do not cover, and check that the assistant says it cannot find the answer.

Where to start

Pick one set of documents that has an owner and that people already ask questions about, such as HR policies, product manuals or operating procedures. Have the owner name the current version of each document and archive the rest. Connect the assistant to that set only, and add the next set when it has been cleaned up.

Common questions

Do we have to train or fine-tune a model on our documents? No. With retrieval the model stays as it is. Your documents are searched at the moment of each question, and the passages that match are handed to the model along with it. When a document changes and is indexed again, the next answer reflects it.

Will the assistant show people documents they are not allowed to see? It should not, if the search applies each person’s own permissions. Ask of any product or any build whose permissions the search runs under. If it reads everything through one account, everyone who asks can read everything.

Does retrieval stop the model from making things up? It reduces the problem and does not remove it. The model can still misread a passage, or answer when the passages do not hold the answer. Require citations, instruct it to say when it cannot find the answer, and test it with questions your documents do not cover.

How much content do we need to start? One well-kept set is enough: a policy manual, a product catalog or a set of procedures. A small set that is current and has an owner gives better answers than everything on the shared drive.

If the answers have to appear inside your own application, or the content lives outside the products you already own, that is a build, and AI & Automation describes how we approach one.

Related service: AI & Automation

More like this, in your inbox. Subscribe for our latest thinking, resources, and events.

Get started

Want results like these?