11 mins read

AI Document Chat and RAG: Build a Knowledge Base You Can Verify

A document chat system retrieves passages and uses them to draft an answer. When it fails, the right passage may be absent, overlooked or misunderstood. Those three failures need different fixes. A small collection of carefully chosen questions makes them easier to tell apart.

Consider a team organizing its own internal software handbooks. The most useful comparison for this reader is a finished task, including the time spent correcting a result or working around a missing feature. A demonstration can show what is possible under favorable conditions. To decide whether the same capability belongs in your routine, bring your own examples and make the conditions explicit. The six exercises below can be run individually. Start with the one whose failure would cause the most trouble in your day.

What you need to understand first

Retrieval-augmented generation, often shortened to RAG, brings selected material into a model's input before the answer is generated. Updating the library does not require teaching the model every fact again, but the search layer must be able to find the new text. When an answer fails, inspect the retrieved excerpts first. If the correct passage is absent, focus on indexing, search or passage boundaries. If the passage is present and the response misstates it, examine the question and answer-generation behavior. This distinction prevents a team from rewriting good documents to compensate for a different problem.

A worked example

Create two short test handbooks for a fictional team. In the earlier edition, equipment requests go to the office coordinator. In the newer edition, they go through a form except for urgent replacements. Ask separately where a normal request goes, how an urgent replacement works and when the rule changed. Review the evidence for each answer. A passage from the old edition can be correct historical evidence and still give the wrong instruction for today. Preserve the effective date in the retrieved context so an answer about current procedure can be distinguished from a question about a past request.

When the collection grows, keep this tiny test set alongside real questions from team members. It provides a quick way to see whether an indexing change broke version handling before you spend time grading longer answers.

Choose the first collection

Begin with a current handbook, an archived copy and a short change log. To make the comparison useful, label each source with owner, edition and effective date before adding it. Record which edition the system treats as current when two passages conflict. The reason for starting here is straightforward: unlabeled archives can make an outdated answer look well supported.

Make a prediction before starting. Write down what would count as a usable result and what would require you to do the work again. A prediction gives you a standard independent of how impressive the demonstration feels. Save the original input and keep the first result even if a second attempt looks better. If the first attempt exposes a setup requirement, record that as part of the experience. A feature you use once a month may need to justify that setup each time, while a daily user can spread it across many sessions.

Inspect passage boundaries

Use a procedure whose exception appears after a page break as the reference. For this trial, ask for the normal process and its exception and inspect retrieved passages. Look specifically at whether the instruction and qualifier appear together in the evidence. This is worth a separate check because splitting a paragraph at the wrong point can strip a rule of its limits.

Give the comparison two passes. For the first pass, follow the normal setup and leave optional settings alone. For the second, change the single setting most likely to explain a difference you observed. Label the results with the setting and the reason for the change. When several things change together, a better result tells you that the combination worked, but gives little guidance about which choice to keep. Reversing the change once is a useful way to check whether the improvement follows it.

Test exact identifiers

Prepare a handbook section named with a product code rather than an ordinary word. Then ask once with the code and once with a natural-language description. Write down whether the same relevant passage is retrieved for both questions. Interpret the result carefully because an unfamiliar identifier can behave differently from a semantically similar phrase.

Pay attention to the size of the difference as well as its direction. A minor inconvenience that happens on every use can become expensive over a month. A conspicuous problem on a rare input may have a simple workaround. Note how often the situation occurs in your actual work and how long recovery takes. If another person will be doing the recovery, ask them to try it before estimating the cost. Their experience may differ from that of the person who set everything up.

Evaluate unsupported questions

Begin with a request about a policy deliberately absent from the collection. To make the comparison useful, ask for the supporting passage and review whether the system admits the gap. Record invented policy text, unrelated citations and appropriate uncertainty. The reason for starting here is straightforward: an answer assembled from vaguely related material can sound authoritative.

Inspect the result at the point where you will use it. Follow the ordinary sequence from starting the task to leaving it in a state that somebody could rely on tomorrow. Where possible, have a second person inspect the result without explaining what you expected them to see. Ask them to identify a specific discrepancy or confirm a specific detail. A concrete observation can be checked against the original. An overall impression is harder to use when the next version changes something subtle.

Check document permissions

Use two test users with deliberately different access to harmless example documents as the reference. For this trial, ask each user about a distinctive phrase in the restricted sample. Look specifically at whether text, snippets and citations respect the intended access boundary. This is worth a separate check because document access and answer visibility must be checked together.

Keep the evidence small enough to revisit. Save one representative success and one example that shows the limit of the setup, with a sentence describing the conditions. These paired examples are more informative than a long collection of favorable results. If you encounter a failure, repeat it with an ordinary input before drawing a broad conclusion. The next question is whether the limitation appears under conditions you can predict and whether a practical alternative exists when it does.

Retest after a revision

Prepare a handbook section whose procedure has changed in the latest approved edition. Then replace the source using the normal update workflow and rerun the original questions. Write down whether new answers reflect the revision and identify the right passage. Interpret the result carefully because an updated file and an updated search index are separate things.

Run the final trial as somebody who will inherit the result. Start from the information they would actually receive and see whether they can complete the next step without contacting the original tester. Make a note of any missing detail that forces them to guess. Include that detail with the final recommendation. This matters especially when the person choosing a product or feature is different from the person who must live with its limits after the initial setup.

A comparison sheet you can use

Use one row per trial. The left side of the sheet describes the input, the middle records what happened, and the right side records what that observation means for your decision. Fill in the input and the intended check before running the trial. Leave the final decision blank until you have examined the evidence. In particular, distinguish a missing observation from an observed failure. A blank cell means there is still something to learn. A failed check identifies a limitation you can investigate or accommodate.

Trial Example input or setup Evidence to capture
Choose the first collection a current handbook, an archived copy and a short change log which edition the system treats as current when two passages conflict
Inspect passage boundaries a procedure whose exception appears after a page break whether the instruction and qualifier appear together in the evidence
Test exact identifiers a handbook section named with a product code rather than an ordinary word whether the same relevant passage is retrieved for both questions
Evaluate unsupported questions a request about a policy deliberately absent from the collection invented policy text, unrelated citations and appropriate uncertainty
Check document permissions two test users with deliberately different access to harmless example documents whether text, snippets and citations respect the intended access boundary
Retest after a revision a handbook section whose procedure has changed in the latest approved edition whether new answers reflect the revision and identify the right passage

How to make the decision

For a team organizing its own internal software handbooks, start by deciding which trial is essential and which represents an occasional convenience. A strong result on an optional feature cannot resolve a failure on the task that motivated the comparison. Take the essential trial and run it again after closing and reopening the relevant software. Check whether the same result is available without repeating steps you assumed would be permanent. Keep a note of anything you had to download, enable, purchase or configure before the result became usable.

A sensible second round pairs “Inspect passage boundaries” with “Check document permissions.” Run both under the conditions you normally encounter, then look for a tradeoff between their outcomes. The option that looks best in a single isolated test may impose additional effort elsewhere. Record the tradeoff in ordinary language so that a reader can decide whether it matters in their own circumstances. Include a short example of the work affected and the time or effort needed to deal with it.

Finish with a dated recommendation covering three things: what worked, where the boundary appeared, and what would make you reconsider. Use the specific observation from the trial on choose the first collection to support the first point. For the boundary, select a limitation you actually observed. For reconsideration, name a change you can recognize, such as a new release, an altered workload or a different requirement. This gives your comparison a useful life beyond the first purchase or installation.