S3 Media Storage
S3MediaStorage stores agent media in an S3 bucket.
S3MediaStorage stores agent media in an S3 bucket and keeps only a MediaReference in the database. Supports AWS S3, MinIO, and other S3-compatible services through endpoint_url.
| Parameter | Type | Default | Description |
|---|---|---|---|
bucket | str | - | Name of the destination S3 bucket. |
prefix | str | "agno/media/" | Key prefix for stored objects. |
region | Optional[str] | None | AWS region. Falls back to AWS_DEFAULT_REGION or ~/.aws/config. |
acl | Optional[str] | None | Object ACL applied on upload. "public-read" also makes get_url return the unsigned object URL instead of a presigned one. |
presigned_url_expiry | int | 3600 | Signed URL lifetime in seconds. Above the SigV4 maximum of seven days, URLs fall back to streaming. |
endpoint_url | Optional[str] | None | Endpoint of an S3-compatible service such as MinIO. |
aws_access_key_id | Optional[str] | None | AWS access key ID. Falls back to the standard credential chain. |
aws_secret_access_key | Optional[str] | None | AWS secret access key. Falls back to the standard credential chain. |
persist_remote_urls | bool | False | Download and store media passed as a URL. Skipped when False. |
AsyncS3MediaStorage takes the same parameters and uses aioboto3.
An S3-compatible service needs region set to match its own site region. A presigned URL carries the region in its signature and is rejected when the two disagree.