Photo by Farhang Kokabian on Unsplash

Cisco MindMeld Chatbot Development Framework

And What Can Be Learnt From The Underlying Principles

Introduction

The MindMeld command line interface.
The basic structure of a Cisco MindMeld Conversational AI application. Apps can be seen as an Assistant, Domains as skills. Followed by Intents and Entities.

Positives

Not So Positives

Development Framework Concepts

Domains

nlp.process("please set my alarm to 8am for tomorrow")
{ 'domain': 'times_and_dates',
'entities': [ { 'role': None,
'span': {'end': 38, 'start': 23},
'text': '8am for tomorrow',
'type': 'sys_time',
'value': [ { 'grain': 'hour',
'value': '2019-02-16T08:00:00.000-08:00'}]}],
'intent': 'set_alarm',
'text': 'please set my alarm to 8am for tomorrow'
}

Intents

shut the {bathroom|location} door
{all|all} close now
close {front|location} door
close the {master bedroom|location} door
close my {bedroom|location} door
close the {bathroom|location} door
close the {back|location} door
close doors
close {front|location} door
{entity_example|entity_name}

Entities

Here is an Example of the Organization of Entities with White List and Canonical Name

Dialog State Management

Here are the intents and states in the home assistant blueprint, as defined in the application dialogue handler modules in the blueprint folder. However, dialog states can be trigged by entities or other conditional combinations.
The dialog state management of the intent specify_location. The one-to-one matching of the intent to the dialog state is evident with complex conditions.
from mindmeld import Application

app = Application(__name__)

@app.handle(domain='stores', intent='greet')
def welcome(request, responder):
pass

@app.handle(domain='stores', intent='exit')
def say_goodbye(request, responder):
pass

@app.handle(domain='stores', intent='get_store_hours')
def prompt_for_store(request, responder):
pass

@app.handle(domain='stores', intent='get_store_hours', has_entity='store_name')
def send_store_hours(request, responder):
pass

@app.handle(domain='stores', intent='unsupported')
@app.handle(domain='unknown')
def send_help(request, responder):
pass

@app.handle(targeted_only=True)
def confirm_store(request, responder):
pass

Installation

mkdir /home/ubuntu/mindmeld
sudo add-apt-repository universe
sudo apt-get install -y python3-pip
sudo apt install virtualenv
virtualenv -p python3.6 .
source bin/activate
pip install mindmeld
mindmeld
mindmeld blueprint home_assistant
mindmeld num-parse
python run.py
from mindmeld.components.nlp import NaturalLanguageProcessor
import mindmeld as mm
mm.configure_logs()
nlp = NaturalLanguageProcessor(app_path='home_assistant')
nlp.build()
from mindmeld.components.dialogue import Conversation
conv = Conversation(nlp=nlp, app_path='home_assistant')
conv.say('set alarm for 6am')

Conclusion