An AI support chatbot trained on your docs and your code
Short answer. Most support chatbots are not trained at all: they search your content and answer from what they find. Crawling your docs is a good start, but docs describe features while customers ask about problems, and docs fall behind the product. What answers better is a knowledge base of short entries, each checked, built from your docs and code and grown from every chat your team answers, with the chatbot handing over when no entry covers the question.
"Train a chatbot on your data" usually means something simpler than training. The chatbot gets a search index of your content, looks up each question in it, and writes an answer from what it finds. That is the right design for support, because your content changes every week and every answer should be traceable to where it came from. The real question is what goes into that index.
Three ways to give a chatbot your knowledge
| Approach | Good at | Falls short |
|---|---|---|
| Crawl your site and docs | A fast start with what is already written | Long pages, written to explain features, not to answer the problem a customer has; goes stale as the product moves |
| Fine-tune a model on your content | Tone and style | Hard to update, can't show a source, still makes things up at the edges |
| A knowledge base of short checked entries | Precise answers with a source, easy to fix, grows from real questions | Needs a way to build it fast and keep it current |
The third is what works for support, and the work is in the "build it fast and keep it current" part.
Why your docs alone are not enough
Docs are organised by feature: here is billing, here is the API. Customers arrive with a problem: "my invoice shows the wrong company name", "why did my sync stop". Much of what support answers every week is not in the docs at all. It lives in old chats, in one person's head, or in the code.
So a support knowledge base should start from the docs and then grow from two other places: the answers your team gives in chats, and the code itself.
Building it from your code
For a software product, the code is the most accurate description of how things work. A coding agent such as Claude Code can read the code and write short entries from it, each pointing at the files it was written from. When those files change, the agent can find the entries the change affects and fix them.
On FanWake, a chat tool for creators, a Claude Code session wrote the support knowledge base from the product's own code and docs on 31 October 2026: 152 entries in 10 topics, reviewed and approved as one batch. Two weeks later it holds 164 checked entries, and 168 entries point at the code they were written from. The agent does that work on your machine, so the support tool never sees your code. How the connection works is in customer support from Claude Code over MCP.
Growing it from every chat
When the chatbot can't answer, a person does. That answer is the most valuable thing support produces, and in many setups it disappears when the chat closes. Keep it: when a chat closes, the new answer should become an entry in one click, so the next customer who asks gets it straight away.
The questions it couldn't answer are worth keeping too. Each one is a gap, recorded in the customer's own words, and a list of gaps is a to-do list for the knowledge base. On FanWake, 5 of the 8 chats the assistant handed over in its first week on its own were because no entry covered the question, and each became a gap to fill.
Keeping it true
- Show the source with every answer. A wrong answer is then one click from the entry that caused it, and fixed in one place for everyone.
- Mark what has been checked. Entries a person has verified, drafts nobody has checked yet, and entries that have gone stale are different things, and the chat should treat them differently.
- Merge duplicates. Two entries saying slightly different things about the same limit is how a chatbot ends up contradicting itself. On FanWake the agent merged 28 near duplicates in one batch.
- Decide what is public. Some entries belong on your help page, some only in answers, and some only for your team.
Setting it up in Afterchat
- Paste your site. It reads your pages and docs and turns them into entries, holding back anything about prices, limits or policy for you to check.
- Import your old chats, as a CSV or an export from Crisp, Intercom or Zendesk.
- Read the report: which of those chats it would have answered from your site and docs alone, and what customers kept asking for.
- Optionally connect your coding agent and run the vault prompt to write entries from your code.
- Add one script tag. It starts in Draft, so nothing reaches a customer without you.
Questions
Can I train an AI chatbot on my own documentation?
Yes, though in practice it is retrieval rather than training: the chatbot searches your documentation for each question and answers from what it finds. Fine-tuning a model on your docs is rarely the right tool for support, because the docs change and the model can't show where an answer came from.
How do I keep a support chatbot's answers up to date?
Keep the knowledge in short entries rather than long pages, show the source with every answer so wrong ones are easy to spot and fix, mark entries stale when the product changes, and save what your team answers in chats so the gaps close over time.
Does an AI support chatbot need access to my code?
Not to answer from your docs. A coding agent can read your code on your own machine and write knowledge base entries from it, so the support tool never sees the code itself.
What should the chatbot do when the answer isn't in the knowledge base?
Hand the conversation to a person, and record the question as a gap so someone answers it once for everyone who asks next.