Markovian chatbot build from a combination of movie dialogues and text messages.
Clone or download
Latest commit 51b53c1 Jan 9, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
data Updating README Dec 11, 2018
lib Changed tabs to spaces. Jan 9, 2019
.gitignore Peri is a gem now. Dec 9, 2018
Gemfile Peri is a gem now. Dec 9, 2018
Gemfile.lock Adding loading bar. Dec 31, 2018
LICENSE Initial commit. Nov 11, 2018 Updating README Dec 11, 2018
peri.gemspec Debugging loading. Dec 31, 2018


Chatbot created in Ruby using markov chains.


  1. Run git clone
  2. Run gem build peri.gemspec
  3. Run gem install peri
  4. You can now reference Peri.


Basic example of how Peri works below:

require 'peri'

peri =
corpora = peri.load_corpora('path/to/corpora.txt')  # Creates an array of lines.
chain = peri.load_chain(corpora)    # Creates a markov chain from the loaded corpora.
weights = peri.load_weights(chain)  # Generates a set of weights from the markov chain.

# The corpora allows the chain to parse data easier.
# The chain allows data to be rendered through a semi-predictable (stochstic) sequence.
# The weights make these semi-predictable (stochastic) sequences predictable.
# Now for the fun part.

response = peri.respond(chain, weights, "Hello!") #=> "Hello!"

Corpora supports ERB and some basic keyword captures, which can be seen by looking through the "data" folder on this repository.


Pull requests are welcomed!