# ResumeStateMiddleware

> **Class** in `deepagents_code`

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

Persists per-checkpoint resume facts after each model call.

See the module docstring for why this rides the model node's checkpoint
instead of a separate `aupdate_state` (avoids a standalone `UpdateState`
run in LangSmith and works identically against remote graphs).

## Signature

```python
ResumeStateMiddleware()
```

## Extends

- `AgentMiddleware[ResumeState, ContextT]`

## Properties

- `trace_policy`
- `state_schema`

## Methods

- [`after_model()`](https://reference.langchain.com/python/deepagents-code/resume_state/ResumeStateMiddleware/after_model)

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/3812967c84d90619848f3185f22470204fc88bd8/libs/code/deepagents_code/resume_state.py#L305)