Something that has really interested me recently are Markov Chains. They are often used to generate realistic looking outputs for this style of thing. They take inputs as lists of states; so a sentence would have several states - each state being a word. When given a large input, they build probability trees for each state following another. This has led to the hilarious /r/subredditsimulator on reddit and some really interesting other stuff besides. This reasonably simple technique can build surprisingly varied and realistic outputs - so long as there is a large enough amount of input data. I probably made a bad job of that explanation because I barely understand myself but here is a good explanation on /r/Python
I used to run a MegaHAL IRC bot (actually I think a different incarnation is still around in, of all places, a major IRC channel for the Rock Band series) and it was absolutely hilarious (at first) to see the bizarre stuff it came up with. I liked to feed the bot with ONLY the conversation that was said in the channel, so it would be "relevant"... sort of. I did do some experiments with feeding it other things (articles about the games, as one example) but really the best was to start it blank and let it evolve itself. I ran 3-4 of them at once, so it was interesting to see how completely moronic one bot became while another regularly spouted reasonable (for a bot) conversation. The latest incarnation uses a different Markov chain-based system, and works much much better. The originals would get very messed up with URLs and other strings of numbers/letters and would inevitably spout spammy nonsense after long enough. But it's been a really fun experiment to run a bunch of different "AI" bots and let them do their thing and see what happens. Edit: Of course I didn't write these bots, they were just scripts for Eggdrop (or a standalone script in the case of WolfServ, the latest) but I wouldn't mind trying to figure out just how to do something like that. I'm not very deep into coding stuff yet; most of my coding experience comes from hacking up eggdrop scripts to make them do what I want, and then eventually writing TCL scripts from scratch one I figured out enough about how it works. And an EXTREMELY basic roguelike I started in python using the libtcod tutorial. But I've always been interested in trying to learn more about how such bots are constructed and how I might be able to do something like that myself.