Supported AIML Tags

Last updated: Mar 15th, 2021

<avatar />

This is a proprietary tag that allows you to define expressions for your bot that will be triggered if you use a Lemurtar avatar.

Tag Example

The following examples will add a 'smile' to your lemurtar

<avatar action="smile" />
Tag Attributes

If any of the attributes below are missing the tag might not behave as expected.

# Name Type Description Options
1 action string the action you wish your avatar to perform sad, happy, angry, scared, love
Example Category
<aiml version="2.0">
    <category>
        <pattern>TEST HAPPY</pattern>
        <template>I am happy<avatar action="happy" /></template>
    </category>
</aiml>
Example Response
{
    "success": true,
    "data": {
        "conversation": {
            "input": "test happy",
            "output": "I am happy",
            "id": "08b53284-355f-4d89-9f8b-38878eddfc8d",
            "topic": ""
        },
        "bot": {
            "id": "dilly",
            "name": "Dilly",
            "image": "https://demo.lemurengine.com/widgets/dilly.png"
        },
        "client": {
            "id": "8db4c2d7-c96d-43c1-bef7-0b30e8e86e96",
            "image": "https://demo.lemurengine.com/images/default/blank.png",
            "name": ""
        },
        "features": {
            "action": "happy"
        },
        "metadata": {
            "version": "1.5.0",
            "date": "2021-12-01T07:55:10.606212Z",
            "duration": "337ms"
        }
    },
    "message": "Conversation turn successful"
}

<bot />

This tag allows you to access bot properties (which are stored in the database).

Tag Example

The following examples will fetch a 'favmusic' value from the bot_properties table

<bot name="favmusic" />
Tag Attributes

If any of the attributes below are missing the tag might not behave as expected.

# Name Type Description
1 name string the name of the property you wish to retrieve
Example Category
<aiml version="2.0">
    <category>
        <pattern>WHAT IS YOUR FAVORITE MUSIC</pattern>
        <template>My favorite music is <bot name="favmusic" /></template>
    </category>
</aiml>
Example Conversation
{
"conversation":{
    "user":"What is your favourite music?",
    "bot":"My favorite name is house music"
    }
}

<condition>

The condition tag is used to switch between responses based upon a certain condition being true.

Tag Example

The following example states check the value of the variable 'state' and match the value in the proceeding <li> tags to work out if a response should be displayed and if there is no match use the final <li> tag which has no conditional value.

<condition name="state">
    <li value="bored">Yes I am very bored.</li>
    <li value="busy">No I am quite busy.</li>
    <li>I am not really sure.</li>
</condition>
Tag Attributes

If any of the attributes below are missing the tag might not behave as expected.

# Name Type Description
1 name string Looks in the global 'name' variables for a matching variable with the same name.
2 var string Looks in the local 'var' variables for a matching variable with the same name.
Example Category
<aiml version="2.0">
    <category>
        <pattern>ARE YOU BORED</pattern>
        <template>
          <think><set name="state">busy</set></think>
          <condition name="state">
            <li value="bored">Yes I am very bored.</li>
            <li value="busy">No I am quite busy.</li>
            <li>I am not really sure.</li>
          </condition>
        </template>
    </category>
</aiml>

Example Conversation
{
"conversation":{
    "user":"Are you bored?",
    "bot":"No I am quite busy."
    }
}

<date />

This tag will display the current date in a format and timezone of your choosing.

Tag Example

The following examples will return the current date in the %Xformat

<date format="%X" />
Tag Attributes

If any of the attributes below are missing the tag might not behave as expected.

# Name Type Default Description
1 locale string en_US Help on locale codes stackoverflow
2 format string %B %d %Y For a full list of allowed formats: php.net/function.strftime
3 timezone string en_US Help on available
Example Category
<aiml version="2.0">
    <category>
        <pattern>WHAT IS THE DATE</pattern>
        <template>The date is <date format="%X" /></template>
    </category>
</aiml>
Example Conversation
{
"conversation":{
    "user":"What the date?",
    "bot":"The date is 01/12/21"
    }
}

<denormalize>

