Pages

Wednesday, December 20, 2017

How to develop your own chat bot Android app

The Bot Libre Android SDK makes it easy to develop your own chat bot app, or add a chat bot to your own app. You can create an app for your business, or to make money from mobile ads and upgrades, or just for fun.

Bot Libre's own demo apps have over 1 million downloads on Google Play.

The Bot Libre SDK is more than just a library, it includes a complete Android app. The SDK includes a connection API that wraps Bot Libre's web API, and a user interface for all of Bot Libre's components including:

  • Chat bots
  • Live chat
  • Avatars
  • Forums
  • Issue tracking
  • User management
  • Graphics library
  • Script library

The SDK chat bot interface includes support for:

  • Text chat
  • Speech
  • Continuous speech recogition
  • Animated avatars
  • Mobile assitant commands

Getting Started

You have 4 choices when using the Bot Libre SDK, depending on your functionality requirements and programming ability.

  1. Use the complete Bot Libre app or Demo app. You only need to change the bot information, logos, and redeploy the app.
  2. Use some of the UI components of the Bot Libre app and customize them to suite your needs (refer to the SDK source code).
  3. Use the botlibre-sdk.jar and the SDKConnection Java class. This gives you access to the low level API to build your own app interface (refer to the JavaDoc for more information).
  4. Use the Bot Libre web API directly using HTTP calls and XML (refer to our web API for more information).

This "how to" article follows the first method, which is the easiest way to build an app.

Although this method requires minimal programming, developing an Android app requires you use and understand Java, Android Studio, and how to build and deploy an Android app. For information on developing Android apps see, developer.android.com.

If you are not an Android developer we would recommend Bot Libre's app development service. We can develop you your own app for as little as $100 through our Diamond upgrade, contact sales@botlibre.biz for more information.

Step 1 - Download Android Studio

Android apps are normally developed using Android Studio. You can download Android Studio here.

You will need to install Android Studio on your computer, and also install the Android SDK, and an Android emulator.

Step 2 - Open Bot Libre Demo app

The Bot Libre SDK includes a complete demo chat bot app, with the full source code. You can download the demo "SantaBot" app from GitHub here.

The demo app includes an Android Studio project, so you can open the project in Android Studio. You should be able to build and run the project from Android Studio in the emulator, or on your phone.

Step 3 - Change the Bot Info

The demo app uses the "Santa Bot" app. You will want to change it to use your own bot. If you do not have a bot yet, you can create on Bot Libre by following this article.

If you go to you're bot's main page on Bot Libre, you can get its "Id" from its "Details" tab. You can also get your user accounts "Application ID" from your "User Details" page. Copy both of these values.

Open the "MainActivity.java" file in Android Studio and update the static variables, "applicationId", "launchInstanceId", "launchInstanceName", and save the file.

Now when you run your app it should use your bot.

Step 4 - Change Icons and Images

Next you will want to change the app's splash image and icon for your own bot.

To change the app's icon in Android Studio right click on project or select the menu "File", "New", "Image Asset", and create a new icon for the app.

You will also want to update the image files "icon.png", "logo.png", and "bot.png" in the "res" "drawables" directory.

Step 5 - Change the App Info

An Android app is defined by its manifest.xml file and application package. You need to choose your own app/package name and update your manifest file.

The Android package also affects how the special "R" class is generated in Android. Unfortunately this R class must match the application package, so you need to rename all imports to the "org.botlibre.santabot" package. To do this select the menu "Edit", "Find", "Replace in Path". Enter the old package and the new package and replace all references.

You should be able to new build and deploy your new app. You can also build an "apk" file, and upload the file to Android app stores such as Google Play.

Tuesday, December 19, 2017

Announcing Bot Libre Desktop - Your own personal bot for your PC or Mac

Bot Libre Desktop is the desktop version of the Bot Libre platform for your PC or Mac.

Bot Libre Desktop lets you create your own personal AI bot on your own computer. The bot is stored offline locally on your own computer without limits, and with complete privacy.

Download

Bot Libre Desktop uses the open source Bot Libre AI Engine, and the open source Bot Libre Desktop application from GitHub. Download the source and customize or contribute to the application.

Bot Libre Desktop on GitHub

Bot Libre Desktop let you choose from several different bot templates, including AI Bot, Julie, and Eddie.

You can chat with your bot using speech and an animated avatar. You can correct your bot's responses to train it to say new things.

Bot Libre Desktop is a Java application. You must have Java installed on your computer. If you do not have Java get in from here.

Download Java

The download is a zip file. To install the program just unzip it into your program files directory and runs the .exe file, or make a shortcut to the .exe in your start menu, menu bar, or desktop.

To run on Mac or Linux run the botlibre-desktop shell file, or run:

java -jar botlibre-desktop.jar

Monday, December 18, 2017

Bot Analytics

Bot Libre now supports bot analytics and charts for chat and social media. Analytics provide statistical data on how well your bot is performing, including analytics such as engaged conversations, user sentiment, and response confidence.

You can now view your bot's analytics for various date ranges as a chart or as data in the table. This newly introduced feature allows you to see how popular your bot is, and compare your bot to other bots using analytics. You can access your bot's analytics page from the bot's 'Admin Console' by clicking on the 'Analytics' link.

To view the bot's analytics chart simply select the media type from 'Chart' drop down select box. By default you'll see your bot's analytics chart for the current week. However, you can view your bot's analytics chart for duration period of either day, week, month, or everything. You can also group your bot's analytics either by day, week, or month using 'Group By' drop down select box. 'Group By' select enables you to view your bot's analytics chart for a given duration period as cumulative set of points. The grouping of data points makes the bot's general analytic trend direction more apparent. After selecting the media type chart, duration and group, you can then view or hide a particular bot's statistic by checking or unchecking the check box beside each analytic name.

