Depending on the state of a conversation you might want to provide a different answer to your end-users. Conversational AI Cloud calls this conversation state context, and the factors that might influence it are determined through context variables.

A context variable is a single indicator of the state (or environment) a conversation is taking place in. An example could be the context variable "logged_in" that could be true if your end-user is authenticated on your website, and false if they aren't authenticated. You might want to present a different answer to that individual if they are logged in versus when they aren't. Context variables are:

And they can be set via:

If the same context variable is set in different ways for an interaction then the following order is used to prevent conflicting definitions (first in the list is the lowest priority):

  1. Web Conversations JavaScript API
  2. Query parameter
  3. Context Variable webhook

The sole purpose of a context variable is to provide a different answer once an article (Q&A), event, or dialog (node) is matched by Conv. AI Cloud. Contextual answers can be defined through the Conv. AI Cloud CMS.