Building a GPT chatbot

GPT chatbots are smart bots that answer questions from a data source.

GPT chatbots are all the rage these days, thanks to ChatGPT.

ChatGPT has opened a new way of asking questions and getting answers – that are accurate, brief, and quick.

Here are the steps to build your own GPT chatbot:

As an example, we are going to build a GPT chatbot for the website https://swiftsell.biz/ and answer user's questions. If the bot does not know the answer, we will share the customer support details.

Step 1: Creating a knowledge base

The fundamental of a GPT chatbot is creating a knowledge base that is trained with the information you want it to answer from.

As we want to answer questions from the website https://swiftsell.biz/, let’s build the knowledge base.

  • Go to AI Studio > Add Knowledge base > Add data source

  • Choose URL as the data source

  • Enter the domain https://swiftsell.biz/

  • Hit 'Train' and wait until all URL(s) are being fetched

Step 2: Build a bot

Next, we need to build a bot that will speak with the visitor and use this knowledge base to fetch the answers to questions asked.

Go to Bot Builder > Build a bot > Inbound > Web

Step 3: Adding the Answer AI action block

After the trigger action block, we will add the 'Answer AI' action block.

  • Add a welcome question like “Hey there! What can I help you with today?”

  • Choose the “Knowledge base” we created

Also, we will configure the 'Answer AI' block as per our needs. For this example, I will use the following:

Instructions:

Instructions guide the AI on how you want the answer to be generated. Write a clear and concise instruction.

“I want you to act as a support agent. Your name is "AI Assistant". You will provide me with answers from the given info. If the answer is not included, say exactly "Hmm, I am not sure." and stop after that. Refuse to answer any question not about the info. Never break character.”

All other advanced settings are kept as it is. You can choose to tweak it if needed.

Step 4: Adding fallback measures

Not always will the AI answer your question. Primarily, because it may not have all the data to answer it, or the question is quite vague to generate an answer.

In any case, it is important to always define fallback measures to help users get assistance.

In this example, after the AI generates the answer, we will try to seek acknowledgment from the user whether this answer helped or not.

Click on the success path and add “Add another block”.

Here we will add a button block with the message “Did this answer your question?” with the following options:

  • Yes - Ends the flow with a thank you message “Glad we could help!”

This way, the user always has a secondary way of getting the answer if the GPT fails. You can even extend the failure flow to collect details of their problems and create a ticket in your support systems or notify your team via email.

Last updated