Skip to main content

Whatsapp KA

How to Create a WhatsApp Knowledge Agent

Introduction

A WhatsApp Knowledge Agent is an AI-powered assistant that interacts with your customers directly on WhatsApp—the world's most popular messaging platform with over 3 billion users . It answers questions, provides support, and engages users using your knowledge base, all within the familiar WhatsApp interface.

This guide walks you through configuring a WhatsApp Knowledge Agent, including the critical WhatsApp Provider Data step that connects the agent to your WhatsApp Business Account via either Twilio or Meta (Cloud API) .

Before starting, ensure you have:

Step-by-step
  1. Create a KA Engine in AI Labs under Engines. Refer to the Engine Guide for detailed steps.

  2. Create a KA Collection in Collections. Refer to the Collection Guide for detailed steps.

  3. Ensure you have an approved WhatsApp Business Account from Meta.

  4. Obtain a dedicated phone number for WhatsApp Business, ensuring it is not linked to any existing personal WhatsApp account.

Step-by-Step: Creating a WhatsApp Knowledge Agent

Step 1: Access the New Agent Screen

  1. From the main navigation sidebar, click Agents .

  2. Click the blue + Create Agent button at the top left.

  3. In the Agent Type Library, locate the Knowledge Agent card and click it.

Step 2: Goal – Select Knowledge Agent

  • The Goal tab is now complete. You will automatically move to the Define tab.

Step 3: Define – Basic Setup

3.1. Agent Name

  • In the Agent name field, enter a descriptive name (e.g., "WhatsApp Support Agent" or "Event Inquiry Bot").

3.2. Knowledge Agent Type (Channel Selection)

  • You will see channel options: Website, Email, WhatsApp, Telegram.

  • Select WhatsApp . This configures the agent for WhatsApp messaging.

3.3. Select Language

  • Choose the primary language for your WhatsApp conversations (e.g., English).

WhatsApp KA right now only support "English". contact support for more info

3.4. Navigate to Design

  • Click Next to proceed to the Design tab.

Step 4: Design – Configuring the WhatsApp Agent

This is where you attach your Engine and Collection, and configure the WhatsApp connection.

4.1. Targeted Urls (Knowledge Base Selection)

Before configuring behavior, you must tell the agent what it should know.

  • Targeted Urls dropdown: Select the KA Collection you created earlier (e.g., "KA for BE website," "Product Documentation").

  • This collection contains all the content the AI will use to answer incoming WhatsApp messages.

  • you can select up to 3 collections for your agent

Important Collection Source

Your collection is the central reference for all content and interactions.
The Collection provides the factual knowledge your agent relies on. Without a selected collection, your agent has no information to answer questions.

Ensure you have created a KA Collection before proceeding. If no collections appear in the dropdown, go back and complete the Collection Creation Guide first.

See the KA Collection Creation Guide

4.2. Settings and Configuration

  • Select engine : Click the dropdown and choose the KA Engine you created earlier. This attaches the "brain" to your agent.

🧠 Important: Selecting Your Engine

The Engine defines your agent's personality—tone of voice, answer structure, intent detection, and fallback behavior. Choose the engine that matches the communication style you want for WhatsApp interactions.

See the KA Engine Creation Guide

Step 5: WhatsApp Provider Data – Connecting Your WhatsApp Account

This is the most critical step for WhatsApp Agents. You must configure how the agent connects to WhatsApp via either Twilio or Meta (Cloud API) .

5.1. Provider Selection

  • Click the Provider dropdown.

  • You will have two options:

    • Twilio – A global cloud communications platform that provides WhatsApp Business API access

    • Meta – Direct integration with Meta's WhatsApp Cloud API (hosted by Meta)

Choose the option that matches your setup.

5.2. Option A: Twilio Configuration

Best for: Businesses already using Twilio, developers seeking custom control, or teams needing flexible pricing .

What You Need to Find:

Field

Description

Where to Find It

Account SID

Your unique Twilio account identifier

Twilio Console Dashboard → Account SID (top of page)

Auth Token

Your secret authentication key

Twilio Console Dashboard → Auth Token (click to reveal)

Phone Number

Your WhatsApp-enabled phone number

Twilio Console → Messaging → Senders → WhatsApp senders → Edit sender

Step-by-Step: Finding Twilio Credentials

Step-by-step
  1. Log into `Twilio Console` by visiting twilio.com/console and signing in.

  2. Locate the `Account SID` and `Auth Token` on the main dashboard under the `Project Info Section`. Copy and securely store both.

  3. Find your WhatsApp-enabled phone number by navigating to `Messaging` → `Senders` → `WhatsApp senders`.

  4. For testing, use the `Sandbox environment`: Activate it under `Messaging` → `Try it out` → `WhatsApp`, to get a test number. For production, register your phone number via `WhatsApp Self Sign-up` and get approval from Meta.

  5. In `Bridged Media`, enter your credentials: Paste the `Account SID` (34-character string starting with 'AC'), `Auth Token`, and the full WhatsApp-enabled phone number (with country code, e.g. `+14155238886`).

Twilio Sandbox vs. Production
The Twilio Sandbox allows testing without full Meta approval