When inputs are normalized a dataset is built up in the normalizations table, this tag will attempt to substitute the value the user want to denormalize back to its normalized value.

Tag Example

The following examples will attempt to denormalize the value 'google dot com'.

<denormalize>google dot com</denormalize>
Example Category
<aiml version="2.0">
    <category>
        <pattern>DENORMALIZE *</pattern>
        <template><denormalize><star/></denormalize></template>
    </category>
</aiml>
Example Conversation
{
"conversation":{
    "user":"Denormalize google dot com",
    "bot":"google dot com"
    }
}

<eval>

The eval tag is used inside a learn tag and its allows you to substitute the item to evaluate in the category that is being taught.

Tag Example

The following example sets the subject of the question.

WHAT COLOR IS THE <eval><star /></eval>

The following example sets the subject of the answer.

The <eval><star /></eval> is blue
Example Category
<aiml version="2.0">
    <category>
        <pattern>THE * IS GRASS</pattern>
        <template>
          I will remember that the <star /> is green.
          <learn>
            <category>
            <pattern>WHAT COLOR IS THE <eval><star /></eval></pattern>
            <template>The <eval><star /></eval> is green</template>
            </category>
          </learn>
        </template>
    </category>
</aiml>
Example Conversation
{
"conversation":[
    {
        "user":"The grass is green.",
        "bot":"I will remember that the grass is green."
    },
    {
        "user":"What color is the grass?",
        "bot":"The grass is green."
    }
]}

<evaluate>

The evaluate tag is an alias for the the eval tag. Please see the eval tag for details.

<explode>

The explode tag is break a word into its letters (with a space in between each letter)

Tag Example

The following example will explode the word 'word'.

<explode>word</explode>
Example Category
<aiml version="2.0">
    <category>
        <pattern>EXPLODE THIS WORD</pattern>
        <template><explode>word</explode></template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"Explode this word",
        "bot":"w o r d"
    }
}

<feature>

The feature tag allows you to set and return information in the features field of the response

This is not part of the conversation but is a way of adding extra features to your response

Features are a key pair value and your key can be anything you wish. It is up to your own front end application on how you interpret it.

A good example of this implementation is the avatar chat demo. 'bot_mood' features are used to control the expression of the avatar in the front end. Why not test this out by telling the bot you love it.

Tag Example
<feature name="client_mood"><star/></feature>
Example Category
<aiml version="2.0">
    <category>
        <pattern>I AM FEELING SO *</pattern>
        <template>Why do you feel <star />?<feature name="client_mood"><star/></feature></template>
    </category>
</aiml>
Example Response
{
"data": {
        "conversation": {
            "input": "I feel so happy",
            "output": "Why do you feel so happy?",
            "id": "b5ee10dc-4a15-4c60-951b-9962d3d387a2",
            "topic": ""
        },
        "features": {
            "client_mood": "happy"
        }
    },

<first>

The first tag returns the first word found in its wildcards contents

Tag Example
<first><star/></first>
Example Category
<aiml version="2.0">
    <category>
        <pattern>TELL ME THE FIRST ITEM IN THIS LIST *</pattern>
        <template><first><star/></first></template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"Tell me the first item in this list a b c",
        "bot":"a"
    }
}

<formal>

The formal tag is used to capitalise each word in a sentence.

Tag Example
<formal>this is the title of my paper</formal>
Example Category
<aiml version="2.0">
    <category>
        <pattern>FORMALIZE THE TITLE OF MY BOOK</pattern>
        <template><formal><star/></formal></template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"formalize the title of my book",
        "bot":"The Title Of My Book"
    }
}

<gender>

The gender tag is used to look up third person gender transformations from the word_transformations table.

Tag Example
They took <gender><star/></gender> dinner
Example Category
<aiml version="2.0">
    <category>
        <pattern>DID THEY TAKE HER DINNER</pattern>
        <template>No, they took <gender><star/></gender> dinner!</template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"Did they take her dinner?",
        "bot":"No, they took his dinner!"
    }
}

<get />

This tag is used to return the value of a predicate.

Tag Example

