How to prepare documents for an AI chatbot knowledge base
A seven-step guide to cleaning up PDFs, Word files and help articles so an AI chatbot finds the right passage and answers correctly.
By the Paperlink AI teamPublished 7 min read
Short answer
A chatbot answers from a few short passages, not from whole documents, so each passage must be findable, correct and complete on its own. Remove old and internal documents, use real headings, keep facts out of images, name the subject in every section and mark which version is current.
An AI chatbot that answers from your documents is only as good as the documents. It does not read a policy from start to end the way a new employee does. It searches for a few short passages that look relevant to the question and answers from those. So the work of preparing a knowledge base is mostly the work of making each passage findable, correct and complete on its own. This guide covers that work in seven steps.
How a chatbot reads a document
Most chatbots that answer from your own content follow the same pipeline:
- Extract the text from each file.
- Split the text into passages of a few hundred words, usually at headings.
- Index the passages, so they can be searched by meaning and by keywords.
- For each question, pick the best few passages and answer only from them.
Every problem in a document shows up at one of these steps. A scanned page has no text to extract. A document without headings splits in the wrong places. A passage that says "it costs $20" without saying what "it" is cannot be matched to the question. A price list from last year is found as easily as this year's.
Step 1: List what you have
Before you convert anything, make a list of every source that answers customer questions. Use one row per document, with these columns:
| Column | Why it matters |
|---|---|
| Document and format | Tells you which conversion step it needs |
| Owner | Someone must update it when the facts change |
| Last real change | Old documents are the main source of wrong answers |
| Audience | Customer-facing or internal. Internal notes rarely belong in a customer chatbot |
| Overlaps with | Two documents on the same topic will disagree one day |
Take the topics from real questions, not from your folder structure. Export a month of tickets or chats, group them by topic and check that each large group has a document that answers it. A topic with many tickets and no document is your first gap.
Step 2: Remove what the bot must not answer from
A chatbot will quote anything you give it. Leave these out:
- Internal notes, agent scripts and escalation rules that customers must not see.
- Old price lists, expired promotions and policies that a newer version replaced.
- Drafts and templates with placeholders such as [amount] or TBD.
- Contracts and legal templates that apply to one customer, not to everyone.
- Exact copies of the same content in two formats. Keep one.
Step 3: Fix the structure
Headings decide where a document splits into passages, so they matter more than anything else in the file. Use real heading styles, one topic per heading, and headings that name the topic: "Cancel a subscription" is better than "Section 4.2".
The fastest way to see the structure a chatbot gets is to convert the file to Markdown and read the result. Headings become lines that start with #, lists become dashes or numbers, and everything else is a paragraph.
- For a PDF, use PDF to Markdown. If the result is empty, the PDF is a scan and has no text layer.
- For a Word file, use Word to Markdown. A heading that comes out as bold text was formatted by hand, not with a heading style.
- For a saved web page or an export from an old help desk, use HTML to Markdown. It leaves out menus and footers, so you see the content only.
Keep facts out of images. A delivery zone map, a screenshot of a price table or a scanned form carries no text that a chatbot can search. Put the same facts in a text table next to the image.
Step 4: Make each passage stand on its own
A passage is read without the pages around it. Write each section so that it still makes sense when it is the only thing the bot sees:
- Name the subject. Write "The Team plan costs $20 per user per month", not "It costs $20".
- Keep the condition next to the rule. If a rule has an exception, put it in the same section, not three pages later.
- Use one name for one thing. If the product calls it a "workspace", do not call it an "account" in the help article.
- Write dates in full. "From 1 March 2027" can be checked. "From next month" is wrong a month later.
An example from a shipping policy. Before:
As mentioned above, these are waived for orders over the threshold, except for the regions listed in the appendix.
After:
Shipping is free for orders over $50. This does not apply to Alaska and Hawaii, where shipping costs $15.
The first version needs three other passages to make sense. The second answers "Is shipping free?" on its own. Paste a section into the readability checker to find the long sentences, because those are where conditions hide.
Step 5: Choose a format for each source
| Format | Good for | Check before you add it |
|---|---|---|
| Text-based PDF | Policies, manuals and documents that exist only as PDF | It has a text layer, one column if possible, no repeated cover pages |
| Scanned PDF | Nothing, until you export a text version | Export again from the source program, or retype it |
| Word (DOCX) | Documents your team edits often | Headings use heading styles, not bold text |
| Spreadsheet or CSV | Price lists, product specs, opening hours | One row per item and a header row with clear column names |
| Markdown or plain text | Help articles, FAQs and notes | Headings and lists are marked, not just typed |
| Public web pages | A help center or docs site | Import the site instead of saving pages one by one |
If you clean up a document in Markdown and want to publish it on your website or help center as well, convert it with Markdown to HTML. Then visitors, search engines and the chatbot all read the same corrected text.
Step 6: Decide which version wins
Every knowledge base ends up with two documents that disagree: last year's returns policy and this year's, or a general price list and a regional one. Decide the rule before it happens. The simplest rule is to replace the old file and keep only one version. When you must keep both, for example because the new policy starts on a future date, mark which one is current in the system you use.
How Paperlink AI handles these documents
Paperlink AI accepts PDF, DOCX, XLSX, HTML, CSV, TXT and Markdown, up to 25 MB per file, so you do not have to convert before you upload. It splits text into passages of about 400 tokens, respects headings and keeps tables whole. It has no OCR, so a scanned PDF fails with a message that asks for a text-based export. An upload with the same name becomes a new version, and a Supersedes link marks which document outranks another. The upload guide and the versions guide have the details.
Step 7: Test with real questions
Take 20 questions from real tickets and 10 that your documents do not answer. Ask all of them, and check each answer against the document it should come from. A wrong answer points to a document to fix: a missing fact, a passage that depends on another one, or an old version that still ranks. Our guide on stopping an AI chatbot from making up answers explains how to score the results.
Checklist
| Step | Done when |
|---|---|
| 1. Inventory | Every customer-facing source has an owner and a last-change date |
| 2. Remove | No internal notes, drafts, old prices or duplicates remain |
| 3. Structure | The Markdown preview of each file shows real headings |
| 4. Passages | Each section names its subject and keeps its conditions |
| 5. Format | No scans, no facts only in images, spreadsheets have header rows |
| 6. Versions | One current version per topic, or the newer one is marked |
| 7. Test | Your 30 test questions give correct answers or correct refusals |