Journal

How to Build an AI Customer Service Chatbot (Web & WhatsApp)

How to build an AI chatbot for customer service on your website, WhatsApp or WeChat: knowledge base, platforms, human handoff, costs, compliance and mistakes.

An AI chatbot for customer service is simple in principle: turn your product information, policies and FAQs into a knowledge base, connect it to a large language model and plug it into your website, WhatsApp or WeChat to answer customers around the clock in their own language. The hard part is making it accurate, knowing when to hand over to a person and staying within platform rules and data protection law. Here is how to build one, choose an approach and understand the costs.

Key takeaway

A reliable AI customer service chatbot needs a clean knowledge base, a narrow focus on your own business, a human handoff that is always available and a clear statement that it is AI. Start with one channel and one type of frequent question, then review conversations weekly. The choice of model matters less than any of these.

When an AI chatbot for customer service makes sense

An AI chatbot for customer service works best where questions repeat and the answers are already in your documents:

  • Pre-sales: specifications, minimum order quantities, payment and shipping options, answered from your own price lists and policies.
  • Orders and after-sales: returns, instructions and warranty terms, plus order and delivery status once it’s connected to your order system.
  • Several languages: exporters, online stores and businesses serving tourists, where customers ask in English, Spanish, Arabic or another language and get answers in that language from the same knowledge base.
  • Evenings and peak times: answering common questions and collecting requests and contact details for your team.

Anything that needs judgment or a commitment shouldn’t be left to AI alone: price negotiations, complaints and compensation, refunds and other actions that change data, and medical or legal advice. There, the chatbot can collect the details and hand a summary to a person.

How to build an AI chatbot for customer service in six steps

Building an AI customer service chatbot takes six steps: prepare the knowledge base, choose the model and platform, connect your channels, design the human handoff, test and launch, then keep improving it. The first two decide how accurate it is; the other four decide whether you can trust it with customers.

1. Prepare the knowledge base

Answer quality depends first on the knowledge base, because the chatbot should answer only from the material you give it. The usual technique is retrieval-augmented generation (RAG): the system retrieves the passages most relevant to the customer’s question and sends them, with the question, to the language model, which writes the answer. Dify’s documentation describes the process in these three steps.

For customer service, rewrite frequent questions as question-and-answer pairs, which are easier to retrieve than a full manual; remove outdated price lists and contradictions and give every document an owner; and keep a glossary of official translations for product names and policy terms, so the wording is consistent in every language. Our guide on how to build an AI knowledge base covers the full process.

2. Choose the model and the platform

The right model and platform depend on where your data can live, which systems you need to connect and who will maintain them:

  • Commercial model APIs (OpenAI, Anthropic’s Claude, Google’s Gemini and others): high quality, quick to start. OpenAI says data sent to its API has not been used for training since 1 March 2023 unless you opt in, and Anthropic says it doesn’t train on its commercial products’ inputs or outputs by default.
  • Self-hosted open models (such as DeepSeek or Qwen): the data stays on your servers, but you need hardware and someone to run it.
  • Builder platforms such as Dify configure knowledge bases and conversation flows visually. Dify is open source, self-hostable with Docker and also offered as a cloud service; its license adds conditions to Apache 2.0, such as no multi-tenant service without written permission. Our comparison of n8n, Dify and Coze covers the main builder platforms.
  • A fully custom build on a model API: the most flexible and the most expensive option.

3. Connect your channels

Each common channel connects differently. On your website, an embedded chat widget can be customized freely; keep it light, and if it sets non-essential cookies, get consent first in the EU. WhatsApp connects through the WhatsApp Business Platform, Meta’s business messaging API, directly or through a Solution Provider; our guide to WhatsApp AI agents for business compares the setup options. WeChat usually connects through WeChat Customer Service in WeCom, whose API sends messages and assigns conversations. WhatsApp and WeChat both limit automated replies and expect a route to a human, so read their rules before you build.

4. Design the human handoff

