# thread_exists

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/sessions/thread_exists)

Check if a thread exists in checkpoints.

## Signature

```python
thread_exists(
    thread_id: str,
) -> bool
```

## Returns

`bool`

True if thread exists, False otherwise.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/0412009c5441bef8d75a427e1da8909e33ab5b56/libs/code/deepagents_code/sessions.py#L1159)