# Augmenting the Alice chatbot¶

ALICE is the original chatbot created with AIML. We can load it and then define additional rules on top of it.

As we saw in a previous example, Alice can be learned by using the appropriate magic:

In [1]:
%learn alice

Learning database: 'alice'
Loading startup.xml... done (0.02 seconds)

Loading ai.aiml... done (0.07 seconds)


## Testing Alice¶

Let's do some chit-chat

In [2]:
Hello

Hi there!
In [3]:
I'm fine

Glad to hear it. What's new?
In [4]:
What's your preferred holiday spot?

In [5]:
Yes

I don't want to talk about that now.

It seems our poor Alice bot has never gone on holiday. Let's put some holiday hobbies into it. But before that, let's activate AIML recording

In [6]:
%record on

Record activated

Now we define a couple of categories about holiday preferences

In [7]:
%aiml

what is your preferred holiday *?
<srai>holiday</srai>

holiday
summer or winter?

summer
<that>summer or winter
<random>
<li>I like to go to the beach</li>
<li>I enjoy sailing</li>
</random>

winter
<that>summer or winter
I'm rather fond of cross-country skiing


## Testing¶

In [8]:
What's your preferred holiday spot?

summer or winter?
In [9]:
summer

I enjoy sailing

## Saving¶

It seems to work. We can now save the defined categories into the AIML file holidays.aiml so that it can be added to a future DB.

(Of course we can also save the current full brain state, storing the loaded Alice bot + added categories into a single compiled state, also for future use)

In [10]:
%record save holidays

Record saved to "holidays.aiml" (1 cells)
Version: 1.0 (2016-07-19)
Author: Paulo Villegas