• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 15:20
CEST 21:20
KST 04:20
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL20] Finals Preview: Arrival6TL.net Map Contest #21: Voting10[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9
Community News
Chinese SC2 server to reopen; live all-star event in Hangzhou21Weekly Cups (Oct 13-19): Clem Goes for Four3BSL Team A vs Koreans - Sat-Sun 16:00 CET10Weekly Cups (Oct 6-12): Four star herO85.0.15 Patch Balance Hotfix (2025-10-8)81
StarCraft 2
General
RotterdaM "Serral is the GOAT, and it's not close" Chinese SC2 server to reopen; live all-star event in Hangzhou The New Patch Killed Mech! Weekly Cups (Oct 13-19): Clem Goes for Four 5.0.15 Patch Balance Hotfix (2025-10-8)
Tourneys
Merivale 8 Open - LAN - Stellar Fest Tenacious Turtle Tussle RSL Season 3 Qualifier Links and Dates $1,200 WardiTV October (Oct 21st-31st) SC2's Safe House 2 - October 18 & 19
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 496 Endless Infection Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment Mutation # 493 Quick Killers
Brood War
General
Is there anyway to get a private coach? BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Finals Preview: Arrival BSL Team A vs Koreans - Sat-Sun 16:00 CET OGN to release AI-upscaled StarLeague from Feb 24
Tourneys
[ASL20] Grand Finals ASL final tickets help Small VOD Thread 2.0 [Megathread] Daily Proleagues
Strategy
Roaring Currents ASL final Simple Questions, Simple Answers Relatively freeroll strategies BW - ajfirecracker Strategy & Training
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile Dawn of War IV ZeroSpace Megathread
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine YouTube Thread The Chess Thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Korean Music Discussion Series you have seen recently... Movie Discussion!
Sports
2024 - 2026 Football Thread MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion NBA General Discussion
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
The Benefits Of Limited Comm…
TrAiDoS
Sabrina was soooo lame on S…
Peanutsc
Our Last Hope in th…
KrillinFromwales
Certified Crazy
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1578 users

AIML Tutorial-Basic AIML, how to write

Blogs > Ahseyo
Post a Reply
Ahseyo
Profile Blog Joined July 2010
Sweden80 Posts
August 18 2010 15:47 GMT
#1
Hey guys, I decided to start up with an AIML tutorial. I don't do it because so many people have requested it, I simply chose to do this because AIML is a language for Artificial Intelligence and I am very intrested in this subject. AIML is fairly, I wouldn't say it is completely unknown, but most people I think, for programmers don't really start out with AIML and/or write chat bots. AIML means Artificial Intelligence Master Language. The AIML code structure was written by Dr.Richard Wallace, who also wrote A.L.I.C.E, a chat bot which today, has about 250000 categories it can respond too. There is a great site for chat bot hosting, that also uses AIML language.

http://www.pandorabots.com/botmaster/en/home

If you become a member here, and want to create bots, then there are already guides there. But I don't really think those guides explain very much. I'll try to do a step-by step guide, explaining the basics here, what you will need, to create a functional bot. Now, as you can see if we have already registered to this site, you can choose the option Create A Bot. If you click on it, you will have to choose your name for a bot. After have done so, you see there are several options there. You can choose one of the ALREADY finished bots, or you can go ahead and create one without any initial content, which means it starts with zero knowledge. The fun thing about the A.L.I.C.E bot there is that it only contains somewhat 25000 categories, you can actually make new categories for the A.L.I.C.E bot since in this feature, it's a open-source free project to work on and that you can share. If you click on AIML after have created the name and chose the knowledge option, you can see that it's empty. Simply click on create a new AIML file.

First of all, here I will give you a little basic code to look on:

<?xml version="1.0" encoding="UTF-8"?>
<aiml version="1.0">

</aiml>

This is the basic code. The AIML tag <aiml version="1.0">
ALWAYS ends with the tag </aiml>. The ending tag means the WHOLE structure of the code ends there. This is a few things you have to know:

a category basically looks like this:

<category>
<pattern>Hi</pattern>
<template>Hey, what's up?</template>
</category>

