Resources

Resources are configurable strings that eXvisory chatbots use to ask questions, to help users answer those questions and to explain what the chatbot is doing and why.

Most eXvisory resources use markdown for simple formatting and templates to vary resources based upon values returned by previous logic rule evaluations (which we call facts). Resource templates are a very important and useful feature (when used with restraint) for enabling the reuse of tests within different contexts and reducing deep logic network complexity.

Markdown

You can add markdown formatting to most eXvisory string resources, but we suggest you limit yourself to light formatting (bold, italic, inline links, lists and inline code) as your eXvisory chatbot may also be accessed via app or messaging channels with limited markdown support.

Our default web chatbots have good markdown support (thanks to remarkable.js).

Facts

Logic rules evaluated by the eXvisory inference engine stores their results in memory, where they can be referred to by resource templates. We refer to them as facts.

device os (query test) at https://dev.exvisory.ai/apps/sample-mobile
{
"_class" : "device",
"label" : "os",
"comment" : "device operating system",
"_values" : [ "ios", "android", "windows", "unknown" ],
"resources" : {
"android" : "Android",
"ios" : "iOS (Apple)",
"prompt" : "Which operating system does your device use?",
"unknown" : "Don't know (or not one of the above)",
"windows" : "Windows"
}
}

The sample device os query test above prompts for one of the listed "_values" by presenting a multiple choice list of the corresponding resources. If the user, for example, selected "iOS (Apple)" then the test result is "ios" (the resource key from the "_values" list).

Evaluating this test will create two facts in memory:

  • device_os - which contains "ios"

  • device_os_usr - which contains the user-legible "iOS (Apple)"

_usr facts are automatically created for boolean and multiple choice query tests, and can be manually overriden by special Query test and Synthetic test resources.

The eXvisory inference engine defines some system facts:

  • exvisory_version - the deep logic network version

  • exvisory_aiq - the artificial IQ score of the deep logic network

  • exvisory_retries - a list of query tests to retry (see Query test)

Templates

Most eXvisory resources can use templates to refer to previous logic rule evaluations (facts).

settings flight_mode (query test) at https://dev.exvisory.ai/apps/sample-mobile
{
"_class" : "settings",
"label" : "flight_mode",
"comment" : "TRUE if device flight mode enabled",
"_values" : [ "y", "n" ],
"resources" : {
"help" : [
"Flight mode switches off your device's wireless networks (mobile/cellular, WiFi ",
"and Bluetooth) so if accidentally enabled it can cause all sorts of ",
"network problems. To check if it is enabled see:\\n\\n",
"{% if device_os == 'windows' %}",
"- [How to change flight mode on a Windows Phone](https://www.wikihow.com/Change-the-Flight-Mode-on-a-Windows-Phone)\\n",
"- [GOOGLE: windows mobile flight mode](https://www.google.com/search?q=windows+mobile+flight+mode)\\n",
"{% elseif device_os == 'android' %}",
"- [How to put an Android phone into flight mode](https://www.wikihow.tech/Put-an-Android-Phone-Into-Airplane-Mode)\\n",
"- [GOOGLE: android flight mode](https://www.google.com/search?q=android+flight+mode)\\n",
"{% else %}",
"- [Use Airplane Mode on your iPhone, iPad or iPod Touch](https://support.apple.com/HT204234)\\n",
"- [GOOGLE: apple ios flight mode](https://www.google.com/search?q=apple+ios+flight+mode)\\n",
"{% endif %}"
],
"prompt" : "Is your {{device_which}} in flight mode?"
}
}

The sample query test uses {% if ... %} templates to provide different "help" for different mobile device operating systems (using the result of the previous device_os test) and a {{ device_which }} template to insert the device make and model into the query "prompt".

This is key functionality as it means we only need to create a single settings flight_mode test to handle the three major mobile device operating systems (in our sample application), and we can keep the concept of the test very high-level and generic, i.e. "is the device in flight mode?". The test also keeps all specific information about how to check flight mode external to the deep logic network, in the form of links to external curated Internet pages.

To successfully scale deep logic networks you should try to keep logic rules very high-level and generic and focus on capuring diagnostic process rather than specific product knowledge, which should be stored externally and referred to by links.

eXvisory uses the Pebble template engine - see it's wiki for full documentation.