A Step-by-Step Guide on How to Build an AI Chatbot

Maxwell Timothy

Maxwell Timothy

on Jan 29, 2024

11 min read

As AI technology continues to advance, AI-powered chatbots are becoming incredibly useful for automating conversations and completing a wide range of tasks. From personal applications to business use cases, AI chatbots are rapidly becoming indispensable tools.

With increased usefulness comes heightened interest, and with heightened interest comes a common question: how can you build an AI chatbot of your own?

Follow along step-by-step as we bring an intelligent AI chatbot to life. Let's walk through the process of creating your first AI chatbot step-by-step, without writing a single line of code.

Step 1: Decide What You Want to Do with the Chatbot

Of course, before you set out to create your first AI chatbot, you need to nail down exactly what you want to do with it and the day-to-day tasks the chatbot will complete. The more specific you are, the better you’ll be able to understand exactly what your chatbot needs to be able to do what you want it to do. Ask detailed questions like:

  • What core user needs will this chatbot address? Do you want to deploy it as a personal knowledge base? Or will it provide customer service, user onboarding, or maybe be used as a lead generation tool?
  • What platforms will it be deployed on? Website, app, or messaging platforms like Slack?
  • Will it involve heavy conversations with humans or mainly automate tasks?
  • What types of conversations will it have? Sales, support, reservations?
  • How will it retrieve and utilize data? Will it use only its initial training data or will it integrate with databases to get data in real time?
  • What volume of interactions do you expect it to handle daily? Hundreds, thousands?
  • What integrations does it need to work with existing systems? APIs, logins, payment processors?

Having granular answers to these types of questions will provide the clarity you need to build an optimized chatbot that delivers your most important business objectives. The more detailed your vision, the better the development outcome.

For our demonstration, we’ll be creating a chatbot to solve a real-world problem: helping people seeking admission find the right information and move quickly through the application process. The chatbot will be deployed on the website of a university and should be:

  • Available 24/7 to answer common application and enrolment questions
  • Provide information on application status and decision timelines
  • Explain admission requirements, documents, and deadlines
  • Guide on choosing academic programs and majors
  • Assist with transcript requests, test scores, letters of recommendation
  • Answer questions about acceptance, waitlists, deferrals
  • Help complete application forms and submissions

We are quite clear with our objectives and will now proceed to the next step and can now proceed to the next step.

Step 2: Decide Which Chatbot Platform to Use

With a clear understanding of our chatbot's capabilities, we can now select the ideal platform that will enable us to build it. There are numerous chatbot platforms available, each with its own set of features and functionalities. When evaluating the options, we should match the platforms' strengths to our chatbot's intended purpose and required functionality. The core day-to-day functions of our chatbot will be to answer common application and enrolment questions. Considering this, we need a chatbot platform that:

  • Should have a way to train it with our data, this will help the chatbot about the university and the application process
  • Understand and respond to questions asked in a natural conversational manner
  • Track and analyze how people interact with the chatbot–the platform should have tools to understand chatbot usage patterns and performance.
  • Work seamlessly as a chatbot interface on websites–it should also allow deploying the same chatbot on channels like mobile apps and messaging platforms so we can reach potential users

With this in mind, we can either build our chatbot using an existing chatbot platform or create our chatbot from scratch. It’s easier to create our chatbot using a chatbot platform because it will help us focus on the chatbot functionality and avoid having to worry about the back-end infrastructure. And it will save us a lot of time and effort. Chatbase is a chatbot development platform that has all the necessary features we need to build our chatbot. It has all the functionalities that we need to implement our chatbot features and allows us to train the chatbot with our data.

Step 3: Setting Up the AI Chatbot

Now that we've settled for Chatbase as our preferred chatbot platform, it's time to start setting up the chatbot itself. Fortunately, setting up an AI chatbot on Chatbase is quite easy.

1. To begin, head over to Chatbase.co and sign up for an account.

2. Once you've signed up and logged in, you should be redirected to the chatbot creation page.

3. Click on New Chatbot to create a new chatbot.

[object Object]

4. Now, on the next page, you’ll find an option to upload files to train your chatbot with, skip this for now. Instead, click on Text on the left sidebar and type in a placeholder text. You can type in a description of what your chatbot does. We will come back to this later.

[object Object]

5. Once you're done, click on Create Chatbot on the right side of the page.

6. A live preview page for your chatbot should come up. Tap the Settings tab on the top of the page and provide a name for your chatbot in the Name field and click Save.

[object Object]

7. Now, on the Settings page, click on Model on the left sidebar, scroll down, and edit the instruction field. Remove the default instructions and add your own instructions. For this example, we used: "Your name is NawBot and you'll answer questions on any subject."

