# get_cached_threads

> **Function** in `deepagents_cli`

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

Get cached recent threads, if available.

## Signature

```python
get_cached_threads(
    agent_name: str | None = None,
    limit: int | None = None,
) -> list[ThreadInfo] | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `agent_name` | `str \| None` | No | Optional agent-name filter key. (default: `None`) |
| `limit` | `int \| None` | No | Maximum rows requested. Uses `get_thread_limit()` when `None`. (default: `None`) |

## Returns

`list[ThreadInfo] | None`

Copy of cached rows when available, otherwise `None`.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/1ae053f347679e58562d2b81eb6d6e6e9bbf0b07/libs/cli/deepagents_cli/sessions.py#L441)