> This page is for Voice APIs.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://dev.hume.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://dev.hume.ai/_mcp/server.

# Resuming Chats

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.

> **Info**
>
> If [data retention is disabled](/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](/reference/speech-to-speech-evi/chat)
   to establish the WebSocket connection. Upon successful connection, you will
   receive a [ChatMetadata](/reference/speech-to-speech-evi/chat#receive.ChatMetadata.chat_group_id) message:

   #### Chat metadata

   ```json {3}
   {
     "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](/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](/reference/speech-to-speech-evi/chat#request.query.resumed_chat_group_id)
   query parameter of subsequent handshake requests.

   #### Next.js

   ```tsx {12}
   "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>
     );
   }
   ```

   #### TypeScript

   ```TypeScript {5}
   import { HumeClient } from 'hume';

   const client = new HumeClient({ apiKey: '<HUME_API_KEY>' });
   const socket = await client.empathicVoice.chat.connect({
     resumedChatGroupId: '<YOUR_CHAT_GROUP_ID>',
   });
   ```

   #### Python

   ```Python {7-10}
   import asyncio
   from hume import HumeClient

   async def main():
       client = HumeClient("YOUR_API_KEY")
       socket = client.empathic_voice_interface
       options = {
           "resumed_chat_group_id": "<YOUR_CHAT_GROUP_ID>"
       }
       async with socket.connect(options=options) as websocket:
           # ...etc.
           pass

   asyncio.run(main())
   ```

   > **Warning**
   >
   > 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.

---