SDM: Installing the Aria ChatBot (Windows implementation)
search cancel

SDM: Installing the Aria ChatBot (Windows implementation)

book

Article ID: 187819

calendar_today

Updated On:

Products

CA Service Desk Manager CA Service Management - Service Desk Manager

Issue/Introduction

This article discusses how to run a basic install of the Aria ChatBot to operate with ServicePoint.  
 
This article only discusses a basic install with minimal configuration for an English language implementation, and does not discuss how to configure or customise the Aria ChatBot functionality.
 
The Aria ChatBot component is a new tool that can be associated with ServicePoint to allow end users to interact with an NLS component as a Virtual Analyst.  The portion that Service Management provides is a series of scripts and components that are used to train and run the ChatBot.
 
The backend of the Aria ChatBot relies on several key components to operate the NLS functionality inherent in a Virtual Analyst:
  • Anaconda:  This is a free and open source module that includes Python and is the underlying platform behind the Aria Chatbot.

  • Rasa:  This is an open source framework that builds on Anaconda to provide message processing and conversational responses to end user input.  It also has a machine learning element to train and improve responses generated to the end user.

  • SpaCy:  This is an open source library that provides natural language processing.  This component of the install may vary depending on the written language that the Aria ChatBot is being deployed for.
 
Aria ChatBot runs through the Rasa Server component which is hosted on a virtual environment that we will be establishing on the Anaconda platform.

You will also need a Service Management 17.3 implementation with xFlow/ServicePoint installed to interface with Aria ChatBot.  Ideally, Aria ChatBot should be installed on a separate server from xFlow and CA Service Management Search Server.  If Search Server and Aria ChatBot are to share the same server, please be sure that adequate hardware requirements are present (Please see Additional Information for details on server requirements).

The instructions below assume Aria ChatBot is being installed on its own dedicated Windows server that has internet access to acquire any needed components to install, and that xFlow and Search MicroService are sharing their own server as part of the Collaboration MicroService configuration.

Environment

CA Service Management 17.3

Resolution

NOTE:  The following instructions were performed using the specified software packages in place.  Testing of any component at any other release levels have not been performed.  This document describes a specific scenario that was tested to reliably implement Aria ChatBot with all requisite components explicitly stated.

The server you will be installing Aria ChatBot should have sufficient system requirements to operate.  The server must also have internet access to download and install its components.  
 
Preparation:
  1. In the Service Management Install Media, mount the ISO file (example:  D Drive) and access D:\filestore\Virtual_Analyst.  You will find a casmBot.zip file which will be needed to complete the implementation.

  2. Download the Anaconda3-2019.07-Windows-x86_64.exe binary.  The location of the binary is here:


  3. Download the Microsoft Visual C++ Build Tools 2015 binary, file "visualcppbuildtools_full.exe".  The location of the binary is here:
    https://www.microsoft.com/en-in/download/details.aspx?id=48159

    Alternate direct download link:
    http://download.microsoft.com/download/5/F/7/5F7ACAEB-8363-451F-9425-68A90F98B238/visualcppbuildtools_full.exe

    Note:  To ensure you are installing the correct component set, make sure you have downloaded "visualcppbuildtools_full.exe".

    If you download file "BuildTools_Full.exe", the product will present as "Microsoft Build Tools 2015".  This is contrary to "visualcppbuildtools_full.exe", which presents as "Microsoft Visual C++ Build Tools".



Install Anaconda:
  1. Locate the Anaconda3-2019.07-Windows-x86_64.exe that you have downloaded.  Right click the file and choose "Run As Administrator" to start the install process.

  2. During the install, you will be presented with a window to "Select Installation Type".  Choose "All Users".


  3. Under "Advanced Installation Options", do not make changes to the options given.  Leave "Add Anaconda to the system PATH environment variable" unchecked and "Register Anaconda as the system Python 3.7" checked.


  4. The installer will take time to complete.  Usually about 3 min or more.

  5. Once the Anaconda install completes, reboot the server.

  6. From the Windows Start Menu, access "Anaconda3 (64 bit)" and click on the "Anaconda Prompt" menu entry. 

  7. Confirm that the correct Python release is in place by running the following command:
    python --version

    It should come back as "Python 3.7.3":

NOTE:  All instructions from here on will be taking place in the "Anaconda Prompt" unless otherwise noted.


