Virtual Assistant

With a virtual assistant, it is possible to talk to several bots in one conversation and to create pipeline steps to allow a variety of features such as redaction and translation, among other conversational features.

A Virtual Assistant has the following components:

  • NLU Engine: NLP used for bot classification. NLU Config
  • Dispatcher: Manages orchestration of a multi bot configuration.
  • Bot Array: A set of bots that a dispatcher can route user input to.
  • Pipelines: A series of steps than can be done as messages are entering (IngressPipeline) or leaving (EgressPipeline) the ServisBOT system
  • Events: Actions tied to non-input related triggers such as session starts, or missed inputs
  • Endpoints: A default endpoint is created automatically when creating a virtual assistant. For additional endpoints make sure the target reference type is set to va.

NLU configurations

Creating a VA Tutorial

Example VA Configurations

{
  "Name" : "MoneyTransferVa",
  "Description": "A virtual assistant to aid monetary transfers",
  "DefaultBotId": "info-bot",
"Bots" : [
  {
    "Type": "BOTARMY",
    "Id": "info-bot",
    "Enabled": true,
    "Properties": {
      "Name": "info-bot"
    }
  },
  {
    "Type": "BOTARMY",
    "Id": "info-bot",
    "Enabled": true,
    "Properties": {
      "Name": "transfer-bot"
    }
  },
],
"NluEngines": [
  {
      "Id": "TestVADispatcher",
      "Type": "BOTARMY",
      "Properties": {
        "Secret": "srn:vault::acme:aws-cross-account-role:awscontent-lex-x-role",
        "Nlp": "Lex"
      }
  }
],
"IngressPipeline": [
  {
    "Id": "CreditCardRedact",
    "Type": "REGEX_REDACT",
    "Properties": {
      "Regex": "(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}"
    }
  }
],  
"EgressPipeline": [],  
"Events": {
  "@SessionStart": [
    {
      "Id": "sessionStartMessage",
      "Type": "SEND_MESSAGE",
      "Properties": {
        "Message": "Welcome to the transfer VA. Type 'help' for more info about what I do, or 'transfer' to make a monetary transfer."
      }
    },
    {
      "Id": "sessionStartMarkup",
      "Type": "SEND_MARKUP",
      "Properties": {
        "Markup": "<TimelineMessage>\n  <List title=\"Please select a number\" selectable=\"true\" interactionType=\"event\">\n     <Item title=\"Option one is here\" id=\"1\"/>\n     <Item title=\"Option two is here\" id=\"2\"/>\n     <Item title=\"Option three is here\" id=\"3\"/>\n     <Item title=\"Option four is here\" id=\"4\"/>\n  </List>\n</TimelineMessage>",
        "Context": {}
      }
    }
  ],
  "@MissedInput": [
    {
      "Id": "missedInputMessage",
      "Type": "SEND_MESSAGE",
      "Properties": {
        "Message": "Sorry, I didn't quite get that, could you phrase that differently?"
      }
    }
  ]
},
"Persona": "ReportBOT",
"Tags": []  
}

VA Properties

  • Name: The name of the VA (Required)
  • Description: A description of the VA (Optional)
  • DefaultBotId: The ID of a bot to assign to the VA by default (Optional)
  • Bots: An array of bots that the VA manages (Required, minimum of 1 bot)
    • Type: The Bot type. Supported types are MOCK, BOTARMY, RASA (Required)
    • Id: A custom ID which is used to refer to this bot elsewhere in the VA config (Required)
    • Enabled: Controls whether a bot can be routed to by the VA or not
    • Properties: Other properties (Required)
      • Name: The name of the bot being referred to.
  • NluEngines: The NLU engine used to parse user input, allowing for natural language recognition. (Required)
    • Id: A custom ID used to refer to this NLU engine elsewhere in the VA config. (Required)
    • Type: The NLU engine type. Supported types are Lex and RASA. (Required)
    • Handlers: An array of different actions triggered by regex (Required)
  • IngressPipeline: A series of steps that occur when a message is sent to the VA. The steps here can include redaction for masking sensitive information, language translation, and more. (Optional)
  • EgressPipeline: The same as the IngressPipeline, just with messages that are sent out from the VA. (Optional)
  • Events: An array of events that trigger actions. (Optional) Supported events are:
    • @SessionStart: Triggers at the beginning of a conversation.
    • @MissedInput: Triggers when an incoming event cannot be understood and/or acted upon by a Bot or NLU engine.
    • @Exception: Triggers when a transient error occurs.
  • Persona: Sets the appearance of the bot in Portal (Optional)
  • Tags: Arbitrary tags for categorizing your VA. (Optional)

Redaction

Redaction can be configured as part of an ingress pipeline. As shown above, the following configuration will prevent credit card numbers from being persisted in the conversation history.

  {
  "IngressPipeline": [
    {
      "Id": "CreditCardRedact",
      "Type": "REGEX_REDACT",
      "Properties": {
        "Regex": "(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}"
      }
    }
  ]
}

The ingress pipeline can contain one or many REGEX_REDACT entries.

Secure Session

Secure Session can be configured as part of an ingress pipeline. As shown above, the following configuration will have secure session running with a check every 60 seconds

  {
  "IngressPipeline": [{
    "Id":"SecureSession",
    "Type":"SECURE_SESSION",
    "Properties": {
      "SecureSessionType": "API_CONNECTER",
      "ApiConnecter": "SecureSession",
      "ValidationInterval": 60
    }
  }],
}
  • “SecureSessionType” currently only supports “API_CONNECTER”
  • “ApiConnecter” is the alias of any ApiConnecter.
  • “ValidationInterval” is how often to validate against the API connector on message ingress

When SecureSession is in use it will fire a “@SecureSessionUnauthorized” event when the ApiConnecter returns a non 2xx response

{
  "Events": {
    "@SecureSessionUnauthorized": [
      {
        "Id": "referenceId",
        "Type": "SEND_MESSAGE",
        "Properties": {
          "Message": "SecureSession check failed"
        }
      }
    ]
  }
}