Digging into patternsFor more information on the concept of patterns,
head to the Home section on Patterns.For a complete list of patterns and their low-level implementations,
head to the corresponding section in the Reference.
Why Customise Patterns?
Templated Flows for Repair
Think of a pattern as a reusable template for handling a repeatable scenario (cancellation, correction, human handoff, etc.). Because patterns need to work anywhere in your assistant, you typically want to keep them general rather than making them skill-specific.Balancing Consistency and Adaptation
Although you want to keep these templated flows broadly applicable, you may still want to:- Adapt the language of responses (e.g., brand or domain-specific wording).
- Request user confirmation before updating slots (such as in the correction pattern).
- Hand over to a live agent when certain issues arise.
How to Customise Patterns
1. Override a Pattern Flow
To customise a pattern, create a flow in yourflows.yml file with the same name as the pattern. For instance, if you want to change how a cancellation is handled, create a flow named pattern_cancel_flow:
flows.yml
pattern_cancel_flow instead of the default one.
For existing default pattern implementations see to the Reference section on Patterns.
Keep pattern overrides concise. Most patterns interrupt an ongoing flow, so it’s best to return the user to the main conversation quickly.
2. Override Default Actions or Responses
Some patterns make use of default actions, likeaction_correct_flow_slot or action_trigger_chitchat. If you need more control over the logic:
- Create a custom action in your
actions.py. - Reference it in your custom pattern flow and your
domain.yml.
responses: section. Override them with your own text or tie them into the Rephraser if needed.
3. Link Patterns to Other Flows
You can also “jump” from a pattern to another flow (for example, if the user clarifies something and you want to start a brand-new flow). To do this, add a link step at the end of your pattern:flows.yml
transfer_money flow.
4. Human Handoff and Other Special Cases
For certain special patterns likepattern_human_handoff or pattern_chitchat:
- Human handoff: Override
pattern_human_handoffto add your own logic for connecting to a live agent. - Chitchat: By default, chitchat is turned off, and the assistant responds with the default
utter_cannot_handleresponse. You can switch to free-form generation by overridingpattern_chitchatand calling an LLM-based response. - Internal errors: Override
pattern_internal_errorto branch oncontext.infowhen an agent or MCP tool call fails—for example to show tool-specific messages or route to human handoff. See Handling agent and MCP tool failures.