Well I've been working recently on a Perl irc bot, smeg. It's an interesting way to pass time. We're in the process of moving a lot of persistent data to a SQL backend. Eimi has been investigating PostgreSQL and MySQL. Smeg is getting pretty advanced. He speaks on topic, utilizing a rather large database of quotations (originally based on the fortune packages). He also gets information from the web and of course has some preprogrammed responses. He has a mood and and affiliation to individual users based on their karma. He keeps a hierarchy of objects and how they relate to each other which provides him with a basic understanding of the universe. He can tell your fortune, give you news headlines (/., LinuxToday, and lwn.net daily).
We'd really like to do more to separate the "engine" (such as it is) from the implementation. The ultimate goal is to make him seem more human-like, while providing some cool bot-like functions which can be hidden. To that end he will spontaneously do things such as mark himself away for various reasons (depending on his mood, which isn't arbitrary--it's based on how users treat him), speak spontaneously, etc. Admins of Smeg have remote control over him. He plays cards (52 games to be precise), keeps a calendar and watch which can affect things he does which are time or date specific and admin-definable. He will give definitions of words, perform web-queries, and serve a damn fine beer (if he likes you). I shit you not.