Context
Last updated
Last updated
A bot sometimes needs to
Remember the information the user provided minutes ago.
Personalize the same response to 2 users differently.
With contextual information like Memory, User Attribute, and NLP Attribute, a bot makes smarter decisions to find a Passing Rule.
A group of user interactions with your bot that take place within a given time frame.
A single session may have multiple messages, button clicks, and transactions. A single user may have multiple chat sessions with your bot, occurring on the same day or over several days, weeks, or months. By default, a session expires after 10 minutes of inactivity. You may customize your bot's session length on the Personality page.
Changing Session Length affects the Time Spent and Sessions stats.
A temporary variable is used to store additional information about a chat session. It is used to remember topics and values that the user was talking about in the current session. Access it in the bot's responses with the merge tag {{memory.property-name}}
.
Here's an example of memory property usage
User: How much is the large pepperoni pizza? Bot: The large pepperoni pizza is $29.90
Bot stores a memory property: item-requested, value: pepperoni pizza
------------- User: How about the small one?Bot remembers "pepperoni pizza" from the item-requested memory property
Bot: The small pepperoni pizza is $19.90
Memory properties are ALWAYS hyphenated (kebab-cased), so item-requested is a valid memory property ✅ but item_requested is NOT ❌
When your session expires, your bot forgets its memory context (i.e. all its memory properties)
A permanent variable used to store custom information about a user messaging your bot. Access the user context (i.e. all user attributes) in User Profiles. It is used to keep track of long-term custom fields like preferences, survey answers, access levels, and transaction activity. It is essential for customer segmentation, which in turn allows you to create personalized chat experiences and targeted broadcasts. Access it in the bot's responses with the merge tag {{user.attribute_name}}
.
User attributes are ALWAYS underscored (snake_cased), so user_address is a valid user attribute ✅ but user-address is NOT ❌
A derived variable from connected Artificial Intelligence (AI) integrations. You may connect any number of AI integrations like Dialogflow and Wit.ai. After adding at least one AI integration, every message sent to your bot is forwarded to the AI integration. The AI integration derives intents, traits, and entities and stores them in the NLP context (i.e. all NLP attributes).
Access it in your bot's responses with the merge tag {{nlp.attribute_name}}
.
NLP attributes are ALWAYS underscored (snake_cased)
A static global variable for your bot, used in any response in every chat with every user. Shortcuts are declared on the Personality page. It is useful for text replacements like on iPhones and Androids, and also for storing environment variables for Developers.
Access it in a conversation with the merge tag {{bot.shortcut_name}}
.
Shortcuts are ALWAYS underscored (snake_cased)
A way to dynamically modify contexts during a session. Once you add actions in stories, it modifies one of 4 contexts: memory, user attributes, user tags, and shortcuts. An action has 3 parts to it:
Property
Function
Value
From our example above, we create a story with one action:
Context | Property | Function | Value | |
A1 |
|
|
|
|
The interaction in our example looks like this:
User: How much is the large pepperoni pizza? Bot: The large pepperoni pizza is $29.90
Bot stores a memory property: item-requested, value: pepperoni pizza
An action has a lifespan.
The number of messages for which a new memory property from an action remains active. The default lifespan of a memory property is 1. This means that the bot remembers that you stored the new memory property item-requested
for 1 more message from the user. After the user replies with 1 message, item-requested
is removed from the memory context automatically. The 3 most commonly used lifespans are
Lifespan | Description | Use |
1 | Remembers the property for 1 more message | Direct answers from users, e.g. Yes/No Questions |
0 | Remembers the property for the entire period of the chat session | Session-wide topics, e.g Browsing subtopics |
-1 | Remembers the property for the current message | Intermediate values for subsequent actions or rules, e.g. Variables for Mathematical Calculations |
Only Memory Properties have customizable lifespans. User Attributes are stored permanently. NLP Attributes have a fixed lifespan value of -1
A block of JavaScript code used in conditions and actions. It is used within a condition for comparisons, or within an action for assignments.
An API request made to external software. There are 2 methods available - GET
and POST
. It is used to collect and update dynamic information in your custom technology infrastructure or integrations, and to pre-populate responses, quick replies, and modify memory and user contexts.