How to create a chatbot

Christoph Krassnigg
3 min readJan 10, 2021

--

It is very likely that every human on earth with a smartphone already wrote with a chatbot. Maybe they did not even notice with whom they were writing.

Human or computer?

Can a computer be humanified in a way, where it talks like a real human? The Turing test is only about this. A computer can only pass the test if a human is not entirely sure if he is writing with a computer or human.

Creating a chatbot which passes the test will take an experienced team that puts many hours in the project, but we are okay with an obvious chatbot.

Predefined answers

One of the easiest ways for a chatbot is to have for every possible input a predefined answer. It sounds simple at first glance. After thinking about the millions of combinations a user can enter, it would get very complex after a short time.

Imagine a user can always input 16 characters, not less or more. The user has a selection of only lowercase letters and spaces which sums up to 27 different symbols. We have 79 766 443 076 872 509 863 361 answers we need to predefine. Complex? We do not even have the disk space for that, yet!

Predefined paths

We need a simple approach with which we can build a chatbot in a short amount of time. So let us also have predefined user inputs. The user can only writeHello to the chatbot as a first input, which leaves us at one single answer we need to predefine. Compared to the number above, which most people are too lazy to read, we will save 99.99% storage and effort.

When we were building MediBot, we took this approach. We made it even simpler. Let the user pick one of two paths. Then he will get asked some questions, and the bot has an answer for each question. After giving the user the answer, he will provide him with another question independent from the previous one.
If you are keen on the chatbot we build, then have a look.

User Experience

When building the UI for the bot, we wanted an experience which the user already knows. We took a regular chat app, disabled the text input and added a section for predefined answers.
With this approach, we prevent the user from typing in anything else. Having only predefined inputs forces the user to press one. After doing so, the app will make it look like, as the user has written a regular message.

Conclusion

There is no need to be an expert at artificial intelligence. It will help if you have a straight plan for your chatbot. Keeping things easy is vital.

--

--

Christoph Krassnigg

Developer at block42. Student. Java fanatic. Loves to write about techy things.