To keep DeepAgents data after a Docker container is replaced, configure DeepAgents to save the data you care about, then mount the directory used by any disk-backed component to a Docker volume or host bind mount. These are separate requirements: a volume cannot save graph state the application never checkpoints, and a checkpoint cannot preserve files left only in the container’s disposable writable layer.
Choose what needs to survive
DeepAgents state and files can have different lifetimes. Decide whether you need to resume one conversation, preserve files, or share stored information across conversations; each requires the right application-level backend or checkpointer.
As an Amazon Associate I earn from qualifying purchases.
| Data to preserve | DeepAgents mechanism | Scope |
|---|---|---|
| Conversation and its graph-state files | StateBackend() with checkpointing |
Associated with graph state and a conversation thread; resume with the same thread identifier. |
| Files accessed directly through a filesystem backend | FilesystemBackend configured with a filesystem root |
Files under the configured root; persist them across container replacement by mounting that root. |
| Information shared across threads | StoreBackend with a store and an application-specific namespace |
Cross-thread storage, rather than a single conversation’s checkpoint state. |
These backend patterns are described in LangChain’s DeepAgents workflow guidance. It is a live main-branch document, not a version-pinned release reference, so confirm the API against the DeepAgents version installed in your application.
Configure the application and Docker as two layers
- Identify the data and scope. Decide whether you need thread-scoped checkpoints, filesystem files, or cross-thread storage. A workspace mount alone does not configure a checkpointer or store.
- Select and configure the DeepAgents backend. The documented default,
StateBackend(), associates files with graph state and a conversation thread. Use a filesystem backend when the agent needs direct filesystem access, or a store backend for application-specific cross-thread persistence. Configure checkpointing or a store as appropriate to the chosen scope. - Find the actual disk path. If a component writes to disk, configure its root beneath a container path that your app actually uses. There is no universal DeepAgents directory established by the cited guidance; do not mount an assumed path.
- Mount that path persistently. Attach a named Docker volume to the configured path, or use a bind mount if host processes need direct access to those files. Docker explains that volumes preserve data beyond an individual container’s lifecycle in its container-data overview.
- Replace the container with the same mount. Reattach the same named volume or bind-mount source at the same application path. For thread-scoped checkpoints, continue with the same DeepAgents thread identifier as well; using a new thread does not resume the old thread’s checkpoint.
Docker’s volume documentation describes volumes as daemon-managed storage that can outlive a container. A bind mount instead connects a host path to the container, making it useful when host-side tools need direct file access.
#1 Best Overall
Verify persistence at both layers
- Write a test file through the configured filesystem backend, then replace the container and confirm the file is still present at the mounted path.
- Save a checkpointed conversation, replace the container with the same persistent storage configuration, and resume using its original thread identifier.
- If you use cross-thread storage, verify retrieval through the intended store and namespace; a filesystem mount by itself does not configure that store.
- Check container logs and filesystem permissions if writes fail. The cited guidance does not prescribe a universal UID/GID or permissions policy, so match ownership and access rights to the process and deployment.
What Docker persistence does—and does not—protect
Files written only to the container’s writable layer are not preserved when that container is destroyed. Data written under a mounted volume or bind-mounted host path can outlive the container, but only if the application writes to that mounted location. Conversely, graph-state checkpoints do not make arbitrary files written elsewhere in the container durable.
A persistent volume is not a backup: it does not by itself establish protection against host or storage failure. If recovery matters, plan and test backups separately. Exact Compose syntax, remote volume drivers, permissions, and backup schedules depend on the deployment and are not specified by the cited DeepAgents and Docker guidance.
Quick Recap
Best Value
Rank #4
Rank #3
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