Figure 1: Analytic Options

Figure 1 shows all analytics for every social media type. Note that the colour of analytic name beside each check box corresponds to the colour of each analytic curve on the chart. Also note that in some circumstances you may see less analytics curves on the graph than the analytic name checks. This is because some curves are plotted on top of other analytics curves because their data point sets are identical.

Figure 2: Analytics Chart for Social Media

Figure 2 shows graphs of selected bot's analytic for 'All' social media types. Note that the number of analytic curves is less than the number of checked bot's analytics because some curves have the same data points and hence overlay each other.

Analytics

Bot Libre provides many different analytics to help you monitor your bot's effectiveness in chat and social media. Analytics for tracking conversations, messages, engaged conversations, conversation length, sentiment, and confidence are available.

Analytic Description
Conversations Total conversations the bot had for all chat and social media platforms.
Messages Total messages the bot had for all chat and social media platforms.
Conversation Length Total conversation length the bot had for all chat and social media platforms.
Engaged Conversations Total number of conversations that bot had with at least three messages.
Default Responces Total number of messages the bot did not find an answer for. When the bot does not know a response to a question, it uses its 'default' response.
Confidence Avarage confidence the bot had on its responses based on the user question and the bot's matching trained question. Exact question matches and pattern matches are considered to be 100%, and default responses are 0%.
Sentiment User's average sentiment or emotion to the bot's responses, either good or bad. If the user's questions seem very happy the sentiment will be 100%. If the user seems very unhappy the sentiment will be -100%. If the user did not express any emotion, then the sentiment will be 0%.
Connects Total number of times a user or admin connected to the bot through the web or mobile.
Chats Total number of chats that the bot had.
Live Chats Total number of live chats that the bod had.
Errors Total number of errors the bot had while responding to chats.
Response Time How long it took the bot to respond the the user's message for chat and all social media platforms.
Imports Total number of scripts or response lists imported into the bot.
Tweets Total number of tweets the bot posted for Twitter social media.
Retweets Total number of retweets the bot has made for Twitter social media.
Tweets Processed Total number of tweets bot has read.
Direct Messages Total number of private, user to user chat message for Twitter social media.
Facebook Posts Total number of Facebook posts the bot has made for Facebook social media.
Facebook Likes Total number of Facebook posts that bot 'likes'.
Facebook Messages Total number of Facebook posts processed by the bot for Facebook social media.
Facebook Messages Processed Total number of Facebook messages that the bot has read for Facebook social media.
Skype Messages Total number of Skype messages the bot has read.
Kik Messages Total number of Kik messages the bot has read.
WeChat Messages Total number of WeChat messages the bot has read.
Slack Messages Total number of Slack messages the bot has read.
Slack Posts Total number of Slack posts the bot has made for Slack social media.
Telegram Messages Total number of Telegram messages the bot has read.
Telegram Posts Total number of Telegram posts the bot has made for Telegram social media.
Email Total number of emails the bod has sent.
Emails Processed Total number of emails the bot has read.
SMS Sent Total number of SMS messages the bot has sent.
SMS Processed Total number of SMS messages the bot has read.

Bot Analytics Table

Figure 3: Bot Analytics Table

Figure 3 shows the same bot's analytics data point as graphs above, but only inside a table.

Tuesday, December 12, 2017

How To Connect A Bot To Wolfram Alpha

Through Bot Libre, you can now connect your bot with Wolfram Alpha. This "How To" guide will give you a step by step process to connect your bot with Wolfram Alpha.

Step 1 - Create a Bot

First you must create a bot that you want to connect to Wolfram Alpha, or you can use one of your existing bots. To create a bot, follow the instructions here: How to create your own chat bot in 10 clicks.

Step 2 - Sign up for Wolfram Alpha

Go to the Wolfram Alpha Developer site and click the 'Get API Access' button.

Next, click the 'Create account' button, or sign in if you already have a Wolfram Alpha account.

Step 3 - Get Wolfram Alpha AppId

Once you have signed in, you will be taken to the Wolfram Alpha Developer Portal. Click the 'My Apps' tab to start getting your AppId.

Click the 'Sign up to get your first AppID' button to continue.

A form will pop up with some information that needs to be filled out. Once you have finished filling out the required information, click the 'Sign up' button.

On the next screen, click the 'Get an AppID' button.

You will now need to fill out some more information on the following form. Click the 'Get AppID' button when finished.

You will now be shown a screen with your new Wolfram Alpha AppId. Copy this down, as it will need to be entered into your bot's admin page on the Bot Libre site.

Step 4 - Enter Wolfram Alpha AppID Into Bot's Admin Page

Return to the Bot Libre website and navigate to your bot. Click the gear icon to go to your bot's admin page.

Click on 'Wolfram Alpha' to go the Wolfram Alpha settings page.

Enter your AppID from the Wolfram Alpha Developer Portal into the 'Wolfram Alpha App Id' field. Press the 'Save' button to complete setup.

Your bot is now connected to Wolfram Alpha.

Step 5 - Self Scripting

You can query Wolfram Alpha through Self scripting by calling the WolframAlpha.query() function. It takes a single string parameter and returns the result of the query.

Here is an example of a simple Self script that will answer simple questions using Wolfram Alpha:

state WolframAlpha {
    pattern "what is *" answer forward();
    pattern "where is *" answer forward();
    pattern "who is *" answer forward();

    function forward() {
        return WolframAlpha.query(sentence.toString());
    }
}