With RAG over PDFs, meaning an assistant that looks things up in your own documents before each answer, preparation determines what it can know at all. Digital text, scanned pages and tables each need a different check. A successful upload does not prove that headings, numbers, footnotes and reading order reached the assistant's search correctly.
An example: a manufacturer of conveyor systems in Vigo with 45 employees wants to take work off its customer service team with an AI assistant. Today, a technician calls from a customer site, and Iago from customer service looks for the answer himself in operating manuals, old scanned maintenance handbooks and the price list for service contracts. Once it is in place, the assistant should answer these questions and say on which page the answer is.
Key takeaways
- A number in a table only gets its meaning from the column heading, row label, unit, period and footnote.
- For each piece of text, store which document, version, page and section it comes from, and give each document a quality state.
- First check whether the text comes out of the PDF correctly, whether the structure is right, whether each answer knows its source and whether specialists sign it off. Only then is it worth adjusting the size of the text pieces or the language model.
So start with the question of which statements your team really needs from the documents. Someone looking for one clause in a contract has different needs from someone comparing several rows of a table.
01 / 16
Which three PDF types should you distinguish?
At the conveyor manufacturer, three kinds of PDF sit side by side, and each fails in its own way. This affects the quality of the answers, the cost, and how quickly you find a mistake.
| PDF type | What it contains |
|---|---|
| Digitally generated PDF | May contain usable text |
| Scan | Starts as page images and needs character recognition |
| Mixed document | Contains both, sometimes with competing representations of the same content |
The current operating manual was saved as a PDF from a word processor. Iago can select text in it with the mouse, but that is not enough as a check. The order in which the text is stored internally can still be wrong, especially with several columns or freely placed text boxes.
The old maintenance handbook, by contrast, is a scan that someone once ran character recognition (OCR) over. That existing text layer can be outdated or wrong.
For each document, note how the text was extracted and which pages cause problems. Suppose the spare parts list in the appendix of the 200-page maintenance handbook is unreadable. Such a page should not sit silently in the system as an empty, successfully processed page. It needs a visible note that it still has to be checked.
02 / 16
Which questions should the assistant answer?
Before a document goes into the assistant, Iago writes down questions that his technicians really ask and that depend on the actual document. One technician looks for the spare part number of the drive belt. Another wants to know what must be switched off before opening the cover. A third needs the maximum belt load with its unit from a table, and a fourth asks about an exception that only appears in the appendix. For each question, Iago notes the correct place in the original right away: document and page.
With these notes, you can later find out where a mistake happened. If a number is missing from an answer, you can check whether it was lost when the text was extracted from the PDF, whether it ended up in the wrong piece of text, or whether the search did not select it. Without the noted place, every mistake looks like a general AI problem.
Put difficult pages into the test on purpose: a skewed scan, small print, pages with several columns, repeated headers, and tables that run across a page break. If you only test clean title pages, you will think the processing is better than it is.
03 / 16
How do OCR and layout analysis differ?
Character recognition (OCR) recognizes characters, while layout analysis additionally tries to recognize what is a paragraph, a heading or a table. Microsoft documents a layout analysis for its Document Intelligence service that outputs text and structure. Which formats and functions are available depends on the specific version. Microsoft: document layout analysis.
A recognized structure is still the output of a machine that someone has to check. The frame of a table can be recognized correctly while a number still lands in the wrong column. A high score for overall recognition quality does not tell you that exactly the decisive maintenance interval was read correctly.
So decide which details in your documents really count. Product codes, amounts, units, dates and negation can change a decision more than a misread filler word. If, at the conveyor manufacturer, the word "not" goes missing in a safety note, the note suddenly says the opposite. Check exactly these places most thoroughly.
04 / 16
Why is the order of the text sometimes wrong?
The operating manual is set in two columns. A simple extraction, meaning pulling the text out of the PDF, can mix the two columns line by line. The assistant then holds a sentence like "Before opening the cover, retension the belt" that is grammatically fine but appears in no real paragraph. So compare the extracted text with the page, section by section.
At the bottom of every page of the manual it says "Operating manual FB-40, edition 03/2024". Repeated headers and footers like this can swamp every piece of text. Remove or label them deliberately, but keep the version information and the page number. If you simply delete the first and last line of every page, you may also delete notes that matter.
Hyphens at the end of a line also need care. If the type designation "FB-40-ES" is split at the end of a line, joining it back must not create a different product code. The details are in the section for your IT team below.
05 / 16
How do tables stay understandable?
A table is more than cells. The number "250" in the maintenance table only says something once it is clear which model it applies to, which unit it is in and whether a footnote limits it. If these relationships are separated during import, a correct number can end up in a wrong statement.
Each element of a table needs its own check before the table goes into the assistant:
| Element | Required check |
|---|---|
| Column heading | Does the value belong to the right variant? |
| Row label | Is the correct product identified? |
| Unit | Units, euros, percentage or another measure? |
| Time reference | Month, year, snapshot or effective period? |
| Footnote | Does an exception change interpretation? |
| Continuation | Are rows on the next page part of the same table? |
Which form a table gets in the assistant depends on the question your team asks, not on the file extension. Search and calculations suit different forms; more on this in the section for your IT team below.
06 / 16
An example with a footnote
The conveyor manufacturer's price list for service contracts shows the value 120 for Product A and 95 for Product B. The column heading reads "Monthly service amount in euros". A footnote explains that an additional amount applies to a particular contract variant. The numbers are invented and are not real prices of any vendor.
A customer asks Iago what the service contract for Product A costs. The assistant must not turn "120" into a one-time purchase price without context. If the customer asks about the contract variant from the footnote, the assistant must also take the footnote into account. A link to the correct PDF file does not make a wrong interpretation correct.
In the test, Iago therefore checks number, unit, period and exception separately. If the footnote is missing from the extracted text, the source is corrected first, or the assistant may not answer this question for now. An additional instruction to the language model cannot reliably replace the missing information.
07 / 16
Why is retrieval not complete table computation?
The question "What value is listed for Product A?" may be answerable from one matching passage. The question "What is the total of all entries?" needs all relevant rows and a dependable calculation. A handful of similar search results is not enough for that.
If your team needs such analyses regularly, the values should be pulled out of the table as structured fields and checked against the original. After that, an ordinary program can do the calculation, one that gives the same result for the same numbers every time. The language model can explain the result, but it should not conclude from a random or partial excerpt that it has seen all the rows.
Check filters as carefully as the numbers. Suppose management asks for "all entries for Austria in September". For that, every row has to be assigned to a country and a period. A correctly added total over the wrong rows is still wrong.
08 / 16
What happens to drawings and diagrams?
Some information exists only in diagrams or technical drawings, at the conveyor manufacturer for example in the wiring diagram of the control cabinet. A text-only import cannot capture it completely. Additional image analysis may help, but it needs its own check and its own reference to the source.
Distinguish what is labelled in the image from what a model concludes from it. When a model summarizes a diagram, the result is an interpretation that can contain errors. So keep the image or a precise page reference, so that someone can check the original.
For critical dimensions, wiring diagrams or safety instructions, an automatically generated description should not replace the original without a suitable check by a specialist. If a technician asks about the terminal assignment, a useful answer can show the relevant excerpt and ask for a check by a person, instead of claiming a seemingly exact interpretation.
Got a workflow like this?
Tell me about it. Honest take and a rough price, usually within a day.
09 / 16
How do you trace the source down to the page?
For each piece of extracted content, store which document, version, page and section it comes from. An answer from the assistant should lead Iago to exactly the statement that was actually used.
Decide which page number the assistant gives. The third page of the PDF may carry the printed page number one. If the assistant says "page 47" and Iago looks at printed page 47, he may be looking in the wrong place. Where references mix up the two ways of counting, every check becomes unnecessarily tedious.
With a new edition of the manual, pages can move. An old reference must then not silently point to a different statement. Either the system resolves source and version together, meaning the right place in the right edition, or Iago gets a clear note that the cited version has since been replaced.
10 / 16
Which quality state does each document get?
Each document in the assistant should carry one of these quality states:
- fully reviewed
- usable with limitations
- unusable
For the old maintenance handbook, "limited" can mean that the running text is available but the spare parts table has not yet been approved. This state should affect which questions the assistant may answer. In this example, when asked for spare part numbers from this handbook, the assistant then refers to the original.
Decide who corrects a problematic page. The page can be scanned again, someone can enter the values by hand in a structured form, or the source stays out. A model must not fill gaps from neighbouring patterns and present them as original text.
Keep corrections traceable. Suppose Iago corrects a misread spare part number in which the OCR read a zero as an "O". That correction should be linked to the correct version of the handbook. Otherwise the next import may overwrite the correction or apply it to a source that has changed in the meantime.
11 / 16
Who may see the documents while they are processed?
A cloud service that extracts text from PDFs receives the content of the documents. So before the upload, check whether this environment and this processing are permitted for the source in question. A file that was only kept internally does not automatically become less sensitive because it was converted into text.
The text pieces, tables and images created from it need the same appropriate access restrictions as the original document. If the price list for service contracts is meant only for sales and customer service, the same applies to its text pieces in the assistant. Protecting the main collection helps little if extracted page images are freely accessible.
On top of that, besides subject text, a PDF can contain instructions aimed at the assistant. Extracting them does not give these instructions any right to control how the assistant behaves. The RAG security guide describes how to deal with manipulated sources.
12 / 16
What does preparation cost, including the second time?
Count how many pages you have, which file types, how often documents change and how many of them are difficult. The first import and regular reprocessing are two different cost blocks. If one paragraph in a manual changes, that should not necessarily require reprocessing the whole collection.
Include the work of people. Automatic extraction can look cheap while Iago spends a lot of time correcting one complex table. What counts is the effort until a piece of information is dependably usable, not just the price per processed page.
13 / 16
How do you evaluate original and output side by side?
Iago and an experienced technician first answer the collected questions themselves from the originals and then compare their answers with the assistant's. Every important statement should keep the same number, unit, limitation and validity as in the original. On purpose, they add questions that the available documents cannot answer. That shows you how the assistant reacts when it lacks the basis for an answer.
Also check three cases: a new version of a document, a deleted file, and a person whose read access was revoked. Everything created from them, meaning text pieces, tables and images, must be updated or removed accordingly. The fact that the PDF file is deleted does not on its own prove that its text pieces have left the search.
Only when this works is it worth improving the search further. The chunking guide describes where to split documents into sensible sections, and the RAG acceptance plan connects the quality of the preparation with the task the assistant actually has.
Keep a permanent collection of difficult pages for later updates of the extraction program. Include exactly the pages that failed before, together with the text and relationships that should come out. A new program should do better on these pages without getting worse on ordinary documents. This small collection can show you much more than a vendor demonstration with unrelated sample files.
For this acceptance, also record which parts of the documents stay explicitly excluded. At the conveyor manufacturer, these are for example handwritten notes in old maintenance logs that nobody has checked yet. Such unreviewed handwriting or a drawing should not look reliably processed just because of a general note that PDFs are supported. What you present to your team as possible must match what you have actually tested. If an exclusion affects a question, the assistant should say which evidence it is missing, instead of acting as if it had considered the whole file. That way Iago knows when he has to look in the original document himself.
14 / 16
For your IT team
Where available and useful, coordinates on the page can mark the exact region of a statement. The answer can then point straight to the excerpt.
If you normalize text for the search, for example by joining hyphenated words, keep the original representation or a traceable mapping to the original. That way a changed product code can be traced back.
For the search, smaller groups of table rows with the relevant headings repeated can help. When it comes to calculations, a validated structured representation that a deterministic program calculates over is often better suited.
Version the extraction method and its configuration. If an improved method recognizes tables differently, new text pieces (chunks) and new source references can result. Test the change against a fixed reference collection before you replace every document.
For access, pay particular attention to preview images, temporary files and review interfaces.
15 / 16
Take the worksheet
Worksheet
Download the editable CSV table
| Content | Preparation | Check |
|---|---|---|
| Text PDF | Text and headings | Reading order |
| Scan | OCR with page reference | Critical characters |
| Table | Rows, headers, units | Correct product/value relation |
| Footnote | Preserve qualification | Exception retrievable |
| Columns | Correct sequence | No mixed sentences |
Columns to fill in, in the file: Your value / observation, Owner, Next action.
Download the editable CSV table (CSV). Add your own values, owners and open actions. This worksheet contains no measured client results.
16 / 16
Related decisions
These modernagents guides cover related decisions about AI knowledge assistants:
- AI knowledge assistants: sources, access and answers
- Handle poor scans and handwriting in document capture
- Split RAG content without losing its meaning
- Diagnose wrong RAG answers and useful abstention
For a review of your workflow, start with a description of the task, the systems involved and typical exceptions. Discuss it with modernagents.



