# Create a Basic AI Chatbot on WhatsApp which replies on our data

### Step 1: Start in the Bot Builder

* Access the bot builder and create a new bot.​

### Step 2: Configure Trigger and Conditions

* Set the trigger for the bot (e.g., hot keyword).​
* Define the channel (e.g., WhatsApp) and the necessary conditions for activation.​

### Step 3: Set Up the User Query Step

* Add a step to ask the user, “What is your query?”.​
* The next step should capture the user’s response to pass to the trained AI.​

### Step 4: Connect to Trained AI

* In the builder, create a new AI integration.​
* Go to your AI dashboard, copy the authentication token, and paste it into the bot builder.​
* After adding authentication, select the AI agent you want to use (e.g., Support Agent).​
* Choose all relevant files or leave the selection empty to use all agent files for response generation.​

### Step 5: Customize System Prompts and Replies

* Optionally, add a system prompt for specific fallback replies if the AI cannot answer the user’s query.​
* Your bot flow can also include parameters like contact number, channel name, or user name for personalization.​

### Step 6: Mapping AI Answers

* Map the AI’s answer to a “send message” block.​
* If no answer is available, configure a fallback message or route the conversation to a human agent.​
* Use error handling to define fallback actions if the AI is unavailable.​

### Step 7: Continue the Conversation

* Set up an “AI smart wait” step (e.g., 5 minutes) to wait for additional user replies.​
* If the user responds, pass the new query back to the AI agent; otherwise, end the session politely.​
* Implement exit keywords (e.g., “bye”) to close the conversation with an appropriate message.​

### Step 8: Test and Refine

* Test your bot’s flow and edit steps as needed for smooth conversation and accurate answers.​

This process will result in a WhatsApp-based AI chatbot that can reply intelligently to user questions based on your documents and data, and escalate the conversation to a human if needed.​

## Bot Flow Template Clone Link

```
/products/bot/flow/fc173d9d770af2f3c754c429c8d894fc
```

{% embed url="<https://youtu.be/xcv6aWqZ4W8>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://helpdocumentation.gitbook.io/user/ai-dashboard/create-a-basic-ai-chatbot-on-whatsapp-which-replies-on-our-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
