# find_similar_threads

> **Function** in `deepagents_code`

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

Find threads whose IDs start with the given prefix.

## Signature

```python
find_similar_threads(
    thread_id: str,
    limit: int = 3,
) -> list[str]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `thread_id` | `str` | Yes | Prefix to match against thread IDs. |
| `limit` | `int` | No | Maximum number of matching threads to return. (default: `3`) |

## Returns

`list[str]`

List of thread IDs that begin with the given prefix.

---

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