MegaHAL screenshot

MegaHAL is a conversation simulator that learns from everything you say to it. It builds stochastic language models of its conversations and uses them to generate replies around a keyword, which makes them sometimes eerily apt and often absurd.

I wrote the original in C in 1993. The oldest record I have of it is a USENET announcement from April 1995, and it went on to take part in the 1998 Loebner Prize.

The current version is a Ruby gem, written as a homage to the original and a fraction of its size. It’s built on Sooth, a simple stochastic predictive model. You can run it from the command line or embed it in your own application through a simple API. It comes with a handful of personalities, including the one used in the 1998 Loebner competition.