# Context Management

Configure how your bot handles interrupted flows, context switches, and input validation across all bots in your tenant by navigating to **Settings > Configuration > Context Management**.&#x20;

## Unfinished context

Settings that control whether the Aisera Platform prompts users to resume flows they abandoned before completing them.

### Show UnFinished Context Hint

| **Type**    | Checkbox |
| ----------- | -------- |
| **Default** | Disabled |

When a user starts a multi-step flow and then switches topics before completing it, they are prompted to resume the original request after their current conversation ends. If no unfinished context is found, the Aisera platform falls back to surfacing any pending to-do intent reminders instead. Enable this in self-service support scenarios where incomplete flows, such as abandoned password resets or unfinished ticket submissions, are common.

The resume prompt is customizable via the `recommendation_continue_context_message` message in Conversation Messages. See [Conversation Messages](https://app.gitbook.com/s/ksUDWGr9UTfOpa53PosP/how-to-set-up-an-aiseragpt-bot/add-conversation-messages) instructions on editing this message.

See also: [Max reminders for unfinished intents](#max-reminders-for-unfinished-intents)

### Max reminders for unfinished intents

| **Type**     | Integer                                                       |
| ------------ | ------------------------------------------------------------- |
| **Default**  | 1                                                             |
| **Requires** | [Show UnFinished Context Hint](#show-unfinished-context-hint) |

Sets how many times the Aisera Platform reminds a user about intents they didn't select during a disambiguation prompt. Each reminder decrements the count; when it reaches zero, that intent is no longer surfaced. Increase this value if your users frequently get sidetracked mid-session and benefit from repeated nudges, or leave it at `1` if a single reminder is sufficient or if repeated prompts would feel intrusive.

{% hint style="info" %}
This setting does not apply to IVR channels. Disambiguation on IVR is presented inline and unresolved intents are not tracked.
{% endhint %}

## Flow exit hints

Settings that control whether the Aisera Platform reminds users how to exit a flow or live agent session.

### Show Exit Context Hint Message

| **Type**    | Checkbox |
| ----------- | -------- |
| **Default** | Enabled  |

When a user is mid-flow and a step hasn't completed, the Aisera Platform displays a hint reminding them how to exit or restart. On channels that support buttons, the Aisera Platform renders **Cancel** (and **Escalate**, if configured) as clickable options. On text-only channels, the Aisera Platform displays the equivalent as plain text.

The hint message is customizable via the `flow_exit_hint_message_key` message in Conversation Messages. To include an escalate option, configure the `flow_exit_with_escalate_hint_message_key` message with two `%s` placeholders. The first resolves to the exit command word, the second to the escalate command word. See [Conversation Messages](https://app.gitbook.com/s/ksUDWGr9UTfOpa53PosP/how-to-set-up-an-aiseragpt-bot/add-conversation-messages) for instructions on editing these messages.

Keep this enabled for most deployments, it gives users a clear recovery path when they get stuck mid-flow. Disable it only if your channel UI already provides a persistent way to exit or restart.

{% hint style="info" %}
The exit and escalate command words are set by the Flow Exit Command and Flow Escalate Command configurations in Conversation settings.&#x20;
{% endhint %}

### Show Exit Hint in Live Agent Message

| **Type**    | Checkbox |
| ----------- | -------- |
| **Default** | Enabled  |

When a user is in a live agent session, the Aisera Platform appends a hint to agent messages reminding them how to exit the conversation. Keep this enabled so users always have a visible reminder of how to exit a live agent session. Disable it if the hint creates visual clutter in your live agent interface.

The hint message is customizable via the `live_agent_exit_hint` message in Conversation Messages. Include `%s` in a custom message where you want the exit command word inserted. See [Conversation Messages](https://app.gitbook.com/s/ksUDWGr9UTfOpa53PosP/how-to-set-up-an-aiseragpt-bot/add-conversation-messages) for instructions on editing this message.

{% hint style="info" %}
The exit command word is controlled by the [Flow Exit Command](https://docs.aisera.com/aisera-platform/tenant-setup/aisera-platform-configuration/conversations/flows#flow-exit-command) configuration in Conversation settings.
{% endhint %}

## Matching thresholds

The three thresholds below govern different stages of input matching: two work in sequence during flow field validation, and one operates independently for context-switch detection.

### Entity Matching Score Threshold

| **Type**    | Decimal (0.0–1.0) |
| ----------- | ----------------- |
| **Default** | 0.49              |

Sets the minimum similarity score a candidate value must reach to be considered a possible match for user input during a flow step. Candidates below this threshold are discarded immediately; candidates that clear it but fall short of Exactly Matching Score Threshold are surfaced as disambiguation options for the user to choose from. Lower this value if users are frequently getting no-match responses for inputs that are close to expected values. Raise it if disambiguation prompts are appearing for inputs that are clearly wrong.

{% hint style="info" %}
This threshold is the first filter in a two-step pipeline. [Exactly Matching Score Threshold](#exactly-matching-score-threshold) is applied after this one to determine whether a surviving candidate is accepted automatically or presented for disambiguation.
{% endhint %}

### Exactly Matching Score Threshold

| **Type**    | Decimal (0.0–1.0) |
| ----------- | ----------------- |
| **Default** | 0.9               |

Sets the minimum confidence score required to accept a user's input during a flow step without prompting for clarification. Input that scores at or above this value is accepted and the flow continues; input that falls below triggers a clarification prompt or disambiguation. Lower this value if users are encountering unnecessary clarification prompts for inputs that are clearly correct. Raise it if flows are accepting ambiguous inputs without asking for confirmation.

{% hint style="info" %}
&#x20;This threshold works in sequence with Entity Matching Score Threshold. Entity Matching Score Threshold filters out low-confidence candidates first; Exactly Matching Score Threshold is then applied to the remaining candidates. Adjusting one without considering the other may produce unexpected results.&#x20;
{% endhint %}

### ContextSwitch Matching Score Threshold

| **Type**    | Decimal (0.0–1.0) |
| ----------- | ----------------- |
| **Default** | 0.8               |

Sets how closely a user's message must match a previous open flow's expected input for the Aisera Platform to resume that flow instead of treating the message as a new request. Lower this value if users are frequently unable to resume previous flows when their input is close but not scoring high enough. Raise it if the Aisera Platform is incorrectly resuming old flows in response to new, unrelated messages.

{% hint style="info" %}
This threshold uses strict greater-than comparison: a score of exactly `0.8` does not qualify. The input must score above the threshold, not equal to it.
{% endhint %}

See also: [Max Context Search Depth](#max-context-search-depth)

## Flow input handling

Settings that control how the Aisera Platform handles invalid input, retry attempts, and context switching during flow execution.

### Max Context Search Depth

| **Type**    | Integer |
| ----------- | ------- |
| **Default** | 3       |

Limits how many previous open flows the Aisera Platform searches when trying to resume a prior conversation after a context switch. Increase this value if your users frequently have multiple simultaneous open flows and need the Aisera Platform to look further back to resume the right one. Keep it low if you prefer the Aisera Platform to start fresh quickly rather than attempting to reconnect to older flows.

See also: [ContextSwitch Matching Score Threshold](#contextswitch-matching-score-threshold)

#### Max UserInput Retry Number

| **Type**    | Integer |
| ----------- | ------- |
| **Default** | 2       |

Sets how many times the Aisera Platform prompts a user to clarify or re-enter their input before closing the current flow step. Both disambiguation prompts and re-entry prompts count against the same counter, which resets for each new input step within the flow. Increase this value for flows with complex or technical input fields where users are likely to need more attempts. Decrease it if users are getting stuck in long clarification loops.

### Show Invalid UserInput Hint

| **Type**    | Checkbox |
| ----------- | -------- |
| **Default** | Enabled  |

When a user's input fails validation during a flow step, the Aisera Platform displays an additional hint explaining the specific requirement, for example, a valid number range or date format. The hint appears alongside the standard retry prompt. If the validator did not produce a specific error message, no hint is shown regardless of this setting. Keep this enabled for flows that collect structured input such as numbers, dates, or formatted strings. Disable it if validation messages are too technical or if you prefer a cleaner retry experience.

{% hint style="info" %}
This setting applies to re-entry prompts only. Disambiguation prompts, where the Aisera Platform presents multiple possible matches for the user to choose from, are not affected.
{% endhint %}

### NewContext for Fallback flow mismatch user input

| **Type**    | Checkbox |
| ----------- | -------- |
| **Default** | Disabled |

When a user's response doesn't match what the Fallback flow expects, the Aisera Platform starts a fresh conversation immediately instead of retrying within the Fallback flow. Enable this if users are frequently getting stuck in Fallback flow retry loops for inputs that are actually valid requests Aisera could handle, letting a misunderstood input escape the Fallback flow immediately rather than exhausting retries first.

{% hint style="info" %}
This setting applies to the Fallback flow only. All other flows continue to use standard retry behavior regardless of this setting.
{% endhint %}

## Display limits

Settings that control how many options the Aisera Platform presents when a flow step asks a user to choose from a list.

### Max Quick Reply Entries

| **Type**    | Integer |
| ----------- | ------- |
| **Default** | 200     |

Sets the maximum number of options the Aisera Platform presents when a flow step asks a user to choose from an entity list. If the number of available options exceeds this limit, the list is capped before it reaches the user. Increase this value if users are not seeing all available options for large entity lists. Lower it if large option lists are causing performance issues or an overwhelming user experience.
