Do you speak AIML?

How to use AIML as chatbot language for user dialogues?

What is AIML and program-ab?

AIML stands for Artificial Intelligence Markup Language. AIML was developed in between 1995-2002 and is used to create or customize Alicebot which is a chat-box application based on A.L.I.C.E. (Artificial Linguistic Internet Computer Entity) free software. AIML is an XML dialect and very easy to use but not powerful as modern intelligent chatbots these days.

Program AB is the reference implementation of the AIML 2.0 draft specification. AIML is a widely adopted standard for creating chat bots and mobile virtual assistants.

Elements of AIML

AIML files use the extension .aiml to hold the bulk of the code. AIML contains several primary elements. The most important of these are categories, patterns, and templates. Categories in AIML form the basic unit of knowledge and consist of patterns and templates.


  <pattern> What is your name </pattern>
  <template>My name is Luno</template>

If this category is loaded, an AIML bot responds to the input “What is your name” with the answer “My name is Luno“.

A pattern is a string intended to correspond to one or more user input. A literal pattern such as


matches only one input and is case-insensitive: “What is your name“. But patterns can also contain placeholders that correspond to one or more words. A pattern like


fits an infinite number of inputs, including “What is your name“, “What is your intent“, etc.

A template specifies the response to an adjusted pattern. A template can be as simple as a literal text, such as

My name is Max.

A template can use variables, such as the example

My name is <bot name="name"/>.

which replaces the name of the bot with the sentence.

How to create your own AIML chatbot?

We have compiled some Java examples that show you how easy it is to use AIML on the Business Bot platform. The code examples as follows:

  1. AIML-Basic Tags (<aiml>, <category>, <pattern> and <template>)
  2. <star>-Tag (Used to match wild card * character(s) in the <pattern> Tag)
  3. <srai>-Tag (Multipurpose tag, used to call/match the other categories)
  4. <random>-Tag (Get random responses)
  5. <li>-Tag (Used to represent multiple responses)
  6. <set>-Tag (Used to set value in an AIML variable)
  7. <get>-Tag (Used to get value stored in an AIML variable)
  8. <that>-Tag (Used in AIML to respond based on the context)
  9. <topic>-Tag (Used in AIML to store a context so that later conversation can be done based on that context)
  10. <think>-Tag (Used in AIML to store a variable without notifying the user)
  11. <condition>-Tag (Used in AIML to respond to matching input)

The best way to start is with the examples from the Java project, which you can download here ( / ~10 MB). Now import the Java project into the Eclipse development environment and execute the program example ““. You can now start the dialog and extend it step by step.

You will see how easy it is to extend the chatbot dialogues. In the next step you can use the sample project and import it as business logic on the Business Bot platform. After the import you only have to assign the business logic to a chatbot to test the dialogues with an instant messenger (e.g. Telegram).

Would you like to know more about this topic or use the Business Bot Platform in your company? Contact us, we are looking forward to support you around the subject chatbots in the corporate environment.

Leave a Reply

Your email address will not be published. Required fields are marked *