Foundations

How AI can answer from your own documents (retrieval, explained)

Giving an assistant your documents lets it look up the relevant passages before it answers, which helps accuracy but does not remove the need to check.

By Laner Labs Learning teamPublished Updated 5 min read

A search window with sources and a magnifier

Retrieval means the assistant searches a set of documents you have given it, pulls out the passages that look relevant to your question, and writes its answer using those passages. It is often called RAG, short for retrieval-augmented generation. It helps because the answer is anchored to your material instead of the assistant's general memory, but it can still misread or miss things, so you check the result against the source.

What retrieval actually does

A general assistant answers from patterns learned during training. It does not know your leave policy, your product specification or last quarter's pricing sheet. You could paste a whole document into the chat, but long documents are awkward, and a whole library will not fit.

Retrieval solves this in two steps. First, your documents are split into chunks, usually a few paragraphs each, and indexed so they can be searched by meaning as well as by exact words. Second, when you ask a question, the system finds the chunks that seem closest to it and hands them to the assistant along with your question. The assistant then writes an answer based on those chunks.

Different tools do this in different ways and under different names, such as knowledge bases, projects, file search or custom assistants. The details, limits and settings vary by tool and plan and change often, so check your tool's own help pages rather than assuming.

Why it helps accuracy

  • The assistant sees the actual wording of your policy or specification instead of guessing.
  • Your material can be newer than anything the assistant learned in training.
  • You can ask it to point to where an answer came from, which makes checking faster.

Where it still goes wrong

Retrieval is not a guarantee. Three failures are common.

  • It misses the right passage. The search may pull back chunks that sound similar but are not the ones you needed, so the answer is built on the wrong text.
  • It misreads a correct passage, for example by dropping an exception or mixing up two conditions.
  • It fills gaps from general knowledge and presents the result as if it came from your documents.

Contradictory documents make all of this worse. If one file says refunds take 14 days and an older one says 30, the assistant has no reliable way to know which is current.

How to prepare your documents

Good preparation does more for accuracy than clever questions. Think of how a new colleague would struggle with the same files, because the assistant has the same difficulty.

  • Give each document a clear, specific title. Expenses policy 2026 is better than Policy final v3.
  • Use short sections with descriptive headings, so each chunk covers one idea.
  • State dates and versions inside the text: effective from, last reviewed, replaces.
  • Remove or archive outdated versions so the assistant cannot find them.
  • Resolve contradictions at the source. Decide which rule is correct and fix the other document.
  • Spell out abbreviations and internal names the first time they appear.

A worked example: testing a policy assistant

Suppose a small team has loaded its travel policy and expenses policy and wants to ask questions about them. Before anyone relies on it, run a short test.

  1. Write ten real questions staff ask. Include a few easy ones, a few that depend on an exception, and two the documents do not answer at all.
  2. For each question, find the correct answer yourself from the documents and note which page or section it is in.
  3. Ask the assistant each question with an instruction such as: Answer only from the documents provided. Quote the exact sentence you used and name the document and section. If the documents do not say, tell me so.
  4. Compare each answer with your notes. Check that the quoted sentence really appears in the named document and really supports the answer.
  5. Look closely at the two unanswerable questions. A good result is a plain statement that the documents do not cover it. A made-up answer tells you the setup is not safe for that kind of question.
  6. Record what failed and why. Often the cause is a vague title, a missing date or two documents that disagree, and you can fix that in the files.

Good to know

A quote that sounds convincing is not proof. Open the named document and find the sentence yourself. Assistants can produce a plausible citation that does not match the source.

Questions worth asking of any document assistant

Before you trust a setup, find out a few things about how it behaves. Does it show which passages it used? Can you see the list of files it has access to? What happens when a file is replaced or deleted, and how quickly does the assistant notice? Does it handle tables, scanned pages and images, or only plain text? Scanned documents in particular may need to be converted to text first, and tables can lose their meaning when split into chunks. Your tool's help pages should answer these, and if they do not, a small test with your own files will.

Who can see what

Giving documents to an assistant is also an access question. If a shared knowledge base includes salary data or client files, anyone who can query it may be able to surface that content. Ask who can add files, who can ask questions, and whether the tool respects the permissions your documents already have. Do not upload confidential or personal data to a tool your organisation has not approved.

Keeping it reliable over time

Documents change, and an assistant built on last year's files will keep quoting last year's rules. Name an owner for the document set, review it on a schedule, and rerun your ten test questions after any significant change. Keep the test list; it is the cheapest quality check you will have. It also gives you a fair way to compare one tool or setting against another, because the same ten questions can be run each time and the results set side by side. When an answer is wrong, write down whether the problem was retrieval (wrong passage), reading (right passage, wrong conclusion) or the documents themselves, since each has a different fix.

If you want to practise building and testing a document-based assistant step by step, the course on working with your own documents covers it.

Common questions

Is retrieval the same as training the AI on my documents?

No. With retrieval the assistant looks up passages from your documents at the moment you ask and uses them to write the answer. The underlying model is not changed by your files.

Does using my documents stop the AI from making things up?

It reduces the problem but does not remove it. The assistant can still misread a passage, miss the right one, or blend your text with its general knowledge, so you should check important answers against the source.

Can I upload any document I like?

Only if your organisation allows it. Confidential, personal or client material should go only into tools your organisation has approved, and access rules still apply to who can see which files.

Official pages to check

AI tools change quickly. Check the vendor's current help page before you act, and review anything an AI tool produces before you rely on it.

Share this article