The handoff to a person is part of the design, not a patch. Hand over when the customer asks for a person, when the chatbot can’t find an answer, for complaints, refunds and legal or health questions, for large quotes and when the customer is clearly upset. Pass on a summary and what the customer has already said, so they don’t have to start again; outside business hours, say when a person will follow up. If you’re not ready for AI to reply directly, start with AI drafts that an agent approves.

5. Test and launch

Before going live, test with a few dozen to a hundred real questions from past conversations, in every language you serve, plus difficult ones: questions the knowledge base can’t answer, attempts to extract a discount or delivery promise, and requests to ignore its instructions or reveal its setup (prompt injection). Check accuracy, tone and whether it handed over when it should. Then launch on one channel or for one type of question, with a greeting that says it’s an AI assistant.

6. Keep improving

Launch is the beginning. Each week, review the conversations the chatbot couldn’t answer, those handed to a person and those with unhappy customers, and fix the knowledge base; update it whenever prices or policies change. Track the share of conversations resolved without a person, the handoff rate, first response time and customer satisfaction.

WhatsApp and WeChat: platform rules to check first

WhatsApp still allows businesses to use AI for customer service; what it restricts is general-purpose AI assistants. Section 4.7 of Meta’s terms for the WhatsApp Business Platform bars providers of large language models, generative AI platforms, general-purpose AI assistants and similar technologies from offering them on the platform when they are the “primary (rather than incidental or ancillary) functionality”, as determined by Meta. Read literally, a business using AI to answer questions about its own products and orders is using it as an ancillary function, but since Meta makes the call, keep your chatbot focused on your business. The restriction has applied since 15 January 2026; separately, on 9 June 2026 the European Commission imposed interim measures ordering Meta to restore free access for rival general-purpose AI assistants while its antitrust investigation continues.

The WhatsApp Business Messaging Policy adds three rules that shape an AI chatbot:

  • A customer’s message opens a 24-hour customer service window in which you can reply freely, including with automation; outside it, only approved message templates can be sent.
  • Automation requires “prompt, clear, and direct escalation paths”, such as an in-chat transfer to a human agent, a phone number, email or web support.
  • You need people’s opt-in before you message them.

Meta’s terms also say that if an AI company is your Solution Provider, WhatsApp data may not be used to train AI models, except to fine-tune a model for your exclusive use.

On WeChat, Customer Service can be reached from Official Accounts, Mini Programs, Channels, web pages and apps. Through the API, a conversation can be “handled by smart assistant” and then moved to the queue or to a named agent (documentation in Chinese), a natural AI-first, human-backup flow. After a customer writes, you can send at most five messages within 48 hours until they write again, so keep replies complete rather than splitting them up.

Build it yourself, use a SaaS tool or hire a team?

The best option depends on your volume of inquiries, number of channels, data requirements and in-house skills:

  • SaaS customer service tools with AI: fast to launch, monthly subscription, no servers. But your data lives with the vendor, integrations are limited to its connectors, pricing usually scales with seats or conversations, and switching means migrating data. Good for simple questions or a first trial.
  • Self-built (for example Dify plus a model API, or a self-hosted open model): you control data, flows and costs and can integrate deeply with your systems, but someone must deploy, monitor, update and secure it. Good if you have a technical team or sensitive data.
  • Hiring a team: an external team prepares the knowledge base, builds and connects everything and trains your staff, then hands over or maintains it. The contract should say who owns the code, accounts and data.

Either way, keep the WhatsApp Business account, model API accounts, servers and domain in your company’s name.

What an AI chatbot costs: the components

The cost of an AI customer service chatbot is a one-off setup cost plus running costs, which depend on your channels, volume and integrations.

  • Setup: preparing the knowledge base (often underestimated), building the conversation flows, connecting channels and systems such as your CRM, testing and staff training.
  • Model usage: commercial APIs usually charge per amount of text processed (tokens), so the bill follows conversation volume; self-hosting turns this into server and compute cost.
  • Platform subscription or hosting.
  • Messaging fees: on WhatsApp, Meta charges per message, with rates by country. Marketing templates are charged per message, and from 1 October 2026 service messages inside the customer service window are charged per message as well.
  • Maintenance: knowledge base updates, conversation reviews, upgrades and security patches.

