How to Manage Repeated Failures
Within a Block Agent, the looping configuration defines how the agent handles situations where the conversation gets stuck or the user repeatedly fails to provide expected input.
Types of Loops
Edges and Conditions can include looping configuration.
-
Use a loop Edge Use to re-prompt or retry when none of the Conditions are met.
-
Use a loop Condition for fallback scenarios where the agent’s response relies on understanding natural language input.
Things to keep in mind when using loops:
-
A Turn should only have one Edge with the “loop” type. This ensures that fallback behavior is clearly defined and does not cause multiple conflicting re-prompt scenarios.
-
You can only use both Expression-Based and Loop-Based Conditions within a single Turn when an Edge is a “loop” type. In this case, a Loop-Based Condition is allowed alongside an Expression-Based Condition. This enables fallback scenarios where both structured evaluation and NLU can be used.
Loop Properties
|
Property |
Description |
|---|---|
|
threshold |
The number of loops before the fallback action is initiated. |
|
messages |
Predefined messages when the threshold is reached. |
|
connect_to |
The target turn the call is transitioned to. |
|
kpis |
Analytic data to publish. |
Sample Loop
looping:
threshold: 6
messages:
- It seems like we're having a hard time understanding each other. Let me transfer you to someone who can assist you further.
connect_to:
turn_id: '800005'
kpis:
- kpi_name: Transfer:Reason
value:
default: Max Attempts Reached
source: static
kpi_type: string
In the example above, if the conversation loops through the same Turn 6 times without progressing:
-
The agent speaks the failure message.
-
The call transitions to turn 800005 (Transfer to agent in this case).
-
A KPI is published indicating the reason (why the call ended up being transferred to the agent).
These settings prevent an infinite loop experience while maintaining a positive user experience.