AI chatbot app development using RiveScript

Three years ago, I wrote a blog post talking about how I tried to build AI chatbot apps. In the end I found myself likely interested more in building AI chatbots for the web. When designing a chatbot, in order to have a natural human-like conversation, the chatbot needs a knowledgebase system that works like a “brain” to respond to particular conversation inputs.

I remembered, before I created my first AI chatbot web app known as W4Y1, I had been struggling to find a better chatbot interpreter engine that can provides easier way to program the “bot brain”. Then, I found one that was a quite good fit for my requirements known as elizabot.js. So, I built my chatbot based on that JavaScript library. I like this library because it used JSON format for the knowledgebase markup language. Thus, it was easy for me to program my chatbot brain.

After a while using elizabot.js, I started to feel that the knowledgebase markup language should have been more simpler than JSON format. Without wasting the time to dig into the source code and make modification, I opted to look for a better chatbot interpreter engine alternative. Then, I found two of them that can provide me a “more simpler solution than elizabot.js” to program my “bot brain” - they are BotML and RiveScript. After some researches, I decided to use RiveScript since it has more supports for different programming languages, good documentations and active contributions from its community. So, I have built two chatbot app projects which are based on RiveScript interpreter engine known as HelloBot and hnbot.

HelloBot - AI chatbot web app built using Jekyll

Image: Having conversation with HelloBot via web browser
Having conversation with HelloBot via web browser

HelloBot is built using Jekyll and rivescript-js for the bot interpreter engine. HelloBot is live and currently being hosted using GitHub Pages for demo purpose. HelloBot contains terminal-like interface designed using Bootstrap, jQueryTerminal and jquery-mousewheel.

hnbot - AI chatbot web app built using Node.js and Socket.IO

Image: Having conversation with hnbot via web browser locally
Having conversation with hnbot via web browser locally

hnbot is using a similar interface design with HelloBot, and the only difference is that hnbot is built based on Node.js and Socket.IO. Also similarly to HelloBot, hnbot’s interpreter engine is based on RiveScript NPM package.

To run the hnbot demo locally, you need Git and Node.js installed, then run following commands:

git clone https://github.com/heiswayi/hnbot.git
cd hnbot
npm install
npm start

N.B. These apps are just proof-of-concept, and I don’t have the time to design the “bot brain” for specific application purpose. If you’re playing with the demo, the current “bot brain” is based on predefined samples.