When comparing quotes, check what’s included and who pays usage and messaging fees.

Data protection and compliance

An AI chatbot handles personal data, so four things must be in place before launch:

  • Tell customers they’re talking to AI. Article 50 of the EU AI Act requires providers to ensure that AI systems interacting directly with people inform them they are dealing with AI, unless that’s obvious, at the latest at the first interaction; it applies from 2 August 2026. A business that has an AI system developed and puts it into service under its own name counts as a “provider”. A greeting such as “I’m [company]’s AI assistant” solves it; China has its own labeling rules for users there. Separately, Article 4 of the same act requires businesses that provide or use AI systems to take measures supporting their staff’s AI literacy, as our guide to EU AI Act Article 4 explains.
  • Sign the right contracts. For EU customers’ data, you are usually the controller and your model and platform vendors are processors. Article 28 of the GDPR requires processors with sufficient guarantees and a contract; transfers outside the EU must meet Chapter V.
  • Know where the data lives. Decide where logs are stored, for how long and who can see them, and say so in your privacy policy; keep cost prices and staff details out of the knowledge base.
  • Limit what the AI can do. It can look up order status, but a person should approve refunds. Customers may try to trick it into revealing instructions or making promises, so enforce limits in the system, not just the prompt.

Common mistakes

When an AI chatbot underperforms, the cause is usually one of these, not the model:

  1. Uploading every file you have: outdated, contradictory documents make it inconsistent.
  2. Letting it chat about anything: this wastes usage fees, adds risk and, on WhatsApp, may run into Meta’s limits on general-purpose AI.
  3. Pretending to be human: it can breach EU transparency rules and costs trust.
  4. A handoff without context: customers who must repeat everything end up less happy than before.
  5. Letting AI make promises: discounts, delivery dates and compensation should come only from written policies.
  6. Nobody owning it after launch: prices change while the knowledge base doesn’t.

FAQ

How do you build an AI chatbot for customer service?

In six steps: turn your product information, policies and FAQs into a knowledge base; choose a commercial model API or a self-hosted open model, plus a builder platform such as Dify; connect your website, WhatsApp or WeChat; define when conversations go to a person; test with real questions and launch small; then review conversations weekly and update the knowledge base.

Can businesses still use AI chatbots on WhatsApp?

Yes. Since 15 January 2026, Meta’s terms restrict AI providers whose main offering is the AI itself, such as general-purpose assistants; a business using AI to answer questions about its own products and orders generally isn’t in that category. It must still follow WhatsApp’s messaging policy: automated replies within the 24-hour window, approved templates outside it and a clear way to reach a human.

How much does an AI chatbot for a website cost?

The cost of an AI chatbot is a one-off setup cost (knowledge base, configuration, integrations, testing, training) plus running costs (model usage or hosting, platform subscription, messaging fees on channels such as WhatsApp, maintenance). More channels, conversations and integrations cost more.

UsualMatrix builds AI customer service on your own knowledge base: we organize your documents and connect your website, WhatsApp, WeChat and other channels to a chatbot that answers customers in their own language and hands the conversation to your team when a person is needed. We work with businesses worldwide in Chinese, Spanish and English. See our AI solutions service or contact us to talk about your customer service.

Note: the information on WhatsApp’s platform terms, the EU AI Act and the GDPR is general information as of 1 October 2026, not legal advice. Terms and regulations change, so check the current official texts and confirm what applies to you with a lawyer or data protection specialist.

Next step

Want to put this to work in your business?

Tell us where you are and what you need, and we’ll come back with specific advice and a plan. Message us on WhatsApp or leave a note through the form; we work in Chinese, Spanish and English.

Chat on WhatsApp Leave a message
Related service AI Solutions

Let’s talk about your next project.

One message is all it takes. Tell us what you have in mind and we’ll come back with clear advice and a plan.