Contexts overview

Contexts represent the current state of a user's request and allow your agent to carry information from one intent to another. You can use combinations of input and output contexts to control the conversational path the user takes through your dialog.

The example agent below asks you two questions and uses a context to carry your answers to the final intent, allowing the agent to repeat both your answers in one response.

Enter "Ask me" to get started.

The intent that collects your favorite food uses an output context to "remember" what you said. The same context is used as the input context to the next intent, which collects information about your favorite drink.

When referring to the collected parameters, special syntax is used in the responses. To refer to a parameter collected via context, #context-name.parameter-name is used. To refer to a parameter collected in the last reply from a user, $parameter-name is used. For this agent, the parameters in the response look like this:

  • So your favorite food is #food-context.dishes.original and your favorite drink is $beverage.