# Repeat Last Intent Pattern for user-friendly voice bots

**Cognigy Support**  
April 26, 2022

When it comes to voice-based virtual agents, a user could run into the situation that they did not understand the last output message of the AI. This could be the case when the last message contained a lot of information or simply was too long to understand it.

In order to avoid these situations or better-said issues, one can make use of the **Repeat Last Intent** Pattern. This small Flow snippet executes the last triggered intent in Cognigy.AI and therefore all related Flow nodes:

In general, this pattern consists of two different parts:

1. The actual pattern and  
2. the rest of the Flow

The pattern, on the left side of the Flow, concentrates on checking if the current intent is **Repeat** and the **last intent** exists. So, if there was an intent triggered before, the AI says " _Sure, I repeat myself._" and uses a **Think** node to execute the last intents' nodes:

However, the left side of the Flow is only executed when the user triggers the mentioned **Repeat** intent, which is configured as the following:

Thus, such as displayed in the first figure, the user could write " _Can you please repeat this?_$" to execute this pattern. The right side of the Flow just executes the rest of AI's logic while the only specification is the **Add To Context** node which stores the current intent as the last intent in the Cognigy context for temporary storage purposes:

Ultimately, one could use this pattern as shown in the example at the top of a Flow to provide repeating messages in the conversation.

### Best Practices

- [Cognigy.AI Bot Building Checklist](https://support.cognigy.com/hc/en-us/articles/360018496419-Cognigy-AI-Bot-Building-Checklist)
- [Cognigy’s NLU Execution Order Explained](https://support.cognigy.com/hc/en-us/articles/16558780569884-Cognigy-s-NLU-Execution-Order-Explained)
- [Difference Between Go To and Execute Node](https://support.cognigy.com/hc/en-us/articles/16221971132444-Difference-Between-Go-To-and-Execute-Node)
- [Explaining No-Translation Markers](https://support.cognigy.com/hc/en-us/articles/16221389567900-Explaining-No-Translation-Markers)
- [Best Practices: Testing your Virtual Agents with Playbooks](https://support.cognigy.com/hc/en-us/articles/9585431937948-Best-Practices-Testing-your-Virtual-Agents-with-Playbooks)
- [Voice: Strategies for Hard to Understand Phrases](https://support.cognigy.com/hc/en-us/articles/7456424115612-Voice-Strategies-for-Hard-to-Understand-Phrases)
- [Universal skills for Chat and Voice](https://support.cognigy.com/hc/en-us/articles/7138355918876-Universal-skills-for-Chat-and-Voice)
- [Avoid customer frustration](https://support.cognigy.com/hc/en-us/articles/5949294556572-Avoid-customer-frustration)
- [Get the conversation going](https://support.cognigy.com/hc/en-us/articles/5937352099484-Get-the-conversation-going)
- [Best Practices: Building a Deployment Pipeline for Cognigy AI Agents](https://support.cognigy.com/hc/en-us/articles/4798756787740-Best-Practices-Building-a-Deployment-Pipeline-for-Cognigy-AI-Agents)
