Publish your first AI chat assistant
Publish your first AI chat assistant: create a bot, train it with files or a web URL, allow your domain, style the widget, embed the script, and test it.
Quick answer: how do you publish an AI chat assistant on your website?
To publish an AI chat assistant, create a bot in AI Chat Assistant → My Bots, add at least one knowledge source such as a file or web URL, wait for indexing to complete, allow your exact website domain, copy the embed script, and paste it before the closing body tag of your site. Then test real questions.
The two most common launch blockers are a bot with no indexed knowledge and a website domain that is not in the allowed list.
What is an AI chat assistant?
An AI chat assistant is a chat widget on your website that answers visitor questions using knowledge you provide, such as documents and web pages. In K2Mailer, the AI Chat Assistant product lets you create bots, add knowledge sources, style the widget, review conversations, capture leads, and view analytics.
The bot answers from your indexed knowledge. When that knowledge does not support an answer, the widget shows the fallback message you configured instead of guessing.
Before you start
- An account with AI Chat Assistant access
- AI Chat Assistant has its own dashboard and its own 14-day trial. See the platform overview for how products and plans work.
- Knowledge to train the bot
- Supported files (PDF, DOCX, TXT, CSV, XLSX, and XLS) or a Web URL that contains the answers your visitors need.
- Access to your website code
- You need to paste one script before the closing body tag on the pages where the chat should appear.
- The exact website domain
- The widget only loads on domains you add to Allowed Domains.
Recommended flow
- 1
Create a bot with an internal name, widget display name, greeting, primary color, position, and fallback message.
- 2
Open Documents and upload a supported file or add a Web URL. Wait for its indexing status to become completed.
- 3
Open Settings and write the bot persona or operating rules. Configure lead capture only if you want visitor email addresses.
- 4
Open Widget, customize the visitor-facing text, disclaimer, support link, suggested questions, and allowed domains.
- 5
Open Embed, copy the script, and paste it immediately before the closing body tag on the approved site.
- 6
Test real questions, then inspect Conversations and Analytics for gaps or fallbacks.
Two common launch blockers
The widget needs at least one indexed knowledge source and the exact website domain must be allowed.
Step 1: Create the bot
For every field and for duplicating or deleting bots, see Create, duplicate, and manage chatbots.
- Bot name
- Internal dashboard name. Use a clear label such as Pricing Bot - Main Site.
- Widget display name
- Name shown to website visitors at the top of the chat.
- Greeting
- The first message visitors see in the chat widget.
- Primary color and position
- The initial widget appearance on your page.
- Fallback message
- Shown when indexed knowledge does not provide an answer.
Step 2: Train the bot with files or a web URL
Open Documents and add knowledge. Uploaded files support PDF, DOCX, TXT, CSV, XLSX, and XLS. After upload, the text is extracted, split into overlapping knowledge chunks, and indexed in a background queue. The status moves through pending or processing to completed or failed.
Wait for completed before testing. A failed source can be retried from the Documents screen while the retry limit allows it. Read the displayed error first. See Train a bot with uploaded files and Train a bot from a web URL.
Step 3: Set behavior, lead capture, and widget text
In Settings, write the persona and operating rules, for example the tone and what the bot should and should not answer. See AI bot persona and lead prompt setup.
In Widget, customize the visitor-facing text, disclaimer, support link, and suggested questions. Suggested questions help visitors start a conversation. See Customize the AI chat widget.
Lead capture is optional. Enable it only if you want to ask visitors for an email address, and set the visitor-message count that triggers the request.
Step 4: Allow your domain and embed the widget
Always copy the script from your own bot’s Embed screen. Each bot has its own public token. For more detail, see Install and secure the AI chat widget.
- 1
Add the exact website domain to Allowed Domains. Include a wildcard only when subdomains should also load the widget.
- 2
Open Embed and copy the script containing the bot public token.
- 3
Paste the script immediately before the closing body tag on the required pages.
- 4
Clear site and CDN caches, then test in a private browser window.
<script
src="https://app.k2mailer.com/widget/assistant.js?v=8"
data-bot="YOUR_BOT_PUBLIC_TOKEN"></script>Step 5: Test, review conversations, and improve
- Ask the real questions your visitors ask, not only questions you know the documents answer.
- Open Conversations to read what visitors asked and how the bot replied.
- Open Analytics to find questions that ended in the fallback message, then add or update knowledge.
- Re-sync web URL sources after the source page changes so answers stay current.
- Check AI leads and notifications if you enabled lead capture.
If the chat widget does not appear
- Confirm the bot is active.
- Confirm at least one file or URL has completed indexing.
- Confirm the page hostname matches an allowed domain.
- Check that a content-security policy is not blocking the widget script or API requests.
- Check the browser console and network panel for domain, token, CORS, or rate-limit errors.
Frequently asked questions
- How do I publish an AI chatbot on my website?
- Create a bot, add and index at least one knowledge source, allow your website domain, copy the embed script from the Embed screen, and paste it before the closing body tag of your site.
- What files can I use to train my chatbot?
- Supported uploads are PDF, DOCX, TXT, CSV, XLSX, and XLS. You can also add a Web URL as a knowledge source.
- How long does indexing take?
- Indexing runs in a background queue and moves from pending or processing to completed or failed. Wait for completed before you test the bot.
- Why does my chatbot show the fallback message?
- The fallback message appears when indexed knowledge does not support an answer. Add or update documents and URLs, wait for completed, and test again.
- Why is the chat widget not showing on my site?
- Check that the bot is active, a source finished indexing, the page hostname is an allowed domain, and no content-security policy blocks the widget script.
- Do I have to collect visitor emails?
- No. Lead capture is optional. Configure it only if you want the bot to ask visitors for an email address.
- Can I use the same embed script for every bot?
- No. Each bot has its own public token, so copy the script from that bot’s Embed screen.
- Where do I see what visitors asked?
- Open Conversations to read chats and Analytics to find gaps and fallback answers.
Was this guide enough?
Contact support if your screen or result is different.