> For the complete documentation index, see [llms.txt](https://docs.kuasa.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kuasa.io/reach-customers/setup-ai-chatbot.md).

# Setup AI Chatbot

#### AI Chatbot Setup Prerequisites

Before setting up the AI Chatbot, please ensure you have completed the following:

1. Register and connect your **WhatsApp Coexistence** account in Kuasa. [(Tutorial)](https://docs.kuasa.io/reach-customers/setup-whatsapp-official-coexistence-plugin)
2. Create an **OpenAI account** & **API Key**. [(Tutorial)](https://tutorials.kuasa.io/getting-started/kuasa-campaigns/ai-chatbot/setup-ai-chatbot/create-api-key-in-openai)

#### AI Chatbot Configuration

1\. Log in to your account.

2\. Go to the **AI Chatbot** section from the left sidebar.

<figure><img src="/files/iAxLbD0wYTylsoGRBpVp" alt=""><figcaption></figcaption></figure>

3\. Click **+ Create New AI Chatbot** at the top right corner.

<figure><img src="/files/9m4QHHQajvDShtTx6dhS" alt=""><figcaption></figcaption></figure>

4\. Set up the details below:

* <mark style="color:purple;">**AI Chatbot Name**</mark>
* <mark style="color:purple;">**Client Account**</mark>: Make sure the selected client account has an active WhatsApp CoEx connection.
* <mark style="color:purple;">**Whatsapp Business Account**</mark>: Tick the WhatsApp Business Account you want to use.
* <mark style="color:purple;">**AI Chatbot Status**</mark>**:** Enable AI Response if you want the chatbot to start replying immediately. You can also enable it later

<figure><img src="/files/DZSknfnT2IkrcnX0tHdn" alt=""><figcaption></figcaption></figure>

5. Set up the details below:

* <mark style="color:purple;">**OpenAI API Key**</mark>: You may click **Test OpenAI Connection** to verify that the API key is valid
* <mark style="color:purple;">**AI Model**</mark>: We recommend **GPT-4o Mini** for a cost-effective setup.
* <mark style="color:purple;">**System Prompt**</mark>: Enter your prompt in the field.
* <mark style="color:purple;">**AI Budget**</mark>: We recommend setting a budget limit to avoid unexpected usage costs.

<figure><img src="/files/0Tuvc57GDS5XOnlNGGNz" alt=""><figcaption></figcaption></figure>

6. Set up the details below:

* <mark style="color:purple;">**Keyword Takeover**</mark>: Keyword that you can send in whatsapp to On/Off AI Chatbot Status
* <mark style="color:purple;">**AI Reply Buffer**</mark>**:** Set the response delay time

7. Once completed, click **Next → Knowledge Base.**

<figure><img src="/files/gPXFucJ0oDlL3Zm6Vthx" alt=""><figcaption></figcaption></figure>

#### Add Knowledge Base Entries

In the **Knowledge Base Entries** section, you can add information such as text, website URLs, images, documents, and videos.

1. Click **+ Add Q\&A Pair**.

<figure><img src="/files/d4wY4ElTrogRLTI1m3wc" alt=""><figcaption></figcaption></figure>

2. Select a **Category.**
3. Enter the **Question**.
4. Choose an **Answer Source**.

**A) Manual Text**

* Enter the answer manually.
* You may also attach media files such as: Images, Documents, or Videos

<mark style="color:$danger;">Note:</mark>

<mark style="color:$danger;">Media Attachments are only used when the AI needs to send a file to customers. The AI cannot read or understand the content of uploaded files.</mark>

<figure><img src="/files/gB93Y7ItbYCsH7Fp5GZv" alt=""><figcaption></figcaption></figure>

\
**B) Fetch URL**

* Enter the website URL and click **Preview**.
* The AI will fetch information from the webpage automatically.
* The AI can only fetch content that is publicly accessible and available on the URL page.
* After the content is fetched, you may review, edit, or remove any information before saving.

<figure><img src="/files/zcQHOzTYy57pnbpnwTDw" alt=""><figcaption></figcaption></figure>

5. After completing all settings, click **Save & Finish**.

<figure><img src="/files/la5223Mei9w0w4xLhnGB" alt=""><figcaption></figcaption></figure>

**Important**

Always clear the AI Memory after updating or editing your Prompt or Knowledge Base.

1. Click the **Chat** icon.
2. Click **Clear AI Memory**.

You can enable or disable the AI Chatbot at any time by toggling the **Status** switch ON or OFF.

<figure><img src="/files/mN1zeVuTTtRDc3I1x24B" alt=""><figcaption></figcaption></figure>

<br>