The following examples will return the value of a global variable named "dinner"

<get name="dinner" />
Tag Attributes

If any of the attributes below are missing the tag might not behave as expected.

# Name Type Description
1 name string Looks in the global 'name' variables for a matching variable with the same name and returns it value.
2 var string Looks in the local 'var' variables for a matching variable with the same name and returns it value.
Example Category
<aiml version="2.0">
    <category>
        <pattern>WHAT IS ARE YOU EATING FOR DINNER</pattern>
        <template>
            <think><set name="dinner">noodles</set></think>
            I am having <get name="dinner" /> for dinner.
        </template>
    </category>
</aiml>
Example Conversation
{
"conversation":{
    "user":"What are you having for dinner?",
    "bot":"I am having noodles for dinner"
    }
}

<gossip>

The gossip tag is used store tidbits of gossip from the client.

Tag Example
<learn><gossip><star/></gossip></learn>
Example Category
<aiml version="2.0">
    <category>
        <pattern>DID YOU HEAR THAT *</pattern>
        <template>Interesting gossip!<learn><gossip><star/></gossip></learn></template>
    </category>
</aiml>
Example Conversation
{
"conversation":[
    {
        "user":"Did they hear that Harry met Sally?",
        "bot":"Interesting gossip!"
    },
    {
        "user":"Tell me some gossip",
        "bot":"Harry met Sally"
    }
]}

<id />

The id tag returns the current conversation id.

Tag Example
The conversation id is <id/>
Example Category
<aiml version="2.0">
    <category>
        <pattern>WHAT IS THE CONVERSATION ID</pattern>
        <template>The conversation id is <id/></template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"What is the conversation id?",
        "bot":"The conversation id is bot-john-4726952"
    }
}

<input />

The input tag returns the users last sentence.

Tag Example

Get the last sentence

You said: <input />

Get the second to last input

Before this you said: <input index="2"/>

Consider the user input: "Hello! How are you?

Hello! = <input index="1,2"/>
How are you? = <input index="1,1"/>
Tag Attributes

These attributes are optional

# Name Type Description Example
1 index integer The index of the input you wish to get index="2"
Example Category
<aiml version="2.0">
    <category>
        <pattern>WHAT DID I SAY</pattern>
        <template>You said: '<input />'</template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"What did I say?",
        "bot":"You said: 'What did I say?'"
    }
}

<javascript>

The javascript tag returns javascript code inside a safe [script][/script] block. You will have to convert the [script][\script] tag to a <script></script> in your own front end.

Tag Example
<javascript>alert('hi')</javascript>
Example Category
<aiml version="2.0">
    <category>
        <pattern>ALERT *</pattern>
        <template><javascript>alert('<star />')</javascript></template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"Alert hello",
        "bot":"[script]alert('hello')[/script]"
    }
}

<learn>

The learn tag is used to teach the bot new things during the conversation.

Tag Example
<learn>
    <category>
        <pattern>WHAT DO I LIKE</pattern>
        <template>You like music.</template>
    </category>
</learn>
Example Category
<aiml version="2.0">
    <category>
        <pattern>I LIKE MUSIC</pattern>
        <template>
            I will remember that you like music.
            <learn>
                <category>
                    <pattern>WHAT DO I LIKE</pattern>
                    <template>You like music.</template>
                </category>
            </learn>
        </template>
    </category>
</aiml>
Example Conversation
{
"conversation":[
    {
        "user":"I like music.",
        "bot":"I will remember that you like music."
    },
    {
        "user":"What do I like?",
        "bot":"You like music."
    }
]}

<li>

The li tag is used with a <condition> or <random> tag as a way of selecting an response from a list of responses.

If you want to use this tag inside a <condition> then please see the condition tag for details.

If you want to use this tag inside a <random> then please see the random tag for details.

<loop />

The loop tag is used to iterate over a set of list item elements that are contained in a condition block.

The loop tags sits before the closing <li/> to indicate that the if the condition of the li is not met then a loop should occur and if the condition is met the loop should break

