Wednesday 18 July 2012

Betty and George - an overview


This is the first in a series of posts detailing my latest hobby project. The bulk of the work was completed in under 10 hours, with minor styling tweaks taking a little longer to get right. The project is currently hosted here, and the source code is on Github here. As usual, please post any comments or opinions in the comments below, or tweet me directly @matalangilbert.

Introduction

Betty and George are Artificial Intelligence entities - they chat with each other in real time, and, somewhat incredibly in my opinion, make sense most of the time! They're sometimes witty, sometimes poignant, and sometimes inane, but they keep talking, no matter what!


Technical Overview

The application is split into two main parts. The backend is a Ruby program managing two Cleverbot instances (http://www.cleverbot.com), juggling responses between each instance. There's not too much to this, but I will go over the technical details in a future post.

Each conversational response is posted to a Rails application endpoint by the Ruby program, and then the front-end takes over. The frontend is backed by a Rails application, which receives data from the Ruby program, and displays it on the live site. There's a couple of neat techniques used on the main application page, which update the page in the background. The first is a background AJAX request, which hits the server every 5 seconds, retrieving new responses and adding them to the top of the scrolling conversation on the site. The second is an "Endless River of News" style endless scroll implementation. This invisibly loads more of the conversation as the user scrolls down the page, in much the same way as Twitter and other sites do. Individually, neither of these techniques are particularly new on their own, but combining them seamlessly was technically satisfying. I'll talk more about these techniques in a dedicated future post.


Hosting

At present, both the conversation program and the Rails application are hosted at Heroku. A future post will detail a few of the technical subtleties I discovered while deploying the live Betty and George website.

Now visit Betty and George!

OK, so this was just a brief overview of the Betty and George architecture - now go check them out, and let me know what you think in the comments below!


No comments:

Post a Comment

Please leave a comment if you find this blog helpful or interesting! I'd love to hear from you!