A chatbot is a robot predefined with a certain set of commands to interact with users. Sometimes, these bots are coupled with AI (artificial intelligence) so that it understands the user's query and responds accordingly. They decrease human effort and guide the user in the right direction. Mostly they are implemented on the websites.
A chatbot's primary function is to interact with users. Back in the days, companies would hire someone to do so. But with the advent of AI, and other techniques, these bots are filling up those positions quickly and moreover, they are available all the time since it's just a computer responding to the user. It all boils down to how it is implemented whether simply going through a predefined script or coupled with AI to generate answers.
For the scope of this tutorial, we will go with a set of predefined questions and answers. Lets design the chatbot for a "General contractors" company website
The current implementation is very simple and it's an in-browser chatbot which means, the Q&A will be loaded into the page instantly along with the chatbot. There is no server integration. This is the easiest implementation and can be upgraded to carry the messages to the server via ajax or fetch or by sockets ( socket io).
The user interface consists of two components. Minimized and maximized.
We will start with the chat window minimized where only a small floating icon (UI #1) will be shown to the user. Upon clicking it, the icon will disappear and the chat window will appear (UI #2). Lets create an object of objects which will act as an answer lookup for our bot.
var qa = {
"intro" : {
"answer" : "Hi. This is BotPro. How may I assist you. Please choose from the options below",
"related" : ["services","contact","pricing"]
},
"pricing" : {
"answer" : "We have multiple pricing options. Choose as you wish",
"related" : ["contact"]
},
"services" : {
"answer" : "We offer roofing, siding and flooring services",
"related" : ["roofing","siding","flooring"]
},
"roofing" : {
"answer" : "Professional roofer in all connecticut. We will give you the quote on the job site",
"related" : ["siding","flooring","quote"]
},
"siding" : {
"answer" : "Siding is our main business and it's relatively cost effective with our solution",
"related" : ["roofing","flooring","quote"]
},
"flooring" : {
"answer" : "Currently going unser registration. Check back with us later.",
"related" : ["siding","roofing","call"]
},
"call" : {
"answer" : "Call us at 1-800-123-1234 if you have any questions",
"related" : ["services","contact"]
},
"contact" : {
"answer" : "We are at 123 broad st, portvan, conigan - 345091 ",
"related" : ["services","contact"]
},
"quote" : {
"answer" : "Call us for a free quotation"
},
}
This is by far the simplest bot I've designed. At large companies, they use AI (artificial intelligence) to provide answers and when the bot fails, it takes over to a live agent. By then the agent already knows what the user wants. In other words, the bot serves as an onboarding agent. Think of how much time and manpower will be saved with this type of ability.
According to recent stats, chatbots are the fastest growing technology. 73% of the users interact with chats and is the most favorite goto method of communication, especially for the millennials.
Create your own chatbot. Prepare questions, attach relations and download the html code. Also includes 3 UI designs to start with. Must have bootstrap 5 and fontawesome in your project.
Do you want to access your webcamera remotely? Then this article is for you.
Calendar Picker / Appointment Setter JS CSS Library. Inspired by Calendly.
Create a local file sharing server with realtime sync feature using Socket IO.
Most beautiful Navbars designed with tailwind css. Fully responsive templates.
Most beautiful dashboards designed with bootstrap 5. Inspired mostly from dribble and other sources.
Most commonly used HTML email templates. Welcome email, sign up, password reset etc.
Checkout our most downloaded payment page ui designed with bootstrap.
Detect user's inactivity and auto logout after certain timeout using various JS features.
Keep the user engaged and gain recurring website traffic. Includes templates.
How to get a user's location using Javascript and other techniques available today.
This website uses cookies and similar technologies, to enhance your browsing experience and provide personalized recommendations. By continuing to use our website, you agree to our Privacy policy.