Skip to content
David Hamilton edited this page Oct 16, 2017 · 5 revisions

Contents

Core Concepts
  Intent
  Expression
  Trigger
  Response
  Expectation
  Memory
Contributing to Bishop AI
Community


Core Concepts

Intent

Intent links natural language textual input to a trigger. When input is sent from a client to the server, the server first creates an expression from the input and then matches the expression against all of the intents defined by the enabled plugins. The intent matching uses template pattern matching (like simplified regex) to allow matching many variations of the same input. Matching is done in order of specificity of the intent (the most specific intent pattern that matches will win over a less specific matching intent). If no matches are found, a Naive-Bayes classifier is used to attempt to find the closest match.

Expression

An expression represents user input sent by a client. The user input is normalized (spelling corrections, expand contractions, word substitutions, etc.) and stored along with the raw input value. The expression has utilities for searching through the raw and normalized values.

Trigger

A trigger is a function that is executed when an expression is matched to an intent. The trigger function can perform any task possible from Node. This function is given a deferred promise (allowing for asynchronous tasks) that should be resolved if the trigger can correctly handle the input or rejected if not. The trigger may resolve a single response or array of responses if applicable. The trigger function is also passed the input expression, a set of utility functions for handling storage and retrieval of memories and data defined by the intent pattern.

Response

A response represents a value sent from the server to the client. The response may be sent as a result of a trigger executing or because the server could not match the input to an intent. Like intent, responses are built as template patterns allowing for a single template to generate many alternate responses where one will be chosen at random to be sent to the client. A response may also define a set of expectation intents that are used to expect a response from the client.

Expectation

An expectation is a short term intent that takes priority over the rest of the intents during matching. These are set by responses sent by the server. This is to allow the AI to send questions to the client and expect a response that can be matched to the expected intent thereby executing a trigger that may perform some action and send another response.

Memory

Bishop AI keeps a key value store for storing "memories" set by the server while interacting with a client. These memories can be set and retrieved by triggers when intent is matched. Both an in-memory database (short-term) and JSON datastore (long-term) are used to store memories. While the user is not authenticated, memories are stored in short-term. When a user authenticates, the short-term memory is flushed into long-term and stored in the JSON datastore.

Contributing to Bishop AI

In order for Bishop AI to grow and get smarter, we need developers to help contribute to the project. When you're read, please read the Guide for contributing to Bishop AI.

Community

As the community grows, we'll add more ways to communicate with members. For now, we are trying out GitQ.

GitQ