Use Alibaba Cloud Model Studio and Chat App Message Service to build a WhatsApp AI assistant powered by your enterprise knowledge base for 24/7 intelligent customer service or sales guidance. This tutorial guides you through the no-code configuration process, from uploading a PDF/Excel knowledge base and creating a RAG application to integrating with your official WhatsApp account.
Related policies
Starting January 15, 2026, Meta will prohibit the deployment of General-Purpose AI Chatbots on the WhatsApp Business Platform (API). This policy applies to new API users starting October 15, 2025. For more details, see WhatsApp 2026 AI chatbot policy: Alibaba Cloud Chat App compliance guide.
Before you begin
Prepare your enterprise knowledge base files locally. The large language model application uses these files as its knowledge source. You can use unstructured data files, such as DOC, PDF, MD, and TXT files, or structured data files, such as XLSX and XLS files.
Enterprise knowledge base files:
File type | Description | Example |
Unstructured data file | Document-type files for systematic knowledge input. These files are complete documents, such as product manuals or user guides, that contain systematic knowledge. The system processes them to extract information, allowing users to query for details. Supported formats include DOC, PDF, MD, and TXT. | For example, a product document for Chat Flow describes it as a visual chat flow editing tool that allows you to define conversation flows by dragging and dropping functional components onto a canvas. Its features include channel expansion (supporting mainstream channels like Viber, Instagram, WhatsApp, and SMS), flow expansion (using conditional branching to deeply integrate with business systems), AI expansion (providing capabilities like language and phone number recognition), and marketing expansion (triggering campaigns based on user profiles and timing). |
Structured data file | Question-and-answer files for direct, specific responses. This format uses predefined question-and-answer pairs to answer specific questions directly. This targeted approach allows users to get answers quickly without reading entire documents, as the system uses these Q&A pairs to respond. Supported formats include XLSX and XLS. | Q&A files in Excel format are structured as follows: Column A contains the question, while Columns B, C, and D contain reply 1, reply 2, and reply 3, respectively. Each row corresponds to a single question and its multiple possible replies. |
Procedure
Step 1: Build an RAG application
For detailed steps, see Build a Q&A application with zero code.
You can replace the prompt designed in the first step with the following:
You are an expert on the ChatFlow product, specializing in answering customer questions about its features. Do not answer questions on any other topic.
Provide concise and accurate answers based on the knowledge base provided. Keep each response under 600 words and use emojis where appropriate to add a friendly tone.
Step 2: Configure the flow
Prerequisites
You have registered an Alibaba Cloud account, completed enterprise identity verification, and activated Chat App Message Service.
You have created and managed a WhatsApp channel.
You have registered and managed a WABA. The WABA is approved by WhatsApp, and the phone number is connected.
The CPaaS platform is ideal for service providers because it simplifies management and distribution. For more information, see CPaaS platform.
Chat App Message Service
In Chat App Message Service, use Chat Flow to enable multi-turn, intelligent conversations powered by a large language model.
Log on to the Chat App Message Service console. On the Chat Flow page, under View Template, select Multi-turn dialogue with large language models (LLM).
CPaaS platform
In the CPaaS platform, use Chat Flow to manage handoffs between automated intelligent responses and human agents.
Log on to the CPaaS console. On the Chat Flow page, under View Template, select Customer service with large language models and human agents.
The following steps are the same for both Chat App Message Service and the CPaaS platform:
On the Chat Flow canvas, find the Generate Reply from LLM by Previous User Input component.
In the Generate Reply from LLM by Previous User Input configuration pane on the right, set Implementation Type to Application. If you are using Alibaba Cloud Model Studio for the China site, set Protocol to Dashscope and enter your API key and application ID (appId). If you are using Alibaba Cloud Model Studio for the international site, set Protocol to Dashscope(International). Then, click Create Flow.
NoteTo obtain an API key, see Obtain an API Key.
To obtain an application ID, see Obtain an APP ID and Workspace ID.
Step 3: Publish the Chat Flow
After creating the Chat Flow, click Save and Publish, and then click Bind and Launch.
The Bind Channel Tip dialog box appears. This dialog box explains that a flow without a bound channel cannot be automatically triggered by incoming messages, but can still be called from other flows by using the flow forwarding component.
On the Bind WABA page, select your WhatsApp Business Account and phone number.
Your WhatsApp AI assistant is now live and ready to serve users.
The Chat Flow editor shows the conversation flow is published and online as Version 1. The workflow splits into two branches based on the
userReplyvariable: the Replied branch and the Not replied branch. The Replied branch contains a Check for Agent Transfer conditional node. If a transfer is needed, the flow jumps to a specified node. Otherwise, it executes the Send WhatsApp Typing Indicator and Generate Reply from LLM by Previous User Input nodes in sequence, which outputs theassistantOutputvariable. The flow then loops to send the LLM content and start the next conversation turn. The Not replied branch sends a timeout message. The side panel lists the available variables:incomingMessage,wabaId,wabaPhoneNumber,customerPhoneNumber,customerName, andincomingMessageType.