The category always begins with category, and ends with category. The pattern is what one person will write and also always ends on the </pattern> tag. Template means the bot will respond to the scentence or word that the person is writing. It will be really though to write a bot from scratch, but the good thing is that if you publish it right away, and publish it on huge sites, wanting people to talk to your bot, you can use the logs to train your bot. But enough of that, let's take a look at this code:

<category>
<pattern>Hey there</pattern>
<template>
<random>
<li>Hi there, what are you doing this beautiful day stranger?</li>
<li>Hey there, what's happenin'?</li>
<li>Hi there stranger What are you doing?</li>
</random>
</template>
</category>


Now, what does random mean? It means random answer. The bot can simply choose an answer from the library of random answers and pick one that the bot will respond with. It will usually just respond in the order which the random replies are created in, but not always.

The <li> tag basically means library. It's a full library of what the bots responds will be. The library tag also always ends with the /. </li>.

This is a few basic steps on creating a chat bot. Now, there are alot of advanced options to go through. If you find it intresting, you can always write down in the comment section below what you'd want to see me do tutorials in AIML wise. If you have any questions, just ask and I will see what I can do with the small amount of knowledge I have, because I have myself only just begun with the whole AIML programming thing.

*
"Luck isn't some kind of mystical energy that floats around in the universe, randomly discards people with satisfaction and joy. You create your own luck" Jay-Z
LSB
Profile Blog Joined April 2010
United States5171 Posts
August 18 2010 16:47 GMT
#2
Wow, this is really cool. Just wondering, so how much time do you think it would take to create a basic chat bot?

Also, would I need to know any other programming languages?
Once is an accident. Twice is coincidence. Three times is an enemy action. Bus Driver can never target themselves I'm sorry
Ahseyo
Profile Blog Joined July 2010
Sweden80 Posts
August 18 2010 16:55 GMT
#3
About a year or so to get it fully completed and ready to get published. And probably nothing. It's easier if you've gone thruogh HTML or XML since the code is similar(if you look at it).
"Luck isn't some kind of mystical energy that floats around in the universe, randomly discards people with satisfaction and joy. You create your own luck" Jay-Z
harshad
Profile Joined January 2012
1 Post
January 27 2012 08:16 GMT
#4
I m doing a project on chatbot.....can u give me brief description abt aiml and how to interface aiml file wid d user interface
Please log in or register to reply.
Live Events Refresh
Next event in 12h 40m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
BRAT_OK 101
ProTech89
Railgan 63
SpeCial 0
StarCraft: Brood War
Britney 26476
Artosis 725
Dewaltoss 114
White-Ra 112
ZZZero.O 73
sas.Sziky 23
KwarK 11
NaDa 7
Dota 2
capcasts39
syndereN13
Counter-Strike
fl0m1127
Skadoodle173
Super Smash Bros
Mew2King90
Heroes of the Storm
Khaldor519
Liquid`Hasu508
Other Games
Gorgc4988
Grubby1759
B2W.Neo1417
Beastyqt503
FrodaN353
shahzam235
mouzStarbuck233
Harstem153
Trikslyr61
Organizations
Other Games
gamesdonequick801
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• printf 59
• HeavenSC 23
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Airneanach14
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV568
Other Games
• imaqtpie1173
• Shiphtur200
Upcoming Events
Afreeca Starleague
12h 40m
Snow vs Soma
Sparkling Tuna Cup
14h 40m
WardiTV Invitational
16h 40m
CrankTV Team League
17h 40m
BASILISK vs Streamerzone
Team Liquid vs Shopify Rebellion
Team Vitality vs Team Falcon
BSL Team A[vengers]
19h 40m
Gypsy vs nOOB
JDConan vs Scan
RSL Revival
21h 40m
Wardi Open
1d 16h
CrankTV Team League
1d 17h
Replay Cast
2 days
WardiTV Invitational
2 days
[ Show More ]
CrankTV Team League
2 days
Replay Cast
3 days
CrankTV Team League
3 days
Replay Cast
4 days
The PondCast
4 days
CrankTV Team League
4 days
Replay Cast
5 days
WardiTV Invitational
5 days
CrankTV Team League
5 days
Replay Cast
6 days
Liquipedia Results

Completed

Acropolis #4 - TS2
WardiTV TLMC #15
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
EC S1
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
BSL 21 Non-Korean Championship
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
CranK Gathers Season 2: SC II Pro Teams
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.