:computer: CodeBot

An AI chatbot to teach code

Chatbots were all the rage at the time of the Facebook Singapore Hackathon 2016. Suyash, Nikhil, Bobby and I wanted to get in on the action, and decided to build CodeBot, an AI chatbot to help beginners learn how to code. We also used it as an excuse to finally work with some new JavaScript frameworks and try out API.AI’s conversational engine.

People always suggest CodeAcademy as the go-to source for newbie programmers as it probably has the lowest barrier to entry. With CodeBot, we wanted to take it one more step down and create a web application to help beginners learn Python programming as an interactive conversation with a chatbot.

CodeBot


Coding as a conversation

CodeBot goes through elementary concepts and simple coding exercises on Python (adapted from CodeAcademy) in the form of a multi-turn chat. Users can write code or ask questions through the Whatsapp-like interface. The bot then checks the users’ code by compiling it on the backend or answers their questions by using API.AI’s conversational engine and a knowledgebase of Python concepts.

To make the otherwise daunting task of learning how to code for the first time easier, CodeBot incorporates witty replies, GIFs & human-readable errors to create an incredibly fun experience for a complete novice.


We built CodeBot using vanilla HTML5+CSS3 and JavaScript for the chat interface and Node.js, API.AI and MongoDB for the backend. I mainly worked on the API.AI and question answering aspect: understanding the dialog flow and typical format of questions, and using the knowledgebase stored in the MongoDB to produce the correct answers.

Chaitanya K. Joshi

Research Engineer at A*STAR, Singapore

rss facebook twitter github youtube mail spotify lastfm instagram linkedin google google-plus pinterest medium vimeo stackoverflow reddit quora quora googlescholar