How to Add an AI Chatbot to Your Website: 7 Simple Steps
Choose your pages, train the bot, check its answers, and add it to your site with one short script.
Kanha teamMar 2026Updated Sep 20265 min read
You want to add an AI chatbot to your website, but you do not want another long setup project. With Kanha, the hands-on setup is short: choose the right pages, review what the bot will learn, start training, test the answers, and paste the provided code into your site.
Training commonly takes 10 to 30 minutes for typical jobs, depending on the content and model size. It runs in the background, so you can leave the dashboard and return later.
Follow these steps to get a useful first version without skipping the checks that protect your visitors.
1. Choose the answers your visitors need
Start with the pages that answer real customer questions. Product docs, setup guides, shipping and return policies, help articles, and FAQs are good candidates.
Leave out duplicate archives, outdated announcements, account pages, and anything a public chatbot should not repeat. If your goal is full help-center coverage, include the complete set of relevant pages. For a smaller first bot, choose a clear section that you can test well.
The Free plan includes 50 pages total and one training run. Starter includes 500 pages and three runs per month. New crawls and recrawls both count toward the page limit, so check the current pricing page before adding a large sitemap.
2. Add your site and crawl the pages
Create an account, open Sites, and add the domain that contains your content. Add a sitemap for a well-organized section or choose individual URLs when you want tighter control.
Kanha can follow sitemap indexes and process pages whose useful text is added with JavaScript. The sites and pages guide explains the available crawl options and page states.
Crawling happens on Kanha infrastructure. Kanha fetches the selected pages, cleans the text, and turns it into question-and-answer examples for training. The later browser-based answers do not mean crawling or training happens on the visitor's device.
When the crawl finishes, check a few important pages. Pricing, policy, security, and technical pages deserve extra attention because one missing condition can change an answer.
3. Review what the bot will learn
Open Datasets, choose the site, and select the pages to include. Kanha collects the generated question-and-answer examples into a training set.
Review those examples before training. Remove anything stale, unclear, irrelevant, or wrong. Check answers about refunds, eligibility, plan limits, compatibility, and other topics where visitors need precise wording.
This step matters. Training cannot fix a bad source or an incorrect example. The dataset guide explains page selection, exclusions, versions, and downloads.
4. Create the bot and pick a size
Open Bots, create a bot, and connect it to the site and training set. Give it a simple instruction that says who it represents, what it should answer, and what to do when the content does not support an answer.
Then choose the model size you want to train. Smaller models need fewer device resources. Larger models need more. All sizes are available on every plan, but the best choice is the smallest one that answers your important questions well on the devices your visitors use.
Each size creates a separate training job and model. The public install code names one exact size. It does not check a visitor's memory and choose Small, Medium, or Large automatically. If you train several sizes, you can compare them, but the generated public install still uses the one model you selected.
Start training and follow the status in the dashboard. The training guide explains sizes, status, quotas, and retraining.
5. Try to break the answers
When the bot is ready, ask questions from real support conversations. Include simple questions, different ways of asking the same thing, follow-ups, and questions your site does not answer.
Read every important answer yourself. Look for missing exceptions, mixed-up policies, invented details, and confident answers where the bot should say it does not know.
If an answer is poor, check the source page and training examples. Fix the problem, create a new version, and train again. A vague instruction cannot make unreliable source material safe.
If your content changes often or every answer needs a source link, compare this approach with RAG, which looks up source text for each question. The RAG vs fine-tuning guide will help you choose.
6. Add the chatbot to your site
Copy the model URL from the bot's integration details. The current script looks like this:
<div id="chat"></div>
<script type="module">
import { mount } from 'https://cdn.jsdelivr.net/npm/kanha-ai/dist/widget.js';
mount('#chat', {
modelUrl: 'YOUR_MODEL_URL',
modelSize: 'small',
systemPrompt: 'You are a helpful assistant for...',
botName: 'My Bot'
});
</script>
Replace YOUR_MODEL_URL with the value shown for your trained model. Keep modelSize: 'small' aligned with the model you intend to load.
If your site uses React or a Web Component, copy the maintained example from the integration guide. It is safer than adapting an old snippet.
The chat code downloads and prepares the model in the visitor's browser. When an answer runs there, Kanha does not add a per-message charge for that answer. Browsers and devices differ, so the path and performance can vary. When an environment needs compatibility work, Kanha takes responsibility for it.
7. Test what visitors will experience
Open the installed chatbot on the browsers and devices your audience actually uses. Test a first visit with no cached model files and a return visit with the files already available. The first one shows download and preparation time. The second shows the likely repeat experience.
Do not promise offline use. Browser storage can be cleared, and the page, chat code, or model files may still need the network.
Use the on-device speed guide to record useful measurements. Read the privacy guide to understand which steps use Kanha infrastructure and which messages can be answered locally.
Finally, save the questions you used. When an important page changes, recrawl it, review the new examples, train again, and repeat the same tests. That gives you a manageable routine for keeping the chatbot useful.
