> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.chrisp.chat/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How can I create an AI Chatbot using ChatGPT?

****In this tutorial, you will learn how to connect ChatGPT with Crisp to create an AI chatbot that is trained on your own documentation, such as your sitemap, PDF, CSV, Word files and many other sources. New about ChatGPT? No problem, everything will be explained as it doesn't require any coding-skills nor any ChatGPT API Key.****

# What is ChatGPT? 🤔

[ChatGPT](https://chat.openai.com/) is a generative AI, created by OpenAI. ChatGPT leverages the power of Natural Language Processing (NLP), a subset of artificial intelligence, to allow chatbots to have a human-like conversation with real-humans. The AI model can answer many generic questions as it is trained on public data.

Bots created with ChatGPT can be integrated on any channel connected to Crisp, mobile application, Messenger, Instagram, WhatsApp, emails...

### 💡 Advantages of ChatGPT

The main advantage of chatGPT we're using here is the ability to access ChatGPT API, Plugins and Extensions, which are adding tons of possibilities on how you can use AI for your business.

If you want to know more about chatGPT extension and install some, you can click here: [ChatGPT Plugin Introduction](https://openai.com/blog/chatgpt-plugins)

# How to create an AI Agent using ChatGPT: the tutorial

### Create an account on Crisp

1. Go to [app.crisp.chat](https://app.crisp.chat) and create an account for free (you get 14 days of free trial that can be extended up to 30)
2. Install the chat widget on a test environment or initialize Crisp Helpdesk, from which the chat widget is automatically visible:

* [Click here to see how to install a chat widget](/en/article/how-to-add-a-live-chat-to-my-website-10wcj3l/)
* [Click here to see how to enable Crisp Helpdesk](/en/article/how-to-use-helpdesk-i2tsm1/)

# I. How to install and train my AI Agent?

__AI-powered features are__ ****available from the Essentials plan****__, check out our pricing page for more details.__

![Navigating to the Automation menu](https://storage.crisp.chat/users/helpdesk/website/-/a/b/e/7/abe77d1c06b84800/6f77a43f-c340-4c5e-96b8-8d8a94_zpi4im.png)

This menu allows you to train your AI on various types of resources:

1. ****Answer Snippets****: Short Q&As about common themes your customers frequently ask about.
2. ****Web Content****: Add all your web domains, which will be crawled and used to train MagicReply.
3. ****Knowledge Base Articles****: Your Knowledge Base articles are automatically fed to the AI and used when answering your users.
4. ****Inbox Messages****: Conversations between your team and your users.
5. ****Data Importer**** : upload files such as PDFs, CSVs, and .TXT

__Note that when using MagicReply in your automations (with the AI Chatbot), you'll not have to add your ChatGPT API key as it's hanlded by our own means.__

| For more information about MagicReply and its training, we have an [in-depth guide available on our Knowledge Base](/en/article/how-can-i-add-data-sources-to-my-magicreply-ai-ijkdrl/) .

# III. Building a custom AI Agent experience through ChatGPT

Let's now take a look at a few application examples of MagicReply to get a better grasp on how to connect it and handle various situations within your scenarios.

| To get started fast, leverage one of the pre-existing AI chatbot template to run your tests and see how the AI behaves with questions related to your business.

##### Use-case: Handling first questions from your users

This is a very popular usage of MagicReply. It allows you to integrate AI very early during the exchange, diminishing the workload on your support team and quickly providing assistance to your users. In this example, we are using button pickers to route users to different flows depending on their choices, this is [another very useful feature of the Bot plugin which is documented in this guide](/en/article/how-do-i-build-a-list-of-buttons-with-the-chatbot-1sgr9an/) .

![Handling first questions with AI](https://storage.crisp.chat/users/helpdesk/website/-/a/6/b/6/a6b6a64a74d70800/5cf26bf9-9ee7-49c7-a04a-a62001_15w1js1.png)

In this example, we start by detecting ****new user messages**** to trigger our Chatbot scenario. From there, we draw two branches for MagicReply: the first one to send the AI-generated response, and the second one to handle cases where the AI may not have found a relevant answer.

| The number `` `1` `` and `` `2` `` on these wires indicate the priority of these branches. This is the order in which branches will be evaluated by the Chatbot. Here it will first attempt to generate an answer, and fallback to the second branch if it is unsuccessful.

If an answer is generated and sent, we can then ****offer choices to our users thanks to button pickers action blocks**** to cover multiple potential intents from our users, and guide them towards a resolution.

In case the user wishes to ask another question, we use a [Proxy Block](https://help.crisp.chat/en/article/understanding-and-mastering-the-crisp-chatbot-1boypme/#3-copy-as-proxy) to redirect them back to our initial New User Message block, allowing them to restart the scenario.

⬇️ __If you would like to review this scenario directly, you can__ [_download our example right here_](https://drive.google.com/uc?export=download&id=12-uoS7lXh8RU708Dbh2okifGRKMHWj6q) __, and__ [_import it into your Bot plugin_](https://help.crisp.chat/en/article/getting-started-with-crisp-chatbot-hrmysb/#1-ii-creating-deleting-importing-amp-exporting-your-chatbot-scenarios) __to take a closer look on your end.__

# How to test the AI Chatbot before pushing to prod?

At that point, you're almost there. And it's vital you check how the bot behaves, and answers your key questions so you can refine AI's knowledge about your business.

The Scenario editor interface has an integrated menu to help you test your scenario directly, as covered earlier in this article. However, in some cases you may want to test it live if it contains advanced conditions, or if it is composed of several inter-connected individual scenarios.

A good way to test a scenario "live" without causing interference with your users, is to edit the terms detected by your initial "****User sent a message"**** Event block, and to temporarily make it detect a term only known by you (like a password).

![](https://storage.crisp.chat/users/helpdesk/website/-/3/d/5/3/3d5322b6913fca00/65ec323c-db35-4f6a-a4da-4da5c6_vis7jm.jpg)