Before we start install Program O, let’s get to know about what is program o and how it works.
What is Program O?
Program O is an open source AIML interpreter written in PHP with MySQL. With the help of Program O you can easily create your own chatbot. It also supports API, so that you can easily experiment it with your own projects or integrate with Facebook Page Messenger or Telegram Bot.
You can test Program O here
What is AIML?
AIML stands for Artificial Intelligence Markup Language (by Richard Wallace), is an XML dialect for creating natural language for chatbots. Few important tags of AIML are <aiml>, <category>, <pattern>, <template>. I’m not going to explain all the tags in AIML, you can learn them here.
Following is the simple AIML Example
<aiml version = "1.0.1" encoding = "UTF-8"?>
<pattern> HI </pattern>
Bot: Hello There!
Install Program O
- PHP version 5.3 or above
- MySQL version 5.0 or above
- Apache 1.3+
Download latest version of Program O from Github or clone it in git bash
git clone https://github.com/Program-O/Program-O.git
Now extract Program O files to the server root or to the folders you want. Let us assume we have extracted the files to folder ‘bot’, so that we access the program o by navigating through url http://example.com/bot/ when installation has completed.
The next step is to create a MySQL database. If you’re using shared hosting you can create MySQL database in your host cpanel.
Now open your browser and navigate through http://example.com/bot/install , a installation page will appear and fill all the Botmaster info, Bot Configuration and Database Configuration as following image and click save.
When everything goes right you will be prompted to next page saying installation is successfull. Now goto http://example.com/bot/admin and enter the username and password that you have entered in Admin Area Username and Password. It will navigate to program o index page.
Note: Don’t forget to delete install folder after installation has completed.
You can update the bot in Current Bot section or you can also create multiple bots in current bot section.
Download collection of AIML files from alicebot
Next step is to add bot personality settings. Enter the details you want to add to bot personality.
Your bot won’t work until you upload AIML files. So next step is to create a AIML file.
Create a AIML file with the extension of .aiml (for ex: wiki.aiml) and add the following code
and upload the aiml files to Upload AIML section, now goto ‘test your bot’ section and type ‘WIKI Einstein’ and the bot will response as follow.
User: WIKI Einstein
Bot: Albert Einstein (/ˈaɪnstaɪn/; German: [ˈalbɛɐ̯t ˈaɪnʃtaɪn]; 14 March 1879 – 18 April 1955) was a German-born theoretical physicist.
<wiki> is an inbuild custom tag in Program O which uses wikipedia api to fetch the result. You can create your own aiml custom tag in following path http://example.com/bot/chatbot/addons/custom_tags/custom_tags.php and set it into work by aiml files.
That’s it your bot is ready to respond. If you have any questions or stuck at any point while install program o please feel free to ask in comment box below.
Program O API
Program O also supports API that can be easily integrated with Facebook Page Messenger, Twitter Bot, Telegram Bot and many. You can check example Program O API response here.
The Program O API requires following parameters:
|bot_id||int||ID of the bot you created|
|convo_id||text||Any string to track conversation|
|format||xml/json||xml / json response|
You can test your bot API by navigating through following URL