Tag Example
<li value='2'><think><set var='count_down'>1</set></think>2 <loop/></li>
Example Category
<aiml version="2.0">
<category>
    <pattern>COUNT DOWN FROM <set>testnumber</set></pattern>
    <template>
        <think><set var='count_down'><star/></set></think>
        <condition var='count_down'>
            <li value='5'><think><set var='count_down'>4</set></think>5 <loop/></li>
            <li value='4'><think><set var='count_down'>3</set></think>4 <loop/></li>
            <li value='3'><think><set var='count_down'>2</set></think>3 <loop/></li>
            <li value='2'><think><set var='count_down'>1</set></think>2 <loop/></li>
            <li value='1'><think><set var='count_down'>0</set></think>1 </li>
            <li></li>
        </condition>
    </template>
</category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"Count down from 3",
        "bot":"3 2 1"
    }
}

<lowercase>

The lowercase tag is used to convert the output to lowercase.

Tag Example
<lowercase>THIS WILL BE LOWERCASE</lowercase>
Example Category
<aiml version="2.0">
    <category>
        <pattern>LOWERCASE *</pattern>
        <template><lowercase><star/></lowercase></template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"lowercase THIS INPUT",
        "bot":"this input"
    }
}

<map>

The map tag is used to link a value to its map value. Map values are stored in the table map_values and are grouped by maps in the maps table.

Tag Example

The following example will look up the mapped value of 'France' which belongs to the map called 'capital'.

<map name="capital">France</map> is the capital of France
Example Category
<aiml version="2.0">
    <category>
        <pattern>WHAT IS THE CAPITAL OF *</pattern>
        <template>
            <map name="capital"><star /></map> is the capital of <star />
        </template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"What is the capital of France?",
        "bot":"Paris is the capital of France."
    }
}

<name>

Maintained for backward compatibility - Do use this format if you can avoid it.

Tag Example

Expanded format

<set><name>dinner</name>noodles</set>

Equivalent preferred format

<set name="dinner">noodles</set>

<normalize>

Outputs the normalized value

Tag Example

The following examples will attempt to normalize the value 'google.com'.

<normalize>google dot com</normalize>
Example Category
<aiml version="2.0">
    <category>
        <pattern>NORMALIZE *</pattern>
        <template><normalize><star/></normalize></template>
    </category>
</aiml>
Example Conversation
{
"conversation":{
    "user":"Normalize google.com",
    "bot":"google dot com"
    }
}

<person>

The person tag is used to transform a pronoun between the first and second person. These transformations are stored in the word_transformations table.

Tag Example
You are <person><star/></person>
Example Category
<aiml version="2.0">
    <category>
        <pattern>I AM *</pattern>
        <template>You are <person><star/></person></template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"I am talking to you",
        "bot":"You are talking to me"
    }
}

<person2>

The person2 tag is used to transform a pronoun between the first and third person. These transformations are stored in the word_transformations table.

Tag Example
They are <person2><star/></person2>
Example Category
<aiml version="2.0">
    <category>
        <pattern>GIVE IT *</pattern>
        <template>I GAVE IT <person><star/></person></template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"Give it to me",
        "bot":"I gave it to them"
    }
}

<program />

The program tag is an alias for the the version tag. Please see the version tag for details.

<random>

The random tag is used with <li> tags to provide a list of potential bot responses, one of which will be returned randomly.

Tag Example

The following example will randomly pick 'yes' or 'no'.

<random><li>yes</li><li>no</li></random>
Example Category
<aiml version="2.0">
    <category>
        <pattern>WHAT ARE YOU EATING FOR DINNER</pattern>
        <template>
            <random>
                <li>Spaghetti.</li>
                <li>Noodles.</li>
                <li>Curry.</li>
                <li>Chips.</li>
            </random>
        </template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"What are you eating for dinner?",
        "bot":"Curry."
    }
}

<rate>

Can be used with or without attributes to set a bot ratings or to get bot ratings metrics.

Only numerical responses are counted towards the rating and the min/max are set to 0 and 5.

Name Tag Attributes

These attributes are optional and are used when you want to retrieve certain metrics.

