Skip to content
This repository

A Markov chain based text generation library and MegaHAL style chatbot

This branch is 28 commits ahead and 187 commits behind master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 cobe
Octocat-spinner-32 tests
Octocat-spinner-32 .gitignore
Octocat-spinner-32 COPYING Add copyright information (MIT licensed) February 28, 2010
Octocat-spinner-32 Add a file October 17, 2010
Octocat-spinner-32 README
Octocat-spinner-32 Declare cobe 3.x bankruptcy January 03, 2014
Octocat-spinner-32 setup.cfg Declare cobe 3.x bankruptcy January 03, 2014
Octocat-spinner-32 uwsgi.ini
COBE stands for Code of Business Ethics. Cobe is a conversation
simulator, originally a database backed port of MegaHAL but a bit
more now.

There are a few relevant posts here:

Cobe has been inspired by the success of Hailo:

Our goals are similar to Hailo: an on-disk data store for lower memory
usage, better support for Unicode, and general stability.

You can read about the original MegaHAL here:

In short, it uses Markov modeling to generate text responses after
learning from input text.

Cobe creates a directed graph of word n-grams (default n=3) from the
text it learns. When generating a response, it performs random walks
on this graph to create as many candidate replies as it can in half a

As the candidate responses are created, they're run through a scoring
algorithm that identifies which is the best of the group. After the
half second is over, the best candidate is returned as the response.

Cobe installs a command line tool (called cobe) for interacting with a
brain database, though it is also intended to be used as a Python
api. See the documentation in the cobe.brain module for details.

To install from a tarball:

  $ python install

Or from the Python Package Index:

  $ easy_install pip
  # pip install cobe


  $ cobe init
  $ cobe learn <text file>
  $ cobe console
Something went wrong with that request. Please try again.