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:
- Environment variables (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_SESSION_TOKEN) - Shared credentials file (
~/.aws/credentials) - AWS SSO (
aws sso login) - IAM role (EC2, ECS, Lambda)
Examples
| Example | Description |
|---|---|
| Product Support Agent | A deep agent with 3 skills (electronics, healthcare, finance) using CompositeBackend — AgentCore for execution, S3 for storage. Fully self-contained with its own pyproject.toml. |
Each example is an independent project — cd into it, run uv sync, configure .env, and go. See the example's own README for setup instructions.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deepagents_contrib_aws-0.2.3.tar.gz.
File metadata
- Download URL: deepagents_contrib_aws-0.2.3.tar.gz
- Upload date:
- Size: 2.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54bb75a9e1b38d411b19e9ed69436018e7ac914f53adc9344466b84d5c89e9c0
|
|
| MD5 |
ffbda653fe2b80ee6b2aa3c41f64a13d
|
|
| BLAKE2b-256 |
26ad7ec1f2c7c2df7ab198ef60ccaa85bd66e47cd81313ef006d3472a7d6d64b
|
File details
Details for the file deepagents_contrib_aws-0.2.3-py3-none-any.whl.
File metadata
- Download URL: deepagents_contrib_aws-0.2.3-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b773f8e54579af0d7b091d9ce93a7b873a0fae22eb1eea661b4280f63985a83
|
|
| MD5 |
4f4c09ff0f7cf61b8403e039f1bb33ae
|
|
| BLAKE2b-256 |
2b3ea7823f2ceb007dfa632a5bc057548af60f989f6efc7dd4f7c2df1ec87f94
|