# sweep_offloaded_history

> **Function** in `deepagents_code`

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

Delete conversation-history archives older than the configured retention.

## Signature

```python
sweep_offloaded_history() -> int
```

## Returns

`int`

The number of archive files deleted. Failures return zero or omit the

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/2069079e09546060f5b52b2cd4f0e3c813e820f3/libs/code/deepagents_code/offload.py#L349)