- You can only message users who have joined your sandbox by sending a join code
- The sandbox number displays the Twilio logo
- For production use, you must complete Meta approval and register your own number

Learn more: Twilio WhatsApp Documentation

5.3. Option B: Meta (Cloud API) Configuration

Best for: Businesses wanting direct integration with Meta, lower costs (no middleman), and full control .

What You Need to Find:

Field

Description

Where to Find It

Phone Number ID

ID for the specific phone number connected to WhatsApp Business API

Meta Developer Dashboard → WhatsApp → API Setup → "Phone number ID" field

WhatsApp Business Account ID

Your WABA identifier

Meta Developer Dashboard → WhatsApp → API Setup OR WhatsApp Manager → Account settings

Permanent Access Token

Long-lived authentication token (not the temporary token)

Meta Business Settings → System Users → Generate token

Step-by-Step: Setting Up Meta WhatsApp Cloud API

Phase 1: Create Meta App and Get IDs

Step-by-step
  1. Access Meta for Developers by visiting developers.facebook.com and log in with your Facebook or company account.

  2. Click My Apps and then Create App.

  3. Create a New App by selecting Other as the use case and Business as the app type. Enter an app name and click Create App.

  4. Add WhatsApp Product by locating the WhatsApp card on the app dashboard and clicking Set up. This action will link or create a WhatsApp Business Account (WABA).

  5. Find Your IDs in WhatsApp → API Setup. You will see Phone number ID and WhatsApp Business Account ID. Note: The initial test number shown is temporary and should not be used for production. Copy the WhatsApp Business Account ID.

Phase 2: Add and Verify Your Business Phone Number

  1. Add Phone Number:

    • Scroll down in API Setup and click Add phone number .

    • Enter your business details (name, email, website, country, timezone, category).

    • Enter the phone number you want to use for WhatsApp.

Important: Phone Number Requirements

- You cannot use a phone number already linked to a personal or business WhatsApp account unless you are ready to remove it from all devices .
- If the number is already active on WhatsApp, linking it here will disconnect it from your mobile device and convert it to a Cloud API number.
- Recommendation: Use a new phone number or a business landline dedicated to WhatsApp notifications .

  1. Verify the Number:

    • Choose verification method: SMS or Phone call.

    • Enter the code you receive to complete verification .

  2. Get Your Production Phone Number ID:

    • After verification, return to API Setup.

    • The "From" section should now display your verified number.

    • Copy the Phone number ID associated with this number .

Phase 3: Create a Permanent Access Token

The temporary token shown in API Setup expires after 24 hours. You need a permanent token for production .

Step-by-step
  1. Open Meta Business Settings by visiting business.facebook.com/settings

  2. Navigate to Users then System users

  3. Click Add and create a new system user with an Admin role

  4. Assign permissions under Add Assets; assign the Meta app to this system user

  5. Go to Accounts then WhatsApp accounts and assign the same system user with Full control

  6. Return to System users and click Generate new token

  7. Select your app from the dropdown

  8. Select the permissions whatsapp_business_messaging and whatsapp_business_management

  9. Click Generate token

  10. Copy the token immediately; Meta will never show it again

  11. Enter credentials in Bridged

  12. Paste Phone Number ID from your verified number

  13. Paste WhatsApp Business Account ID you copied earlier

  14. Paste the token you just generated

Step 6: Complete Design and Publish

After configuring the WhatsApp provider data:

  1. Review all settings.

  2. Click Next to proceed to the Publish tab.

6.2. Final Submission Options

  • Submit : Makes the agent live immediately or at the scheduled Go Live Date.

Click on submit button to complete the process.

How It Works: The WhatsApp Message Flow

  1. A customer sends a message to your WhatsApp Business number.

  2. The message routes through your provider (Twilio or Meta) to Bridged.

  3. Bridged's Knowledge Agent reads the message content.

  4. It searches the Collection for relevant information.

  5. It applies the Engine guidelines to formulate a response.

  6. The response is sent back through the provider to the customer on WhatsApp.

Important: WhatsApp's 24-Hour Rule

  • When a user messages you, a 24-hour customer service window opens .

  • Within this window, you can send free-form messages (no template required).

  • If you need to message a user outside this window (e.g., proactive notifications), you must use pre-approved message templates .

Troubleshooting & Common Issues

  • This error usually occurs due to an incorrect Account SID or Auth Token. Verify your credentials in the Twilio Console and ensure there are no extra spaces.

  • The error is likely due to an invalid or expired temporary token. If you are using a temporary token, generate a permanent system user token.

  • Messages may not be sending because the number is not WhatsApp-enabled or not approved. Verify the number is registered as a WhatsApp sender in the provider console.

  • Error 63015 indicates that you're trying to message a user outside the sandbox who hasn't joined. Users must send a join code first. For production, ensure proper registration.

  • Error 63018 occurs when the rate limit is exceeded, meaning you're sending too many messages per second. Implement queue logic or request a higher tier.

  • You can't send proactive messages outside the 24-hour window without an approved template. Create and submit message templates in the provider dashboard for Meta approval.

  • The phone number is linked to a personal WhatsApp account. Use a different number or deactivate it from the personal account first.

  • Templates are not approved because the content violates WhatsApp policies. Review the WhatsApp Business Policy and revise the templates.