Python Markov chain implementation with storage in MongoDB.