Skip to main content

AWS contributions for Deep Agents

Project description

deepagents-contrib-aws

AWS backend implementations for the deepagents framework.

Installation

pip install deepagents-contrib-aws

This installs both backends (S3Backend and AgentCoreCodeInterpreterSandbox) and all dependencies.

Backends

Backend Protocol Description Docs
S3Backend BackendProtocol Persists agent workspace files in Amazon S3. Supports ls, read, write, edit, grep, glob, upload_files, download_files. docs/s3-backend.md
AgentCoreCodeInterpreterSandbox SandboxBackendProtocol Executes Python and shell commands in a managed cloud sandbox via Amazon Bedrock AgentCore Code Interpreter. Native file upload/download. docs/agentcore-sandbox.md

Quick Examples

S3Backend

from deepagents_contrib_aws import S3Backend

backend = S3Backend(bucket="my-bucket", prefix="agent/workspace/")
backend.write("/hello.py", "print('hello')")
content = backend.read("/hello.py")

Or configure from environment variables:

export S3_BACKEND_BUCKET=my-bucket
backend = S3Backend.from_env()

See docs/s3-backend.md for full usage, configuration reference, and all operations.

AgentCore Code Interpreter Sandbox

from deepagents_contrib_aws import AgentCoreCodeInterpreterSandbox

with AgentCoreCodeInterpreterSandbox(region_name="us-west-2") as sandbox:
    # Python execution (variable state preserved across calls)
    sandbox.execute('python3 -c "x = 42"')
    result = sandbox.execute('python3 -c "print(x)"')
    print(result.output)  # "42"

    # Shell commands
    result = sandbox.execute("echo hello")
    print(result.output)  # "hello"

Or configure from environment variables:

export AGENTCORE_REGION=us-west-2
sandbox = AgentCoreCodeInterpreterSandbox.from_env()

See docs/agentcore-sandbox.md for full usage, file operations, session lifecycle, and configuration reference.

With deepagents

from deepagents import create_deep_agent
from deepagents_contrib_aws import S3Backend, AgentCoreCodeInterpreterSandbox

# File storage backend
backend = S3Backend.from_env()
agent = create_deep_agent(backend=backend)

# Code execution sandbox
sandbox = AgentCoreCodeInterpreterSandbox.from_env()
agent = create_deep_agent(backend=sandbox)

AWS Credentials

Both backends resolve credentials via the standard boto3 credential chain:

  1. Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN)
  2. Shared credentials file (~/.aws/credentials)
  3. AWS SSO (aws sso login)
  4. IAM role (EC2, ECS, Lambda)

Development

See docs/development.md for setup, testing, linting, building, and contributing guidelines.

# Quick start
uv sync              # install dependencies
uv run pytest        # run unit tests (102 tests, no AWS credentials needed)
uv run ruff check .  # lint
uv build             # build package

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deepagents_contrib_aws-0.2.0.tar.gz (152.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deepagents_contrib_aws-0.2.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file deepagents_contrib_aws-0.2.0.tar.gz.

File metadata

  • Download URL: deepagents_contrib_aws-0.2.0.tar.gz
  • Upload date:
  • Size: 152.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for deepagents_contrib_aws-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f500e6594431ec2fc4dc6795532be0e35b056b853220200b8cdbf42126c41493
MD5 5e40393b9a2c41d029fce53927748d1f
BLAKE2b-256 f8a6539c3a35ba07cfc7d56eec8e4bd9f7af719b9d92eef92e2985352334e355

See more details on using hashes here.

File details

Details for the file deepagents_contrib_aws-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for deepagents_contrib_aws-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e573f168e4c9defecacba50e905489d72f0f040fdbb95dba50f7a98adf74d450
MD5 885e41364ddbfcd82c45af141e1062dd
BLAKE2b-256 6949bb2f72243d7527d7bccb45f5f83819aa720412f4ae349bec6ce3d28308d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page