AI chatbot using RiveScript

Three years ago, I wrote a blog post talking about how I started exploring and experimenting with AI chatbot application development. 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 create 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 is a quite good fit for my requirements known as elizabot.js. So, I built my chatbot based on this JavaScript library. I liked this library because it uses 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 be more simpler than JSON format. Without wasting my time digging into the source code and modify it, I opted to look for a better chatbot interpreter engine alternative. And then, I found two of them that can provide me a “more simpler solution” to program my bot brain, which 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 created two chatbot web app projects which are based on RiveScript interpreter engine; 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 demo locally, you need Git and Node.js installed, then run following commands:

git clone
cd hnbot
npm install
npm start

Please note that 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 bot brain is based on predefined samples.

Related Posts