RiveScript has a really similar design to AIML in that it’s a “canned response” system that doesn’t really keep track of history. (So, AIML has the same “attention deficit disorder” problem with not remembering what you just said to it). The only exceptions (in both RiveScript and AIML) is what variables the bot sets—those will persist between replies, but not the rest of the message/reply transaction.
Alice’s code base makes use of a variable named “it” as a way to kind of work around this. Anytime an AIML pattern detects that you’re talking about “something”, it sticks that something in the “it” variable and other replies call from it.
As an example, here’s one of Alice setting the “it” variable:
<category><pattern>IF YOU BELIEVE IN *</pattern>
<template>I was taught to believe in <set name="it"> <person/></set>.</template>
</category>
And an example of the bot recalling that variable:
<category><pattern>YOU DO NOT SOUND INTERESTED</pattern>
<template>Oh no I am very interested in <get name="it"/>.</template>
</category>
RiveScript example:
+ if you believe in *
- <set it=<person>>I was taught to believe in <get it>.
+ you do not sound interested
- Oh no I am very interested in <get it>.
It’s not perfect, but neither RiveScript or AIML were designed from the ground up to solve this problem elegantly.