# Name attribute value Description Example
1 average The average rating of the bot <rate name="average" />
2 count The number of ratings given <rate name="count"/>
3 min The minimum rating given <rate name="min"/>
4 max The maximum rating given <rate name="max"/>
Tag Example

Rate the bot

You have rated me <rate><star /></rate> out of 5

Get the bot rating

I am rated <rate name="average"/> out of 5
Example Category
<aiml version="2.0">
    <category>
        <pattern>I RATE YOU * STARS</pattern>
        <template>
            You have rated me <rate><star /></rate> out of 5
        </template>
    </category>
</aiml>

    <category>
        <pattern>TELL ME YOUR RATING STATS</pattern>
        <template>
            I am have been rated <rate name="average" /> out of 5 by <rate name="count" /> people.
            My highest rating is <rate name="max" /> and my lowest is <rate name="min" />.
        </template>
    </category>
</aiml>
Example Conversation
{
"conversation": [
    {
        "user":"I rate you 5 stars",
        "bot":"You have rated me 5 out of 5."
    },
    {
        "user":"Tell me your rating stats",
        "bot":"I am have been rated 4.3 out of 5 by 67 people. My highest rating is 5 and my lowest is 0."
    }
]}

<request />

The request tag returns the client's last full request.

Tag Example

Get the client’s last input request, consisting of one or more input sentences.

You said: <request/>
which is equivalent to: <request index="1"/>

Get the client’s 2nd to last input request, consisting of one or more input sentences.

Before that you said: <request index="2"/>

<response />

The response tag returns the bot's last response.

Tag Example

Get the last response

I said: <response />
which is equivalent to: <response index="1"/>

Get the second to last response

Before I you said: <response index="2"/>
Tag Attributes

These attributes are optional

# Name Type Description Example
1 index integer The index of the input you wish to get index="2"
Example Category
<aiml version="2.0">
    <category>
        <pattern>WHAT DID YOU SAY</pattern>
        <template>I said: '<request index="1"/>'</template>
    </category>
</aiml>
Example Conversation
{
"conversation":[
    {
        "user":"Hello",
        "bot":"Hi"
    },
    {
        "user":"What did you say?",
        "bot":"I said: 'Hi'"
    }
]}

<rest>

The rest tag returns all the words after the first word in its contents and applies to wildcards in patterns only.

Tag Example
<rest><star/></rest>
Example Category
<aiml version="2.0">
    <category>
        <pattern>TELL ME THE REST OF ITEM IN THIS LIST *</pattern>
        <template><rest><star/></rest></template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"Tell me the rest of item in this list a b c",
        "bot":"b c"
    }
}

<sentence>

The sentence tag is used to capitalise the first word in a sentence.

Tag Example
<sentence>this is a sentence</sentence>
Example Category
<aiml version="2.0">
    <category>
        <pattern>CONVERT *</pattern>
        <template><sentence><star/></sentence></template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"convert my nicely formatted sentence.",
        "bot":"My nicely formatted sentence."
    }
}

<set>

This tag is used to set the value of a predicate.

Tag Example

The following examples will set the value of a global variable named "dinner" to 'noodles.

<set name="dinner">noodles<set/>
Tag Attributes

If any of the attributes below are missing the tag might not behave as expected.

# Name Type Description
1 name string Looks in the global 'name' variables for a matching variable with the same name and returns it value.
2 var string Looks in the local 'var' variables for a matching variable with the same name and returns it value.
Example Category
<aiml version="2.0">
    <category>
        <pattern>I AM EATING * FOR MY DINNER</pattern>
        <template>
            <think><set name="dinner"><star/></set></think>
            You are having  <get name="dinner" /> for dinner.
        </template>
    </category>
</aiml>
Example Conversation
{
"conversation":{
    "user":"I am having noodles for dinner",
    "bot":"You are having noodles for dinner"
    }
}

<size />

The size tag returns the number of categories the bot has access to.

Tag Example
My brain is <size/> categories big
Example Category
<aiml version="2.0">
    <category>
        <pattern>HOW CLEVER ARE YOU</pattern>
        <template>My brain is <size/> categories big.</template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"How clever are you?",
        "bot":"My brain is 100 categories big"
    }
}

