Friday, November 20, 2020

Detecting a person's gender in an image using deep learning and the Bot Libre analytics API

Bot Libre Analytic lets you easily train your own deep learning neural network without any programming. With Bot Libre you can create your own deep learning neural network for image recognition, audio and speech recognition, object detection, games, prediction, data analysis, and more. To create your own analytic see How to create your own deep learning neural network for image recognition

Bot Libre also has many pretrained analytics trained by us and our users that you can use through the Bot Libre web API from your own web or mobile application. To browse Bot Libre's analytics go here.

Here is the Gender Detector.

You can access it from the Bot Libre website, or you can access it analytic through the Bot Libre web API, or using the Bot Libre JavaScript SDK.

Here is an HTML example of using the Bot Libre JavaScript SDK:

<form method="post" name="fileinfo" enctype="multipart/form-data">
<span>Upload File. </span>
<input type="file" name="file" onchange="uploadImage(this);" accept="image/*">
<div id="test-analytic-image">
<div id="test-object-image">

<script type="text/javascript" src=""></script>
SDK.applicationId = "12345"; // Enter your user's application id from your user page.
var sdk = new SDKConnection();
var analytic = new AnalyticConfig(); = "35935506";

function uploadImage(input) {
var divTestAnalytic = document.getElementById("test-analytic-image");
var divTestObject = document.getElementById("test-object-image");
divTestAnalytic.innerHTML = "";
divTestObject.innerHTML = "";
var files= input.files;
var form = document.getElementById('upload-test-image');
var newDiv = document.createElement("div"); = "5px 10px 5px 5px";
var newImage = document.createElement("img");
newImage.src = URL.createObjectURL(files[0]);
var name = files[0].name;
var type = files[0].type;
newImage.setAttribute("width", "30%");
newImage.setAttribute("height", "30%");
var result = document.createElement("ul"); = "list-ul"; = "inline-block"; = "top";
sdk.sendAnalyticImage(analytic, function(response) {
result.innerHTML =
"<li><b>File Name: </b>" + name + "</li>"+
"<li><b>Image Type: </b>" + type + "</li><hr>";
for (var i = 0; i < response.labels.length; i++) {
if (i > 0) {
result.innerHTML = result.innerHTML +
"<li style='font-size: 14px;'><b>Label: </b>" + response.labels[i] + "</li>"+
"<li style='font-size: 14px;'><b>Confidence : </b>" + response.confidences[i] + "%"+ "</li>";
} else {
result.innerHTML = result.innerHTML +
"<li style='font-size: 16px;'><b>Label: </b>" + response.labels[i] + "</li>"+
"<li style='font-size: 16px;'><b>Confidence : </b>" + response.confidences[i] + "%"+ "</li><hr>";
}, files[0], form, 600);


To use the web API call the end point using a POST HTTP request,

Pass an XML entity for the analytic,

<analytic application='12345' id='35935506'/>

and a multipart form data for the image.



If you would like help using this analytic, or developing your own deep learning solution for your own application contact


Friday, November 6, 2020

How to create an Auto Repair chatbot

An interesting use of chatbots is to help provide quotations for car repairs and services!

1. Creating an Auto Repair Chatbot

Follow this simple tutorial to learn how to create a chatbot.

To set up an Auto Repair chatbot, select auto_repair_template as your bot template.

2. Editing the Chatbot's Responses

To view and edit the chatbot's responses, go to the Training & Chat Logs page.

Then, go to the "Review all responses" page.

Here you will be able to view and edit the bot's responses!

3. Setting up emails

The chatbot can send emails containing the user's info to make it easy for mechanics to provide a quotation for a car service/repair.

First, follow this easy tutorial to connect this chatbot with your email address.

Then, enter your email address into the "Think" command of the final response, as shown:

Now, you will receive an email when a user wants a quotation!


Here is an example of an Auto Repair chatbot on a website

Thursday, October 29, 2020

How to create your own Stock Bot for stock quotes and market information

The Stock Bot template offers financially useful functionality. Using the StockQuote script and your own API key you can have access to stock quotes. This bot is setup with IEX cloud API docs which offers many plans for API keys, even a free version. You must set your API key in the StockQuote script. If you wish for the bot to be able to access more information that is important to you, depending on your IEX cloud plan there exists a lot more information that can be accessed and easily reconfigured in the StockQuote script. You can see the bot in action here.

Consider using the bots Define functionality as well by adding your own definitions to the Define script or even integrating a dictionary API for quick financial definitions. 

If you implement this template in your own bot then navigate to the Bots menu and select New Bot

Fill out the information about your new bot as you wish but ensure to select stock_bot_template from the Template dropdown menu.

Once your bot is created you will then need to update the StockQuote with your personal IEX cloud API key which you can get from their website. To access this script after you bot has been created, select the Admin button. 

Then you want to select the Scripts link to bring you to the active scripts the bot is using. 

Make sure to select the StockQuote scripts and then you can edit it by selecting the Edit button highlighted in the top left.

Finally, navigate to the stockPrice() function and be sure to set the api_key variable to your own key.

Ensure to save the script and then you will be able to start using the bot stock quote functional

Here is the StockQuote script

Chat with the Stock Bot

Thursday, October 22, 2020

How to Train a Deep Learning TensorFlow Analytic to Play Checkers

Bot Libre now allows you to create generic deep learning analytics and train them through our web API. Deep learning analytics can be used for a wide array of purposes to analyze and make predications on data. This example shows how to train a deep learning analytic to play checkers.

You can use either the Bot Libre deep learning library, or the TensorFlow deep learning library. You can choose the inputs, outputs, and layers.

The web API endpoint to train the network is:

The web API endpoint to test the network is:

Create the Analytic

1. Go to the Deep Learning page and create a new analytic.

2. Configure the network with the following settings:

3. Click on "Save", and then "Reset Network".

Train the Analytic

You can use our Java checkers program to train your Checkers analytic.

You can find it here:

1. Clone our BotLibre GitHub repository, and open the file in your preferred Java IDE.

2. Edit apiDetails with your API details:

  • URL to the Bot Libre REST API (this should be
  • Your username
  • Your password
  • Your application ID
  • Your analytic's ID

3. Use the learnGames method to train your analytic. We provide several playing strategies to train with in the Strategy class. Some examples have been provided for you to use.

4. You can use the playGames method to test your analytic against several playing strategies.

Create a Checkers Chatbot

Now that you have an analytic trained to play Checkers, you can create your own Checkers chatbot with your own analytic!

Follow this tutorial to create your Checkers chatbot.

Then, modify line 283 of the Checkers Self script with your application ID and analytic ID to connect it to your analytic.

Here is an example Checkers chatbot for you to try:

Tuesday, October 20, 2020

How to Connect a Bot to WhatsApp

Through Bot Libre and Bot Libre for Business, you can now send and receive WhatsApp messages with your own bot. Currently, WhatsApp requires users to have a formally approved account to send messages, but this can be avoided by working in a sandbox on Twilio. 

Step 1 - Create a Bot 

First you must create a bot that you want to connect to WhatsApp via Twilio, 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 - Create a Twilio account

Click here to go the Twilio website. To create a trial account, click on the "Sign up and start building" button in the middle of the website.

Enter your information on the following form, then click the "Start your free trial" button.

You will then need to verify your email address. Check your email and click on the link.

You will also need to verify your cell phone number. Enter your cell number and click "Verify".

Once you have received your verification code, enter it on the website and press "Submit" to complete your account creation.

Answer the questions from Twilio or click "Skip to dashboard".

Step 3 - Get a phone number from Twilio

From the menu on the left side of the Twilio website, select the circle and three dots icon, shown in red below, and then select "Phone Numbers"


Click the "Get Started" button to begin. Next, click the "Get your first Twilio phone number".

A screen will pop up with a phone number that has been chosen for you. You can accept this phone number by clicking the "Choose this Number" button. If you want to try again for a different phone number, you can click the underlined "Search for a different number" link. Ensure the number you select has voice capabilities.

Step 4 - Connect webhook

Navigate to your bot's page on the Bot Libre website. Go to its admin console by clicking on the gear icon.

Click the "WhatsApp" link to view your bot's Twilio settings. Copy the "Twilio WhatsApp Webhook URL" to your clipboard.

Now return to the Console on the Twilio website and select "Programmable SMS", then "Settings", and finally "WhatsApp Sandbox Settings". 

Next, paste the Twilio WhatsApp Webhook URL into the "When a message comes in" textbox. Scroll to the bottom and press save.

Step 5 - Connecting to your bot on WhatsApp

To join the sandbox, send your join code, found under "Sandbox Participants", to your Twilio number. This will add you to the sandbox where you can begin messaging your bot!

In summary, your bot should now be able to send and receive WhatsApp messages through the sandbox on Twilio. If you encountered any issues, or would like help setting up your bot please email us at or upgrade to our Platinum service and we can build your bot for you.

Friday, August 21, 2020

Running Bot Libre Community Edition using Kubernetes on Amazon AWS

This forum post will go over how to run the Bot Libre Community Edition containers from AWS using kubectl on a Kubernetes setup.

What is Kubernetes?

According to, "Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available."

For an overview of Kubernetes, visit

You can also visit their home page at

Required Software:

  • Kubernetes
  • kubectl

Ensure that kubectl and Kubernetes are configured properly before proceeding


Before starting up the server, make sure to set up your firewall correctly for Bot Libre.

Bot Libre Community Edition requires the following ports to be open:

22 – SSH
80 – HTTP
443 – HTTPS
25 – SMTP
465 – SMTPS
110 – POP3
995 – POP3S
143 – IMAP
993 – IMAPS
6665 – IRC

The procedure for how to set up the firewall depends on the firewall you are using. For example, an Amazon EC2 instance would use security groups. For a typical Linux server, iptables can be used.

For the bare minimums, only the HTTP port needs to be accessible.

AWS Marketplace Product Subscription

You will gain access to the Bot Libre Community Edition container registry by subscribing on the AWS Marketplace.

  1. Go to
  2. Search for Bot Libre Community Edition, and filter for container products.
  3. Click on "Continue to Subscribe".
  4. Read the Terms and Conditions, and click on "Accept Terms".
  5. After your request has been processed, click on "Continue to Configuration".
  6. Select the latest version, and click on "Continue to Launch".

Deploying the Containers

  1. Log in to the Bot Libre Community Edition container registry using the following command:
    • $ aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin
  2. Download our Kubernetes manifest file from our GitHub. This can be done with the following command:
  3. Apply the manifest using kubectl:
    • $ kubectl apply -f kubemanifests.yaml
  4. Wait until the app-web and app-db pods are ready.
    • You can use the following command to watch the status of the pods:
      • $ watch kubectl get pods
  5. (Optional) Set up HTTP port forwarding to the app-web pod with the following command:
    • $ kubectl port-forward --address app-web 80:80
    • This can be repeated for other ports to enable Bot Libre to connect to other services.
  6. Open the home page on a web browser. This will take up to 3 minutes to load. If you are starting the container for the first time, a random admin password will be generated.

Retrieving the Admin Password

  1. Once the page has been loaded on a web browser, use the following command with the container name to retrieve the admin password:
    • $ kubectl logs app-web | grep "ADMIN PASSWORD"
  2. Log in to Bot Libre on your web browser by using the username "admin" and the password you have just retrieved.
    • We recommend that you update your admin password after logging in. This is because if the logs have been erased, then you will no longer be able to access the default admin password.