Using Botpress To Build Custom Trained AI ChatBots (2023 Full Tutorial)
Building a Custom Trained AI Chatbot with Botpress
In this video, the speaker demonstrates how to build a custom trained AI chatbot using Botpress. The tutorial covers creating a standard chatbot and then transforming it into a custom trained AI chatbot that can be deployed on websites.
Creating a Chatbot in Botpress
- To create a chatbot in Botpress, sign up for an account (which is free).
- After signing up, create a new chatbot and launch the studio.
- Start by adding nodes, which are the building blocks of the chatbot.
- Add an introduction node as the first node that users will see when interacting with the chatbot.
- Link the start node to the introduction node.
- Add cards to provide content within each node. Cards can include text messages or collect information from users.
- For example, add a text card to welcome users to the travel agency and introduce the personalized travel agent concept.
- Capture user information by adding a number card to ask about group size while traveling.
- Create variables to store captured information for later use or conditional logic.
Routing Users Based on Group Size
- Use expressions in Botpress to route users based on their group size input.
- For example, if the group size is four or less, send them recommendations for Niagara Falls; if it's five to ten, recommend London; and if it's more than ten, suggest visiting the Great Pyramids in Egypt.
Conclusion
The tutorial provides step-by-step instructions on building a custom trained AI chatbot using Botpress. It covers creating nodes, adding cards for content and user interaction, capturing user information with variables, and routing users based on their inputs.
Creating Conditional Expressions
In this section, the speaker demonstrates how to create conditional expressions using AI-driven logic in Botpress.
Creating Conditions for Group Size
- The speaker shows how to create a condition based on group size.
- If the group size is less than five, a specific path will be routed.
- Another expression is created for group sizes between five and ten.
- A third expression is created for group sizes greater than ten.
Mapping Paths Based on Conditions
This section focuses on mapping paths based on the conditions set in the previous section.
Mapping to Niagara Falls Node
- The first expression, for group sizes less than five, is mapped to the "Niagara Falls" node.
- A card is added with text displaying the group size.
- Another text card recommends visiting Niagara Falls for that group size.
Mapping to London and Pyramids Nodes
- Two more nodes are created: "London" and "The Great Pyramids".
- The second expression, for group sizes between five and ten, is mapped to the "London" node.
- The third expression, for group sizes greater than ten, is mapped to the "Pyramids" node.
- Text cards are added with recommendations based on each group size.
Adding Question Node
This section covers adding a question node after presenting options based on group size.
Adding Questions Node
- A new node called "Questions" is added after the previous nodes.
- A single choice card is used to ask if there are any questions.
- Users can choose either yes or no as their response.
Connecting Nodes to Questions Node
- Expressions are added to connect each of the previous nodes to the "Questions" node.
- The expressions have no conditions and are set to always send users to the "Questions" node.
Testing the Chatbot
This section focuses on testing the chatbot and ensuring everything is working correctly.
Initiating Conversation
- The speaker initiates a conversation by typing "hello".
- The chatbot responds with a welcome message and asks about group size.
Providing Group Size
- The user responds with their group size, in this case, two.
- The chatbot acknowledges the group size and proceeds accordingly.
Group Size and Destination Recommendation
In this section, the speaker discusses the group size for travel and recommends London as a destination for a group of seven people.
Determining Group Size and Destination
- The speaker asks about the size of the group, which is seven people.
- Based on the group size, London is recommended as the ideal destination.
Transforming a Standard Chat Bot into a Custom Trained AI Chat Bot
This section explains how to convert a standard chat bot into a custom trained AI chat bot by creating a knowledge base.
Creating a Knowledge Base
- By using nodes, cards, and expressions in harmony, complex chat bots can be created.
- A standard node called "AI knowledge base" is added to pull information from a custom knowledge base.
- A single choice card is used to allow users to ask any question they want.
- The node is transformed into a custom trained AI node by adding a knowledge base.
- The speaker demonstrates setting up a web search-based knowledge base using information from nomadic Matt's website.
Enabling Knowledge Answering and Handling Errors
This section covers enabling knowledge answering in the AI chat bot and handling errors when no answer is found.
Enabling Knowledge Answering
- The speaker enables knowledge answering for the AI chat bot by clicking on the node and selecting "enable knowledge answering."
- Any question asked by users will be searched within the knowledge base.
Handling Errors
- An expression is added to check if the knowledge agent has responded. If not, an error message node is triggered.
- If no answer is found in the knowledge base, an error message stating that the answer could not be found is displayed.
- Users are always redirected back to the question node after their questions are answered or an error occurs.
Chat Bot Flow Overview
This section provides an overview of the chat bot flow, including group size recommendations, question handling, and knowledge base usage.
Chat Bot Flow
- Users are asked about their group size and recommended destinations based on the group size.
- The chat bot then asks if users have any questions. If not, the chat ends.
- If users have questions, they are directed to the AI knowledge base node to ask any question they want.
- The knowledge base searches nomadic Matt's website for answers.
- If an answer is found, it is displayed and users are asked if they have more questions.
- The loop continues if users have more questions or ends if they don't.
- If no answer is found in the knowledge base, an error message is displayed and users are redirected back to the question node.
The transcript has been summarized in a clear and concise manner using timestamps when available.
Group Size and Destination Recommendation
The agent asks the traveler about the size of their group, which is 12 people. Based on this information, the agent recommends visiting the pyramids in Egypt.
Group Size and Destination Recommendation
- The traveler states that they are traveling with a group of 12 people.
- The agent suggests visiting the pyramids in Egypt as a recommended destination for a group of that size.
Things to Do in Egypt
The traveler asks what there is to do in Egypt, and the agent provides some suggestions by searching through Nomadic Matt's website.
Things to Do in Egypt
- The traveler asks what activities are available in Egypt.
- The agent searches through Nomadic Matt's website for suggestions.
- Some suggested activities include visiting historical sites, snorkeling, camel riding, and exploring Charm L Chic (exact pronunciation unknown).
Additional Questions and Conversation End
The traveler has more questions after receiving initial answers. They ask if aliens are real, but the agent doesn't have an answer. Finally, the conversation ends when the traveler indicates they have no more questions.
Additional Questions and Conversation End
- The traveler asks if aliens are real.
- The agent apologizes for not having an answer to that question.
- The conversation concludes when the traveler indicates they have no more questions.
Building a Custom AI Chatbot with Botpress
This section discusses building a custom AI chatbot using Botpress. It mentions that this method is more complex and functional than shown in a previous video.
Building a Custom AI Chatbot with Botpress
- The section introduces the topic of building a custom AI chatbot with Botpress.
- It highlights that this method is more complex and functional compared to a previous video.
- The speaker expresses hope that viewers find value in the video and encourages them to leave comments if they enjoyed it.