<sr />

The sr tag is an alias for for <srai><star /></srai>. Please see the srai tag for details.

<srai>

The srai tag will research the database for a matching category.

Tag Example

This tag will research the database for a category which matches 'HI'.

<srai>HI</srai>
Example Category
<aiml version="2.0">
    <category>
        <pattern>YO *</pattern>
        <template><srai>HI</srai></template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"Yo",
        "bot":"Hello!"
    }
}

<sraix>

This tag is not supported. You can easily link any category to any bot from within the admin area.

<star />

The star tag is used to output portions of the user's input that were captured by wildcards.

Tag Example
Your favorite <star /> is <star index="2" />
Example Category
<aiml version="2.0">
    <category>
        <pattern>MY FAVORITE * IS *</pattern>
        <template>Your favorite <star /> is <star index="2" />
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"My favorite dinner is noodles",
        "bot":"Your favorite dinner is noodles"
    }
}

<that>

The that tag is used provide context to a category before it can be matched. The category can only be used if the value of <that> matches the denormalized bot response.

Example Category
<aiml version="2.0">
    <category>
        <pattern>YES</pattern>
        <that>DO YOU WANT TO EAT DINNER</that>
        <template>I do too.</template>
    </category>
</aiml>
Example Conversation
{
"conversation":[
    {
        "user":"I am hungry",
        "bot":"Do you want to eat dinner?"
    },
    {
        "user":"Yes",
        "bot":"I do too."
    }
]}

<thatstar />

The thatstar tag is used to echo portions of the bot's response that were captured by wildcards.

Example Category
<aiml version="2.0">
    <category>
        <pattern>I LIKE IT TOO</pattern>
        <that>I LIKE *</that>
        <template>What is your favorite flavour of <thatstar /></template>
    </category>
</aiml>
Example Conversation
{
"conversation":[
    {
        "user":"I like cheese",
        "bot":"I like pizza"
    }, {
        "user":"I like it too!",
        "bot":"What is your favorite flavour of pizza?"
    }
]}

<think>

The think tag allows to silently perform tag functions without outputting anything.

Tag Example

This example sets a global variable called 'dinner' to 'noodles' - nothing is output in the response

 <think> <set name="dinner">noodles </set> </think>
Example Category
<aiml version="2.0">
    <category>
        <pattern>MY DINNER IS *</pattern>
        <template>
            <think><set name="dinner"><star /></set></think>
            I will remember your dinner
        </template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"My dinner is noodles",
        "bot":"I will remember your dinner"
    }}

<topic>

If a category is wrapped in a topic the category can only be matched if topic is matched.

Example Category
<aiml version="2.0">
    <category>
        <pattern>LETS CHANGE THE TOPIC TO *</pattern>
        <template>
            Sure, we can talk about <set name="topic"><star /></set>
        </template>
    </category>

    <topic name="noodles">
        <category>
            <pattern>I LIKE THEM SPICY</pattern>
            <template>I like mine in soup</template>
        </category>
    </topic>
</aiml>
Example Conversation
{
"conversation":[
    {
        "user":"Lets change the topic to noodles",
        "bot":"Sure, we can talk about noodles"
    },
    {
        "user":"I like them spicy",
        "bot":"I like them in soup"
    }
]}

<topicstar />

The topicstar has two uses;

  • Return the current topic if used outside of a topic element
  • Return the topic wildcard if used inside a topic element
Tag Attributes

These attributes are optional

# Name Type Description Example
1 index integer The index of the topic star you wish to get index="2"
Example Category
<aiml version="2.0">
    <category>
        <pattern>I WOULD LIKE SOME NOODLES</pattern>
        <template>
            Ok.<think><set name=”topic”>eat noodles</set></think>
        </template>
    </category>

    <topic name="eat *">
        <category>
            <pattern>WHAT DO I WANT</pattern>
            <template><topicstar/></template>
        </category>
    </topic>
