Preparing your documents for AI

Last updated

Whether you upload files to a chat assistant or build a full retrieval system, the quality of AI answers depends heavily on the quality of the documents behind them. Outdated policies, duplicate files, scanned images with no text, and tables that fall apart when converted all lead to wrong or confusing answers. A little preparation goes a long way. This article covers the practical steps.

Start with an inventory

Before preparing anything, figure out what you have and what the AI actually needs:

  • List the sources: help articles, policies, manuals, product sheets, FAQs, procedures, contracts, emails, shared drives, and websites.
  • Identify the use case: what questions should the AI answer, and for whom? This tells you which documents matter.
  • Find the owner of each document set, who can confirm what is current and correct.

Resist the urge to include everything. More content is not better if much of it is outdated or irrelevant. Focused, accurate content beats a large, messy archive.

Clean up the content

Remove outdated and duplicate material

Old versions of policies and price lists are one of the most common causes of wrong answers. If two documents disagree, the AI may use either one. Archive or delete superseded versions, and keep one authoritative copy of each.

Resolve contradictions

If different documents give different answers to the same question, decide which is right and fix the others. The AI cannot resolve conflicts that people have not.

Fill gaps

Look at the questions people actually ask, such as support tickets, emails, and calls, and check whether your documents answer them. If not, write the missing content. An AI cannot answer from information that does not exist.

Write clearly

Content that is clear for people is clear for AI. Use plain language, define acronyms and internal jargon, and state things explicitly rather than relying on context a newcomer would not have.

Use AI-friendly formats

Prefer real text

Text-based formats such as web pages, Markdown, word processing documents, and text-based PDFs work best. Scanned PDFs and images contain pictures of text, not text. Run them through optical character recognition first, then check the results, since errors are common with poor scans, handwriting, and unusual layouts.

Be careful with tables

Tables often lose their structure when converted to text, so a row's values can end up separated from their column headers. Options include keeping tables simple, converting complex tables into short sentences or lists, or using tools that preserve table structure. Test how your system handles your most important tables.

Watch out for complex layouts

Multi-column layouts, sidebars, headers, footers, and text boxes can get jumbled during conversion. Check the extracted text of important documents to make sure it reads in the right order.

Describe images and diagrams

If important information appears only in an image, chart, or diagram, add a text description. Some systems can interpret images, but text is more reliable for retrieval.

Structure for retrieval

RAG systems split documents into chunks and retrieve the most relevant ones. Structure makes that work much better.

Use clear, descriptive headings

Headings help chunking tools split content at natural boundaries and give each chunk context. "Returns for sale items" is more useful than "Section 4.2."

Keep sections self-contained

Each section should make sense on its own, because it may be retrieved without the surrounding text. Avoid phrases like "as mentioned above" for essential details; restate key facts where needed.

One topic per section

A section that covers returns, shipping, and warranties together produces a blurry chunk that matches all three topics poorly. Separate topics into their own sections.

Put key facts in plain sentences

"Sale items can be returned within 14 days of delivery for store credit" is easy to retrieve and quote. The same rule buried in a long paragraph of exceptions is not.

Add metadata

Metadata is information about each document that helps the system filter and present results:

  • Title and source location.
  • Date last updated, so the system can prefer recent content and you can spot stale material.
  • Owner, who is responsible for keeping it current.
  • Category or department.
  • Audience or access level, such as public, staff only, or managers only.
  • Product, location, or region, if answers differ.

Access-level metadata is especially important. It allows the system to show each person only the content they are permitted to see.

Handle sensitive information

Before adding documents to any AI system, check for:

Remove what is not needed, restrict access to what is, and make sure the AI provider's terms or your hosting setup are appropriate for the remaining content. See What you should not paste into an AI tool and Will an AI provider train on your data?

Also consider whether any documents come from outside sources, such as customer submissions or web pages. They could contain hidden instructions. See Prompt injection explained.

Test with real questions

Build a set of real questions with known correct answers, including:

  • Common questions.
  • Questions whose answers appear in tables or unusual formats.
  • Questions that require combining information from two documents.
  • Questions the documents do not answer, to confirm the AI says so instead of guessing.

Run them after setup and after any significant content change. When answers are wrong, check whether the problem is the content, the conversion, the chunking, or the retrieval, and fix the source where possible.

Keep it current

Document preparation is not a one-time project:

  • Assign owners for each content area.
  • Update the knowledge base whenever policies, prices, or products change, ideally as part of the same process that changes them.
  • Remove retired content promptly.
  • Review periodically for stale material, using last-updated dates.
  • Watch for unanswered questions in AI logs or feedback, and add content to fill gaps.

A quick checklist

  • Do we know which documents the AI needs for its purpose?
  • Have we removed outdated, duplicate, and contradictory content?
  • Are documents in real text, with tables and layouts checked?
  • Do documents have clear headings and self-contained sections?
  • Is metadata, including dates, owners, and access levels, in place?
  • Have we removed or restricted sensitive information?
  • Have we tested with real questions, including unanswerable ones?
  • Is someone responsible for keeping each area current?

Key takeaways

  • AI answers are only as good as the documents behind them.
  • Remove outdated, duplicate, and contradictory content before anything else.
  • Use real text, check tables and layouts, and describe important images.
  • Structure content with clear headings and self-contained, single-topic sections.
  • Add metadata, protect sensitive information, test with real questions, and keep content current.