Guides7 min read

Knowledge Base Chatbot: How to Build One That Cites Sources

A knowledge base chatbot answers from your help center, docs and PDFs. How to write articles it can find, show sources and log what it can't answer.

A knowledge base chatbot answers visitor questions from the help articles, docs and files you already publish—not from guesswork. When you connect that chatbot knowledge base to your site, each reply can point to the passage it used so people can check it.

This guide is for teams running SaaS products, online stores, agencies, professional services firms and startups that want sourced answers without building a separate search product. The examples mention help centers and policy pages, but the same pattern applies wherever your answers already live in writing.

What a knowledge base chatbot is, and how it differs from a flow bot

A chatbot with a knowledge base connected to your content works like a librarian: it searches what you have written, pulls the passages that match the question, and composes a short answer from those passages only. An AI knowledge base chatbot built this way is not the same as a classic flow bot that walks visitors through fixed buttons and scripted branches.

Flow bots excel when every path is known in advance—onboarding checklists, warranty registration, simple triage. They struggle when visitors ask open-ended questions in their own words: “Do you ship to Norway?”, “Can I pause my subscription mid-cycle?”, or “Which plan includes SSO?” A knowledge base chatbot is built for that second kind of conversation.

Under the hood, modern assistants often use retrieval-augmented generation (RAG): retrieve relevant passages first, then generate an answer grounded in them. That separation is why you can update a help article today and see the change in tomorrow’s answers without retraining a model from scratch.

If you are comparing approaches for your marketing site, start with the idea of an AI chatbot for your website that reads your pages the way a careful visitor would—then adds citations and a fallback when the page does not exist yet.

How it finds the answer in your content

Visitors experience one chat box. Behind it, ChatWith indexes your connected sources into an AI chatbot knowledge base: passages from your website, help center, PDFs, documents and pasted text that the assistant can search.

Your articles become short passages

When a source is synced, its text is split into passages sized for search and quoting. Each passage keeps a link back to the page or file title it came from. That is what the assistant searches—not a single blob of text per site.

Questions are matched by meaning and by exact words

Most questions are matched by meaning: “cancel my account” should find your cancellation policy even if the article never uses that exact phrase. When semantic search returns fewer than three passages, ChatWith also runs an exact-word search so product names, plan names, SKUs and policy codes are not lost.

The reply uses only those passages and shows its source

The model is instructed to answer only from the passages retrieved for that turn. If nothing relevant is found, it does not invent an answer—it follows your fallback path instead. When it does answer, the widget can show up to two sources labeled From… with the title of the page or file, so visitors see where to verify.

For a longer explanation of indexing and daily re-sync, read what 'trained on your website' means in practice.

How to build a knowledge base for a chatbot

To create a knowledge base for a chatbot, you do not start by “writing for AI.” You start by making the help content you already owe your customers easy to find—then connect a custom knowledge base chatbot that searches it.

Start from the questions customers already ask

Pull ten questions from support tickets, sales calls, live chat logs and search queries on your site. Those questions are your first test set. If an article does not help answer one of them, the gap is in the article—not the bot.

One question per heading, answer in the first lines

Use headings that mirror real questions: “How do I change my billing email?” beats “Account management.” Put the direct answer in the first sentence under the heading so the passage the bot retrieves is already quotable.

Put prices and policies in plain text

Numbers, limits, regions and dates should appear as text on the page. Content trapped in screenshots, sliders or videos alone will not be searchable. A SaaS pricing table in HTML, a shipping table for your store, an agency statement of work PDF, a firm’s intake checklist, or a startup’s beta terms—all need readable text somewhere in your sources.

Which sources to add: website, public help center, PDF, documents and written text

In ChatWith you can connect:

  • Website — your marketing and policy pages, re-synced every day.
  • Help center — any public help URL; ChatWith crawls it like a website (there is no separate Zendesk or Intercom API integration).
  • PDF — brochures, specs or terms, up to 25 MB and 150 pages per file.
  • Document — .txt or .md uploads.
  • Write text — paste seasonal hours, promos or notes that are not on the site yet.

You do not need every type on day one. Connect the sources that already answer pre-sale and support questions, then expand.

Connecting your knowledge base to a chatbot

Once your sources are connected, visitors talk to one assistant backed by that knowledge. In ChatWith that means creating an assistant, adding sources from the knowledge screen, and publishing the widget.

Websites and help centers re-sync daily, so edits on live URLs flow in on the next scheduled sync. PDFs, uploaded documents and pasted text do not change on their own—remove the source and add it again when the file or text changes, then check a reply that depends on it.

Customization—welcome message, up to three suggested questions, fallback message, tone and appearance—happens in the assistant settings before you go live. For the install steps, follow how to add an AI assistant to your website.

When the knowledge base has no answer

Every team hits questions the docs do not cover yet. A knowledge base chatbot should make that visible instead of hiding it.

ChatWith shows the fallback message you write when retrieval finds nothing usable—name a real next step such as email, a form or a booking link. The conversation is marked needs review, your team gets an Unanswered question notice, and repeated gaps appear in Top unanswered questions so you can spot patterns.

When you want to offer human follow-up, lead capture on the Pro and Agency plans can ask for an email after an unanswered turn and save the transcript with the lead. That pattern—answer from content first, capture when the site cannot help—is covered in chatbot for lead generation. Honest fallbacks and weekly review habits are part of website chatbot best practices.

Large language models can confabulate—state false details confidently when they are not grounded in sources (NIST AI 600-1). Restricting answers to retrieved passages and refusing to guess is how you keep that risk down.

Keeping answers safe when your content is untrusted

Your help center is written by your team, but it can still contain user-generated snippets, embedded widgets or pasted third-party text. The assistant is instructed to treat indexed page content as untrusted reference material, not as instructions that can change its behavior. That mitigates indirect prompt injection called out in OWASP LLM01:2025.

Practical habits still matter: limit who can publish on the help site, review embedded HTML, and do not paste untrusted documents into sources without reading them. Security is a stack of small choices, not a single setting.

How to tell if it's working

After launch, use analytics and conversation review together:

  • Answered vs needs review — resolution in Analytics shows how many conversations ended with a sourced answer versus Needs review.
  • Top unanswered questions — the list tells you which new articles or sections to write.
  • Cited sources — open conversations and check that replies point at the pages you expect; fix the page when the citation is wrong.
  • Suggested questions — up to three prompts in the widget; tune them to the questions people actually tap.

Nielsen Norman Group’s AI chatbots design guidelines stress setting expectations, showing what the bot can do, and making handoffs to humans obvious—those ideas line up with sourced answers, visible fallbacks and suggested questions. For product-level details on plans and setup, see the ChatWith FAQ.

FAQ

What is a knowledge base in AI?

In AI products, a knowledge base is the collection of documents, pages and files a system is allowed to search when answering questions. For a website assistant, that means the sources you connect—your site, help center, PDFs, documents and pasted text—not the model’s general training data.

Does ChatGPT have a knowledge base?

ChatGPT can browse the web or use uploaded files in some modes, but it is a general assistant—not your company’s indexed help center. A knowledge base chatbot on your site is scoped to the sources you control, shows citations from those sources, and logs gaps in your own dashboard.

How do I create a knowledge base for a chatbot?

List the questions customers ask, write or fix articles that answer them in plain language, connect each relevant source in ChatWith, set a helpful fallback message, and test ten real questions before you promote the widget. Expand sources when unanswered questions show a pattern.

More guides

Give your website something useful to say.

Turn your existing knowledge into a better customer experience.

Plans from $29 a month · Change or cancel anytime