Build Your First Chatbot Effortlessly with Botpress: A Step-by-Step Guide
Chatbots have rapidly become popular in recent times. These AI-based applications are easy to build yet very effective for improving customer service. Looking at the work AI, one might think that building such application must be quite challenging and costly. Talking from the R&D perspective, it is challenging and costly indeed. However, if we are thinking about a smaller scale, or something to have a hands-on-experience, then Botpress makes it every easy for us. Botpress is a website where we can create instant chatbots. The process is very simple and easy-to-understand how chatbot works. We just need to drag and drop components. Let’s get started with Botpress.
1. First we need to sign into the website. There are multiple options to sign in with. We can sign in with GitHub, Google, Microsoft, or LinkedIn. Apart from these, even we can create accounts with an email.
2. We will have our dashboard once we sign in. Now we can click on the Create Chatbot button to start developing the chatbot.
3. We will be given a few templates. Initially, we will have only one template available that comes with some existing components and instructions. Later we will be able to choose blank templates.
4. Now we have our development space. On the left side of the space, we have multiple options. We will explore the options on our way. On the right side of the space, we have our chat prompt and text section. The rest of the space will be used for designing the components.
Before we start, let’s have the scenario in front of us. The scenario is about John who is in his early 60s. He has retired from a company after 30 years of service. He wants to apply for his pension. But he thinks that paying a visit to the office in person just to know the procedure is really a waste of time. However, a conversational agent can help him to get his desired information.
User: Hi
Bot: Hello, I am here for your personal assistance. How may I help you?
User: I want to apply for my pension.
Bot: Sure, sir. Please tell me your name.
User: John Smith
Bot: Please tell me your employee ID.
User: 123-456-7890
Bot: Dear John Smith, thank you for your dedication to this company. I believe it’s been an enjoyable journey. However, I have forwarded your request to our pension department. Please visit us with your national ID card and employee documents at your earliest convenience. Also, feel free to call us on 432-233-212 for any of your queries.
In this article we will create a chatbot based on this conversation. The chatbot will help John with the required information for completing this pension application.
5. Let’s just remove existing components and start with a fresh page. Initially, we will have two nodes; the start node and the end node. We have to add our components in between and create the connection between components according to the flow of the chatbot. We can right-click on the blank and select Standard Node. It will create a node that we will customize.
6. First of all, let’s rename the node to response_greet so that we can have a clear understanding of the flow. The chatbot will reply to the users with a greeting text. We can add a chatbot response to the node by clicking on the Add Card field inside the node. We will have a list of different options. We can select image, video, audio, file, and even location as the response of the chatbot.
7. Once we select text, it will appear inside the node and a text box will appear on the right side of the space. We can add our custom response for the chatbot in the text box.
8. Now let’s just connect the node with the start node. We can do that simply by drawing a connection between the connection points of two nodes. Now we have to add a workflow that will control the conversation flow of the chatbot. We will add an Expression from the card list and name it as always. It means the chatbot will always go to the next node after the greetings node. Will connect the next node to this always expression.
9. In the next phase, we will add the intent understanding capability of the chatbot. Now the chatbot will try to understand the user query by understanding the intention of the user. To do so, let’s take another standard node and rename it as understand_intent. We are supposed to identify the intent. So we need a Raw Input card that will store the intent into a variable. We can have our raw input card the same way by clicking on the Add Card field. In this card, we can add the question which will be asked to the user.
10. Now we need to create a variable that will store the intent. The option for creating the variable is given on the right panel just under the textbox. Let’s say our variable name is intent.
11. Now we will add the workflow. This time the workflow will be determined based on the intent value. So we will add Intent from the card list. Once we add the intent workflow, we have to define the name of the intent and add some examples about this intent. After that, we have to connect this node to the workflow of the previous node.
12. Using the same approach, we will add another standard node named get_name that will store the name of the user. For this node, we will take a Raw Input card from the card list and create a variable user_name. This node will have an always workflow and will be connected to the pension workflow of the previous node.
13. We will add another node named get_employee_id where we will store the employee id into a variable named employee_id. We will store the employee id as a Number that can be added from the card list.
14. Now we will add conversation ending responses. We can add this from the Conversation End option. The conversation end is available under the Flow section of the left panel. We can add multiple responses. We just have to add another text card.
15. Our final chatbot workflow looks something like this.
16. Now we can test the chatbot on an emulator. And it works pretty well.
Botpress provides a very basic overview and limited options to customize. On the other side, chatbots or conversational agents are becoming the next big thing in the world of artificial intelligence. Enormous studies are being conducted for designing and developing conversational agents that can mimic human conversations. If you want to develop a fully customizable chatbot, you are suggested to develop one from scratch.
This tutorial aims to give a very basic introduction and hands-on experience of conversational agents. If you want to learn more about Botpress, you can check their website and their YouTube playlist. Have a good day!
Leave a Reply
Want to join the discussion?Feel free to contribute!