Stay organized with collections
Save and categorize content based on your preferences.
Dialogflow
contexts
are similar to natural language context.
If a person says to you "they are orange",
you need context in order to understand what "they" is referring to.
Similarly, for Dialogflow to handle an end-user expression like that,
it needs to be provided with context in order to correctly match an intent.
Using contexts,
you can control the flow of a conversation.
You can configure contexts for an intent by setting
input and output contexts,
which are identified by string names.
When an intent is matched,
any configured output contexts for that intent become active.
While any contexts are active,
Dialogflow is more likely to match intents
that are configured with input contexts that correspond to
the currently active contexts.
The following diagram shows an example that uses context for a banking agent.
The end-user asks for information about their checking account.
Dialogflow matches this end-user expression to the CheckingInfo intent.
This intent has a checking output context, so that context becomes active.
The agent asks the end-user
for the type of information they want about their checking account.
The end-user responds with "my balance".
Dialogflow matches this end-user expression to the CheckingBalance intent.
This intent has a checking input context,
which needs to be active to match this intent.
A similar SavingsBalance intent may also exist for matching the same end-user expression
when a savings context is active.
After your system performs the necessary database queries,
the agent responds with the checking account balance.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-21 UTC."],[[["Dialogflow's contexts are used to understand user expressions by providing necessary conversational context, similar to how humans understand natural language."],["Contexts control conversation flow by setting input and output contexts for intents, identified by string names."],["When an intent is matched, its output contexts become active, influencing which intents are more likely to be matched next."],["Dialogflow matches intents with specific input contexts only when those contexts are currently active, allowing for tailored responses."],["The banking agent example shows how the \"checking\" output context from the `CheckingInfo` intent enables the `CheckingBalance` intent to be matched later when a user asks for their balance."]]],[]]