A reader between tall library bookshelves.

You upload a handbook. The chatbot answers three questions correctly, then invents an exception in its fourth answer that appears nowhere in the document. Why does this happen when it already has the PDF?

RAG combines a search through your documents with a language model. When someone asks a question, the system finds relevant passages and gives them to the model as working material. That does not guarantee that every relevant passage will be found, correctly associated with the question or accurately reproduced. Microsoft explains this separation between retrieval and answer generation, along with its limitations, in its RAG documentation.

For a small business, the number of PDFs you can upload is therefore less important than another question: can a responsible person see where an answer came from and whether the documents used are still valid?

One question, two separate processes

Imagine a fictional service handbook. It says: “Express processing within two working days. Orders that require additional documents are excluded.” A customer asks: “Will my documents be ready by Thursday if I choose express?”

A useful assistant first needs to find the correct rule. It must then distinguish what the rule answers from what remains unknown: the date of receipt, whether the documents are complete and any other conditions. “Yes, definitely” would not be supported by this text.

The diagram at the beginning of the article shows both processes. During setup and updates, content is extracted, organised and made searchable. For each question, the system retrieves relevant passages that the user is allowed to access and builds an answer from them. If a necessary fact is missing, a follow-up question is the right result.

The RAG process: prepare documents, find relevant passages, draft an answer and check its supporting evidence.

Enlarge diagram ↗

Why a PDF is more than text

People recognise headings, footnotes and tables on a page. Automated processing must first preserve or reconstruct that structure. A scan needs text recognition. A page with two columns may be extracted in the wrong order. In a price table, a number may lose its column heading.

Our practical acceptance check: do not settle for a successful upload demonstration. Open the extracted version of a difficult page. Are the amount, unit and corresponding service still together? Is the footnote recognisable? A language model can carry an error from this step into a convincingly written answer.

For a few short documents, passing the complete documents directly to the model may also make sense. RAG is particularly useful when a larger or frequently updated collection needs to be searched selectively. It is not a mandatory component of every assistant.

Chunking: Where should a useful passage end?

“Chunks” are the sections into which content is divided for retrieval. Sections that are too small lose context; sections that are too large contain much that has little to do with the question. Headings, conditions and exceptions should remain retrievable together. There is no universally correct section length: Microsoft describes different methods and recommends matching them to document structure and the questions being asked. Source: Chunk documents for RAG.

In the express example, the exception is not an incidental sentence. If it is separated from the offer and omitted during retrieval, an important information gap appears. The useful test is therefore: “Does the system find the rule together with its restriction?” It is not: “Have we configured a particular number of characters?”

Four failure patterns that are easy to confuse

What you observe Check first Useful correction
A number is wrong despite the correct file being available Extracted text and table context Correct document processing
An answer uses an old price Version and validity date of the retrieved source Remove the old version from active retrieval
The rule is correct but the exception is missing Retrieved passages and neighbouring text Review document structure and retrieval together
Internal information appears in a customer chat Access controls before retrieval Technically separate public and restricted content

This table is a diagnostic aid, not a complete list of errors. Answer generation itself can also add statements that do not appear in the retrieved passages. You therefore need to be able to inspect the search results and the final answer separately.

Every document needs an owner

For important documents, establish who approves changes, when they take effect and which version is replaced. A filename such as “Prices_final_new_2.pdf” does not resolve these questions. Clearly maintained information about title, version, validity and source is more helpful.

When replacing a file, check the search index as well. Adding a new version does not prove that the old one is no longer being used. Include a question about the changed value in your acceptance checks. Repeat it after every relevant update.

Access controls also belong before answer generation. A public widget must not receive confidential documents and merely be instructed not to reveal them. Microsoft shows, for example, how identity filters can restrict search results; the application must actually enforce the permissions. Source: Security filters for search results.

How to test the knowledge base with your team

Retrieval is just one layer of control. Our guide to hallucinations in customer service explains how to combine sources, stopping rules and human handover.

For an initial exercise, select around 20 questions from real day-to-day work. This number is a manageable starting suggestion, not statistical proof of quality. Mix straightforward questions, exceptions, outdated terminology and questions whose answers are explicitly absent from the documents.

For each question, record the expected source passage, permitted statement and any necessary follow-up question. Then check: was the correct passage retrieved? Does it support the answer? Is missing knowledge acknowledged? For personal information, add another question: is this particular user entitled to receive this answer?

A citation is a route to verification, not a quality seal. Open the reference and compare the decisive statement. If the source merely mentions the same topic, the answer is not yet substantiated.

Planning a knowledge base with an AI assistant? For an initial conversation, bring three typical questions and one difficult document rather than an unorganised folder of everything. That makes it possible to assess the preparation your content actually needs.