</aiml>
Example Conversation
{
"conversation":[
    {
        "user":"I would like some noodles",
        "bot":"Ok."
    }, {
        "user":"What do I want?",
        "bot":"noodles"
    }
]}
I WOULD LIKE MILK WHAT DO I WANT

<uppercase>

The uppercase tag is used to convert the output to uppercase.

Tag Example
<uppercase>this will be uppercase</uppercase>
Example Category
<aiml version="2.0">
    <category>
        <pattern>UPPERCASE *</pattern>
        <template><uppercase><star/></uppercase></template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"uppercase this input",
        "bot":"THIS INPUT"
    }
}

<value>

Maintained for backward compatibility - Do use this format if you can avoid it.

Tag Example

Expanded format

<li><value>noodles</value>yum yum</li>

Equivalent preferred format

<li value="noodles">yum yum</li>

<var>

Maintained for backward compatibility - Do use this format if you can avoid it.

Tag Example

Expanded format

<set><var>dinner</var>noodles</set>

Equivalent preferred format

<set var="dinner">noodles</set>

<version />

The version tag returns the current app version.

Tag Example
The app version is <version/>
Example Category
<aiml version="2.0">
    <category>
        <pattern>WHAT IS THE VERSION OF THIS APP</pattern>
        <template>The version is <version/></template>
    </category>
</aiml>
Example Conversation
{
"conversation":
    {
        "user":"What is the version of this app?",
        "bot":"The version is v1.2.0"
    }
}

HTML Tags


If the has_html tag is set to true in the request you can access a number of HTML tags in the response. If the has_html is set to false then a plain text version of the tag is sent back with no automatic html formatting.

<a>

This tag allows you to return a hyperlink (if is_html = true).

Tag Example
<a href='https://www.google.com'>I am a link to google</a>
Tag Attributes

If any of the attributes below are missing the tag might not behave as expected.

# Name Type Description
1 href string the address of the link
Example Category
<aiml version="2.0">
    <category>
        <pattern>OPEN GOOGLE</pattern>
        <template
            Click here: <a href='https://www.google.com'>Google</a>
        </template>
    </category>
</aiml>
Example Conversation
{
"conversation":{
    "user":"Open google",
    "bot":"Click here: <a href='https://www.google.com'>Google</a>"
    }
}

<b>

This tag allows you to mark up your response using the html <b> tags.

Tag Example

The following examples will return the word 'bold' formatted in bold.

This is <b>bold</b>.
Example Category
<aiml version="2.0">
    <category>
        <pattern>WHAT IS BOLD</pattern>
        <template>This is <b>BOLD</b>/template>
    </category>
</aiml>
Example Conversation
{
"conversation":{
    "user":"What is bold?",
    "bot":"This is <b>BOLD</b>"
    }
}

<br />

This tag allows you to mark up your response using the html <br /> tags.

Tag Example

The following examples will return a line break between line1 and line2.

line1<br/>line2.
Example Category
<aiml version="2.0">
    <category>
        <pattern>WHAT IS A NEW LINE</pattern>
        <template>This is on<br/>a new line</template>
    </category>
</aiml>
Example Conversation
{
"conversation":{
    "user":"What is a new line?",
    "bot":"This is on<br/>a new line"
    }
}

<img />

This tag allows you to return a html img tag (if is_html = true).

Tag Example
Here is your pic: <img src='https://via.placeholder.com/150' />
Tag Attributes

If any of the attributes below are missing the tag might not behave as expected.

# Name Type Description
1 src string the web address of the image
Example Category
<aiml version="2.0">
    <category>
        <pattern>SHOW ME A PICTURE</pattern>
        <template
            Here is your pic: <img src='https://via.placeholder.com/150' />
        </template>
    </category>
</aiml>
Example Conversation
{
"conversation":{
    "user":"Show me a picture",
    "bot":"Here is your pic: <img src='https://via.placeholder.com/150' />"
    }
}

Want a Chatbot in the simplest fasts way possible?

Host Bots

Chatbot Consultants

If you need help with customisation or a bespoke feature - then get in touch with us over that theramenrobotdiscocode.com and let's see how we can help.

Get In Touch