EVI supports reconnecting to an ongoing chat session, preserving all prior conversation context. This is especially useful in cases of unexpected network failures or when a user wishes to pick up the conversation at a later time, enabling continuity without losing progress.

If [data retention is disabled](https://dev.hume.ai/docs/resources/privacy#zero-data-retention-and-data-usage-options), the ability to resume chats will not be supported.

## Resuming a chat

See steps below for how to resume a chat:

1. **Establish initial connection**: Make the initial [handshake request](https://dev.hume.ai/reference/speech-to-speech-evi/chat) to establish the WebSocket connection. Upon successful connection, you will receive a [ChatMetadata](https://dev.hume.ai/reference/speech-to-speech-evi/chat#receive.ChatMetadata.chat_group_id) message:

```
   {
        "type": "chat_metadata",
        "chat_group_id": "8859a139-d98a-4e2f-af54-9dd66d8c96e1",
        "chat_id": "2c3a8636-2dde-47f1-8f9e-cea27791fd2e"
   }
   ```

2. **Store the ChatGroup reference**: Save the [chat_group_id](https://dev.hume.ai/reference/speech-to-speech-evi/chat#receive.ChatMetadata.chat_group_id) from the `ChatMetadata` message for future use.

3. **Resume chat**: To resume a chat, include the stored `chat_group_id` in the [resumed_chat_group_id](https://dev.hume.ai/reference/speech-to-speech-evi/chat#request.query.resumed_chat_group_id) query parameter of subsequent handshake requests.

```typescript
"use client";
import { VoiceProvider } from "@humeai/voice-react";

export default function ClientComponent({
     accessToken,
}: {
     accessToken: string;
}) {
     return (
       <VoiceProvider
         auth={{ type: "accessToken", value: accessToken }}
         resumedChatGroupId='<YOUR_CHAT_GROUP_ID>'
       >
         // ...etc.
       </VoiceProvider>
     );
}
```

When resuming a chat, you can specify a different EVI configuration than the one used in the previous session. However, changing the system prompt or supplemental LLM may result in unexpected behavior from EVI.
