Skip to main content

deepagent-backend

Remote storage backends for LangChain Deep Agents: persist agent files in S3, PostgreSQL, Azure Blob Storage, Google Cloud Storage, MongoDB or Redis/Valkey.

Every backend is its own PyPI distribution, so you install only the client libraries you actually use:

pip install "deepagent-backend[s3]"          # S3 / MinIO
pip install "deepagent-backend[redis]"       # Redis / Valkey
pip install "deepagent-backend[s3,postgres]" # several at once
pip install "deepagent-backend[all]"         # everything
Extra Distribution Import package Backend / config classes Pulls in
s3 deepagent-backend-s3 deepagent_backend_s3 S3Backend, S3Config aioboto3
postgres deepagent-backend-postgres deepagent_backend_postgres PostgresBackend, PostgresConfig psycopg[binary,pool]
azure-blob deepagent-backend-azure-blob deepagent_backend_azure_blob AzureBlobBackend, AzureBlobConfig azure-storage-blob
gcs deepagent-backend-gcs deepagent_backend_gcs GCSBackend, GCSConfig gcloud-aio-storage
mongodb deepagent-backend-mongodb deepagent_backend_mongodb MongoDBBackend, MongoDBConfig motor
redis (alias valkey) deepagent-backend-redis deepagent_backend_redis RedisBackend, RedisConfig redis
all all of the above

pip install deepagent-backend alone installs just the shared helpers (deepagent_backend.common). You can also install a single backend directly, e.g. pip install deepagent-backend-s3.

Usage

The umbrella package re-exports every backend lazily, so the import path is the same whichever ones you installed:

from deepagents import create_deep_agent
from deepagent_backend import S3Backend, S3Config

agent = create_deep_agent(
    model=model,
    backend=S3Backend(S3Config(bucket="my-agent-bucket", prefix="agent-workspace")),
)

Importing a backend whose extra is missing fails with an actionable message:

ImportError: S3Backend requires the 's3' backend. Install it with: pip install "deepagent-backend[s3]"

Importing from the backend package directly (from deepagent_backend_s3 import S3Backend) works too and never touches the other backends.

Backend guides

The wiki index links to the configuration and lifecycle guide for each backend:

Backend Guide
S3 S3
PostgreSQL PostgreSQL
Azure Blob Azure Blob
Google Cloud Storage GCS
MongoDB MongoDB
Redis / Valkey Redis / Valkey

Runnable samples are in examples/; the low-level example uses Garage and PostgreSQL from docker-compose.yml, while the Deep Agent examples also require an Anthropic API key.

Compatibility: the backends implement the BackendProtocol of deepagents>=0.7.32: read returns a ReadResult (the middleware adds the line numbers), ls/grep/glob return LsResult/GrepResult/GlobResult, grep is a literal substring search with max_count, glob follows the shared Deep Agents matcher, and write overwrites an existing file (keeping its creation time). Older deepagents releases are not supported.

Repository layout

.
├── pyproject.toml              # umbrella dist `deepagent-backend` (extras) + uv workspace
├── src/deepagent_backend/      # lazy re-exports + shared helpers (common.py)
├── packages/
│   ├── s3/                     # deepagent-backend-s3         -> deepagent_backend_s3
│   ├── postgres/               # deepagent-backend-postgres   -> deepagent_backend_postgres
│   ├── azure-blob/             # deepagent-backend-azure-blob -> deepagent_backend_azure_blob
│   ├── gcs/                    # deepagent-backend-gcs        -> deepagent_backend_gcs
│   ├── mongodb/                # deepagent-backend-mongodb    -> deepagent_backend_mongodb
│   └── redis/                  # deepagent-backend-redis      -> deepagent_backend_redis
├── tests/                      # unit + docker-based integration tests
├── scripts/                    # version-lockstep check, wheel smoke test
└── .pytools/                   # ruff, ty, pytest, coverage, commitizen settings

All distributions are released in lockstep: same version everywhere, and each extra pins the exact matching backend version (scripts/check_versions.py enforces it in CI).

Development and examples

Requires uv and just; Docker only for integration tests.

just install           # sync dependencies; does not initialize Git
just test              # unit tests
just test-integration  # Garage, Postgres, Azurite, fake-gcs, MongoDB, Redis via docker-compose.yml
just ci                # lint, format, types, lockfile, versions, coverage
just smoke             # build wheels, then install each extra in a clean venv and verify it
docker compose up -d garage postgres
uv run examples/basic_usage.py

The low-level example uses the local Garage/PostgreSQL credentials from Compose by default. Override them with GARAGE_SECRET_ACCESS_KEY and POSTGRES_PASSWORD if you customize the services.

Releasing

  1. just bump — commitizen bumps the version of every pyproject.toml and every cross-pin at once.
  2. Push the tag (vX.Y.Z) and publish a GitHub release; .github/workflows/release.yml builds all distributions and uploads them to PyPI through trusted publishing.

One-time setup: create the seven projects on PyPI (or add pending publishers) pointing at this repository, workflow release.yml, environment pypi.

Credits

Inspired by DiTo97/deepagents-backends (MIT) for the idea of providing storage backends for Deep Agents. Project scaffolding follows anocerino-ai/copier-fastapi-service-template (uv, ruff, ty, just, .pytools/).

License

Released under the MIT license; see LICENSE.

Metadata

Release files for deepagent-backend 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deepagent-backend 0.1.0
File Size Uploaded Provenance Actions
deepagent_backend-0.1.0.tar.gz 23.8 kB With provenance Details for deepagent_backend-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for deepagent-backend 0.1.0
File Interpreter ABI Platform Actions
deepagent_backend-0.1.0-py3-none-any.whl Python 3 none any Details for deepagent_backend-0.1.0-py3-none-any.whl

Total release size: 33.6 kB

Release files / deepagent_backend-0.1.0.tar.gz

Download URL deepagent_backend-0.1.0.tar.gz
Size 23.8 kB
Tags Source
SHA-256 checksum
How to use checksums
83278adc239f62d207b448871f23b0b0d07628539e7a7a13d5a72f081ca0b962
BLAKE2b-256 checksum
How to use checksums
c885610353c613fc3988a7ec02bd394274f642de29b8ec7391388fccc9324186
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / deepagent_backend-0.1.0-py3-none-any.whl

Download URL deepagent_backend-0.1.0-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9be4f5b6334cbf2173646dbea5db2e1bc2d98b263474cdd06a3ffaae1dbe683b
BLAKE2b-256 checksum
How to use checksums
9bbfcdc3286aeb631ddeaf8a5ab84cd8b48b57762e6183bc25eeee4aa28e8816
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for deepagent-backend 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for deepagent_backend-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page