7. Now, click Chatbot on the top of the page to return to the live preview of your chatbot.

[object Object]

8. Type in a question to test the general knowledge proficiency of the AI chatbot. You can ask it any question you'd typically ask the likes of ChatGPT or Google's Bard.

[object Object]

If your questions are answered correctly, it means your AI chatbot is ready to start answering questions. You now have your own ChatGPT type of AI chatbot. Yes, it is as simple as that. But can we add it to our university website now? No, not yet.

Step 4: Train Your AI Chatbot

The chatbot we created in step 3 above has a general proficiency in a lot of fields as well as the foundational natural language processing abilities it needs to answer questions correctly and conversationally. However, on its own, the chatbot lacks any specific knowledge about the application process it's meant to guide users through. To enable our chatbot to actually answer questions and assist applicants, we need to provide it with the relevant data and logic particular to this use case. This includes details like application requirements, deadlines, fees, and step-by-step instructions for completing each part of the process.

Essentially, we must expand the chatbot's knowledge beyond general language proficiency, into the domain-specific information and reasoning required for it to offer useful application guidance. This domain training will build on the natural language foundations we've already established, bringing our conversational agent closer to being ready for deployment.

To train our chatbot, we need to first source the relevant domain data. For our example use case, we can use existing data from the university website and other relevant documents to build a training dataset.

To do this:

1. On the chatbot live preview page, click on Sources at the top of the page. This should reveal the chatbot training interface we skipped earlier.

2. Gather all the files (PDFs, text files, etc) that contain every relevant information you want the chatbot to have and upload it to the chatbot trainer using the file upload widget on the page.

[object Object]

3. After you upload all the files, click Retrain Chatbot to train the chatbot with the collated data. Once the training process is completed, you should be redirected to the chatbot's live preview page.

4. You can now ask questions that are related to the specific subjects you trained the chatbots on. In our case, it is now able to answer questions about the admission process for the hypothetical New Age World University.

[object Object]

Ask as many relevant questions as you have to test how good your new chatbot really is. Once you're done asking the questions, it is time to put some finishing touches on the chatbot.

Step 5: Put the Finishing Touches

If you've gotten to this stage, your chatbot is likely able to answer questions related to the topics you trained it on. However, there are a few finishing touches you need to give the chatbot to make sure you get the best results from it. To do this:

1. On the live preview page, click on Settings at the top of the page to open the settings page.

2. On the settings page, click on Model on the left sidebar.

3. Scroll down to the instructions field and provide a custom instruction that you want your chatbot to follow. Ideally, provide instructions on how you want your chatbot to behave. If you are not sure of what to use, you can hit the Reset button to restore to the default instructions.

4. Scroll down further and change the default AI model from GPT 3.5-turbo to GPT-4. You can also adjust the temperature of the chatbot to tweak the creativity of the response using the slider.

[object Object]

5. Once you're done, click Save below the page, and then click on Chat Interface on the left sidebar of the page.

6. On the Chat Interface page, you'll be able to customize how you want the chatbot to appear on your website when you deploy it. Carefully go through the options and tweak the colors and default messages to suit your taste. You should see a live preview of how the chatbot will appear on the right side of the page.

Step 6: Deploy Your Chatbot

Once you've customized your chatbot to suit your taste, it's now time to prep it for deployment. With Chatbase chatbots, you have several options for deployment. You can deploy it on your website, Slack, Zapier, WhatsApp, and other channels. Our goal for this demonstration was to deploy it on a university website. So, to do so:

1. From the Chat Interface page, click Embed on site at the top of the page and then click Make Public on the modal that comes up.

[object Object]

2. After clicking "Make Public," you'll be given a snippet of code. This is the HTML/JavaScript code that you'll need to insert into your website. Copy this code.

[object Object]

3. Access the backend of your website where you can edit the HTML code. This might be through a content management system (CMS) like WordPress, or directly editing the website's HTML files.

4. Find the section of your website where you want the chatbot to appear. Paste the copied code snippet into the HTML of your website in the chosen location. If you're not familiar with HTML or the website's structure, it might be wise to ask a web developer for help.

5. After pasting the code, save your changes and refresh your website to see the chatbot in action.

6. Test the chatbot on your website to ensure it's working correctly. Try asking questions related to the purpose of the chatbot to confirm it's responding accurately and efficiently.

If everything is functioning as expected, you have successfully deployed your AI chatbot on the university website. It's now ready to assist your users, and in our case, prospective students, with their queries 24/7.

Build your custom chatbot

You can build your customer support chatbot in a manner of minutes

Get Started