Install Microsoft Visual C++ Build Tools 2015:
  1. From the Windows Start Menu, access "Anaconda3 (64 bit)" and click on the "Anaconda Prompt" menu entry.   


  2. CD to the location where visualcppbuildtools_full.exe was downloaded.

  3. Run the command visualcppbuildtools_full to start the install process.


  4. Choose "Default" for the type of installation to take place.  The default option includes the MS Build Tools and C++ Compiler components.

  5. Once the Microsoft Build Tools has completed installation (about 10 minutes), reboot the server.

Setup the Aria Install environment.
 
For purposes of simplicity, we will create a directory structure that will contain both the Aria ChatBot scripts and the associated Rasa virtual environment that Aria will be using.  The Rasa virtual environment will also be created in the next steps.
  1. Create directory C:\Aria (this location is entirely arbitrary but will contain all content associated with the Aria ChatBot)

  2. Unzip the "casmBot.zip" file to location C:\Aria 

  3. You should have a directory setup that looks like this:


  4. Open an "Anaconda Prompt" window.

  5. CD to the location where the virtual environment will be kept, in this case C:\Aria

  6. Run this command to establish the "botenv" virtual environment that Aria ChatBot and Rasa will operate:
    python -m venv --system-site-packages ./botenv

    Important:  We are creating the "botenv" environment under "C:\Aria" to keep the overall environment organised.  The essential components of the environment are all being contained under "C:\Aria".

    When the command returns, run "dir" and you will see all Aria related directory structures created.
 
Install Rasa and SpaCy:
  1. While in the Anaconda Prompt, cd to "C:\Aria" and activate virtual environment by running the following command:
    .\botenv\Scripts\activate

  2. The prompt will return with "(botenv) (base)" preceding the prompt text instead of just "(base)" to indicate the botenv environment has been activated.

  3. Install Rasa by running the following command:
    pip install rasa==1.7.4



    The install process will take some time to complete, a little over 5 minutes depending on server and network capability.

  4. Once the Rasa Install completes, install SpaCy by running the command:
    pip install rasa[spacy]

    The SpaCy install will take about 2 min to run, depending on server and network capability.


  5. Download/install, then link the SpaCy language data model as per your requirements.  To do this, run the following commands in sequence:
    python -m spacy download en_core_web_md
    python -m spacy link en_core_web_md en

    For additional details on the language models available, please review https://spacy.io/models/en.

    Note:  We are installing the "medium" version of the language model per our documentation guidelines, ie "en_core_web_md".  There are other sizes for the given model such as "en_core_web_sm" or "en_core_web_lg" (small and large respectively)

Train and start up Rasa and Aria ChatBot:

NOTE:  Do not use Anaconda Powershell here as a later command to train Rasa will fail if executed in Anaconda Powershell.
  1. From the Windows Start Menu, access "Anaconda3 (64 bit)" and click on the "Anaconda Prompt" menu entry. 

  2. In the Anaconda Prompt, make sure you are running the "botenv" environment in Anaconda.
    cd to "C:\Aria" then run .\botenv\Scripts\activate

  3. cd to the directory containing casm-bot, "C:\Aria\casm-bot"

  4. Run the following command to train the Rasa model. 
    rasa_train

    The Rasa Model training usually takes about a few minutes to complete.  Example of a completed run:


  5. Once the Rasa Model training is complete, run the following command to start Rasa:
    rasa_run

  6. Test that Rasa is working by running "http://SERVER:5005" from a web browser where SERVER is the server name or the FQDN where Rasa and the Aria ChatBot have been installed. 


    You should also see this somewhere in the Anaconda Prompt display (red highlight):


    The above should be what you would see once Rasa is up and running.

    Note:  Leave the Anaconda Prompt up in order to monitor the Aria ChatBot functionality.  If you need to restart Aria ChatBot or make any changes, you must re-train Rasa (rasa_train) before running Rasa (rasa_run).
 
Configure SDM/Xflow:
  1. Login to CA Service Desk Manager as an Admin User

  2. Navigate to Administration -> xFlow Interface -> General

  3. Search for the Configuration key "va.bot.nlu.server.url".

  4. Update the value "configuration value" to the Rasa service we have just established (http://<RASASERVER>:5005)
    Note:  You may need to use an FQDN, i.e:  http://<RASASERVER.DOMAIN.COM>:5005
To test that it all works, login to xFlow, go into ServicePoint, and Aria should be configured and running.




Additional Information

Server/Hardware requirements are documented here:
The above tech doc expands on instructions given in the following doc link:
An offline version of the install process for Aria Chatbot and its constituent components is available.  Two servers are required.  The first server will need to have internet access in order to run the initial online install.  The second server which is the final destination server that is meant to host Aria Chat in an off-line format, which will inherit the configuration materials from the first server.
Instructions for the off-line install element are available here: