RiveScript vs. AIML

Functionality Comparison

This table lists all of the functionality present in AIML version 1.0.1, compared with the equivalent functionality in RiveScript 2.0.

Color Key:

  • Yellow: AIML's and RiveScript's implementations of the feature are more or less the same.
  • Cyan: Same as yellow, except RiveScript also 1up's AIML in a certain way (usually, RiveScript has shortcut tags, as in <uppercase>).
  • Blue: RiveScript's implementation of a feature is largely superior to AIML's.
  • Red: AIML has a feature that RiveScript doesn't have. These are usually useless or, in the case of <date>, are against what RiveScript is all about.

AIML RiveScript Description
<aiml version="X"> ! version = X Opening tag and version line.
<topic name="X"> > topic X Topic declarations.
  < topic X inherits Y
< topic A inherits B C
Topics inheriting replies from other topics.
<category>   AIML's wrapper for a trigger/response (useless for RiveScript).
<pattern>
  HELLO BOT
</pattern>
+ hello bot Input pattern.
  • AIML's:
    • Must be uppercase
    • Only supports wildcards * and _
  • RiveScript's:
    • Must be lowercase
    • Supports wildcards *, _, and #
    • Supports optional words
    • Supports alternative words
    • Supports named arrays of words
<template>
   Hello human!
</template>
- Hello human! A response to an input pattern.
  • AIML's:
    • Can only have random replies with <random>
    • Can only have conditions with <condition> inside the template.
  • RiveScript's:
    • Can use multiple -'s for random replies.
    • Can apply {weight} to random replies.
    • Doesn't need to mix reply data with conditionals.
<that>XXX</that> % xxx Match the user's input and also the bot's last message (to carry on short conversations, e.g. knock-knock jokes).
  • AIML's has the same limitations as <pattern>
  • RiveScript's has the same capabilities as +Trigger.
<star index="N"/> <star>, <starN> Binding of any wildcards in the pattern/trigger.
<that index="N,M"> <replyN> Insert the bot's previous replies.
<input index="N"> <inputN> Insert the user's previous messages.
<thatstar index="N"> <botstar>, <botstarN> Binding of any wildcards in a <that>/%Previous.
<topicstar index="N">   Binding of wildcards in <topic> (useless so RiveScript didn't implement this).
<get name="XXX" /> <get XXX> Retrieve a user variable.
<set name="XXX">YYY</set> <set XXX=YYY> Set a user variable.
  • AIML's <set> tag also returns the value set after setting it, and needs <think> to suppress it.
  • RiveScript's <set> sets the variable silently with no echo, and needs <get> to also echo it.
<bot name="XXX" /> <bot XXX> Retrieve a bot variable.
  <env XXX> Retrieve an environment/global variable.
<date />   Insert the current date/time. This isn't implemented in RiveScript because the exact formatting of a date/time stamp is subjective and should be left to the writer, and handled through the use of objects instead.
<id /> <id> Insert the chatting user's ID.
<size />   Insert the number of loaded AIML categories. This isn't implemented in RiveScript because it's difficult to count how many things RiveScript can reply to, since triggers are much more complex than AIML's patterns.
<version />   Inserts the AIML program version. This isn't implemented in RiveScript directly because of its implementation-agnostic specification. Any interpreter can define a <env version> if they'd like.
<uppercase>XXX</uppercase> {uppercase}XXX{/uppercase},
<uppercase>
Uppercasing a string of text. RiveScript has a shortcut tag for uppercasing <star>; AIML doesn't.
<lowercase>XXX</lowercase> {lowercase}XXX{/lowercase},
<lowercase>
Lowercase a string of text. RiveScript has a shortcut tag for lowercasing <star>; AIML doesn't.
<formal>XXX</formal> {formal}XXX{/formal},
<formal>
Formalize a string of text. RiveScript has a shortcut tag for formalizing <star>; AIML doesn't.
<sentence>XXX</sentence> {sentence}XXX{/sentence},
<sentence>
Sentence-case a string of text. RiveScript has a shortcut tag for sentence-casing <star>; AIML doesn't.
<condition name="X" value="Y"> * X eq Y Conditionals.
  • AIML's:
    • Only supports an "equals" comparison.
  • RiveScript's:
    • Supports numerous comparison operators:
      • ==, eq
      • !=, ne, <>
      • <, >
      • <=, >=
<condition name="X">   Paired with <li value="Y">, runs multiple "equals" comparisons against "X". Useless. See above.
<conditon>   Paired with <li name="X" value="Y">, runs multiple conditionals involving multiple variables "equaling" multiple values. Still useless. See 2 above.
<random> {random} Insert sub-bits of random data into a reply. This is AIML's only method of randomness; RiveScript supports randomness at the level of the reply itself. This is just for smaller bits of randomness in the middle of another reply.
<li>   This is only for AIML's XML-based method of conditionals and random tags; RiveScript has no need for this.
<gossip>   Append to a text file. What file? This wasn't implemented in RiveScript for the same reason as <date>. It's too ambiguous. Use objects instead.
<srai>XXX</srai>,
<sr/>
@ xxx,
{@XXX},
<@>
Redirect one reply to another one.
<person>XXX</person> {person}XXX{/person},
<person>
Swap 1st and 2nd person pronouns.
<person2>XXX</person2>   Swap 1st and 3rd person pronouns. Is this even useful? I could never imagine where this is useful. It wasn't ported to RiveScript.
<gender>XXX</gender>   Swap gender pronouns. Where is THIS ever useful? Not ported to RiveScript.
<think>   Hide the output of AIML operations (namely, <set>). Due to the difference in RiveScript's behavior, this tag is unnecessary.
<learn>   Load a new AIML file. This is entirely not useful at all.
<system> <call> Invoke some higher power for assistance (be it system commands or object macros).
<javascript>,
<perl>,
etc.
> object XXX javascript,
> object XXX perl,
etc.
Invoking some higher power for assistance.

RiveScript-Exclusive Features

Here are all of the things RiveScript has which AIML simply does not at all:
  • ! Definition command; Alice bots need a handful of configuration files, separate from the actual AIML files, to define things such as the bot's name and other variables. These features are built right in to RiveScript itself.
     
  • Weighted random responses.
     
  • Object macros.
     
  • Topics can inherit other topics.
     
  • Tags that AIML doesn't have:
    • <add>
    • <sub>
    • <mult>
    • <div>
    • <env>
    • {!}

Web design and content copyright © 2019 Noah Petherbridge.