AIML stands for Artificial Intelligence Mark-Up Language. It is an XML-compliant language developed by Dr. Richard Wallace, and was used to code ALICE, the winner of the 2002 Loebner Prize and the 2004 Chatterbox Challenge. It is a very easy language to code in, and is designed for online chatterbots. It isn't very dynamic however, and the chatterbots it creates can not learn any new phrases or responses on its own, everything it says has to be prewritten.

Let's take a look at a sample of AIML:

<category>
<pattern>WHAT ARE YOU</pattern>
<template>
<think><set name="topic">Me</set></think>
I am the latest result in artificial intelligence,
which can reproduce the capabilities of the human brain
with greater speed and accuracy.
</template>
</category>


First off, the category tag is the start of one peice of information, or one line of text in a conversation. If what the person says to the bot matches the pattern tag, then it will respond with what is written in the template tag. The set and think tags are used to recall "memory" so to speak. Here, it sets the topic to "Me", which allows any categories with a topic value of "Me" to match better than categories with the same patterns that are not given an explicit topic.

As you can tell, the code for a chatterbot using AIML is just a long string of these categories. You can also add multiple responses to input using the random and list tags:

<category>
<pattern>WHAT ARE YOU</pattern>
<template>
<random>
<li>A robot</li>
<li>Why do you want to know?</li>
<li>Your worst nightmare</li>
</random>
</template>
</category>

The A.L.I.C.E. Foundation, run by Dr. Wallace, has quite a number of resources on its website, and the site Pandorabots allows users to upload their own AIML files and host chatbots from their server.