> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainlit.io/llms.txt
> Use this file to discover all available pages before exploring further.

# on_chat_resume

Decorator to enable users to continue a conversation.
Requires both [data persistence](/data-persistence/overview) and [authentication](/authentication) to be enabled.

This decorator will automatically:

* Send the persisted messages and elements to the UI.
* Restore the user session.

<Warning>
  Only JSON serializable fields of the user session will be saved and restored.
</Warning>

## Usage

At minimum, you will need to use the `@cl.on_chat_resume` decorator to resume conversations.

```python theme={null}
@cl.on_chat_resume
async def on_chat_resume(thread):
    pass
```

However, if you are using a Langchain agent for instance, you will need to reinstantiate and set it in the user session yourself.

<Card title="Resume Langchain Chat Example" color="#F80061" icon="message" href="https://github.com/Chainlit/cookbook/tree/main/resume-chat">
  Practical example of how to resume a chat with context.
</Card>

## Parameters

<ParamField path="thread" type="ThreadDict">
  The persisted chat to resume.
</ParamField>
