RiveScript.com
[ Create a Bot | Forums ]
Navigation
Use RiveScript
New Botmasters
Bot Resources
¤ Forums
Users
Community
¤ Forums
Root HQ
¤ Sign In
What is RiveScript?

What is RiveScript?

RiveScript is a scripting language for giving intelligence to chatterbots and other conversational entities.

Where did RiveScript come from?

RiveScript originally began as a Perl module called Chatbot::Alpha in 2004, programmed by Casey Kirsle. Kirsle had been working with chatterbots for a few years before then, starting with RunABot.com and then running his own Alicebot program. RunABot and Alicebots all used AIML, or Artificial Intelligence Markup Language, to give the bots the ability to reply to their user's messages. Kirsle eventually started learning Perl with the intention to create a bot for MSN Messenger, which RunABot and Alice software wasn't able to do. However, there weren't any AIML interpreters programmed yet for Perl.

After various failed attempts at parsing AIML and trying to create AIML interpreters for Perl, Kirsle decided to create a new, plaintext-based language, which would be much easier to work with than the XML structure of AIML. Thus, Chatbot::Alpha was created. Not long after, Chatbot::Alpha was abandoned in favor of a replacement, programmed from scratch. While the new version of the bot scripting language looked a lot like Alpha code, it was incompatible in various areas; reprogrammed to be much more powerful. This new version became a Perl module called Chatbot::RiveScript.

As the development of Chatbot::RiveScript progressed, it eventually was renamed to just "RiveScript", having its own root level name space. The module became stable at version 1.03 and development on it ceased in July of 2006. Two years later, this website was created along with a new standard for RiveScript. At the time of this writing, development is being done on RiveScript 2.0, which will increase the power and flexibility of RiveScript even more.

What does RiveScript look like?

Unlike AIML, which is an XML-based language, RiveScript is based on plain text. It's a line-by-line interpreted language, and each line has a command (a symbol) and some text after it. In the most simple form, a valid RiveScript entry looks like this:
+ hello bot
- Hello, human!

What can RiveScript do?

RiveScript can do everything that AIML can do, and then some, and then some more and more. While it originally set out to match AIML's power, it wasn't long before it trumped its competitor. For just a quick list of some of the things RiveScript can do:
  • Uses "regular expression" style triggers for matching the user's message.
  • Flexible options for trigger matching: wildcards, optional words, alternative words, arrays, variable matches, and more.
  • Flexible options for responses to a trigger: a direct 1:1 response, random replies, weighted random replies, trigger redirections, internal redirections, and more.
  • Dozens of tags for manipulating variables, changing interpreter settings on the fly, formatting text, substituting words, etc.
  • Can process programming language code directly inside a RiveScript document, so dynamic replies (for example, search engines) can be integrated directly into RiveScript.
To see a full outline of all the ways RiveScript compares with AIML, see RiveScript vs. AIML.