# Media offloading stores media in object storage instead of your database

> Set media_storage and images, audio, video and files go to object storage instead of being persisted as base64 in the session row, leaving a small MediaReference behind. A 113 KB JPEG drops from about 151,000 characters to 2,897.

- Published: 2026-08-24
- Author: Kaustubh Shukla
- Categories: Changelog
- Canonical: https://www.agno.com/articles/media-offloading-stores-media-in-object-storage-instead-of-your-database
- Markdown: https://www.agno.com/articles/media-offloading-stores-media-in-object-storage-instead-of-your-database.md

Media offloading moves images, audio, video, and files out of the session row and into object storage. By default, media on a run is persisted as base64 in the database, so a 113 KB JPEG becomes about 151,000 characters in the row. Set `media_storage` and the bytes go to object storage instead, leaving a small `MediaReference` with the key, bucket, mime type, size, and hash. That same JPEG drops to 2,897 characters.

The model still receives the media and history still replays it on later runs. Only the storage location changes, and there is no schema change. `media_storage` works the same on `Agent`, `Team`, and `Workflow`, across local, S3, and GCS backends, each with an async twin.

Configure it when you create an agent:

```python
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.media.storage import S3MediaStorage
from agno.models.openai import OpenAIResponses

agent = Agent(
    model=OpenAIResponses(id="gpt-5.5"),
    db=SqliteDb(db_file="tmp/agent.db"),
    media_storage=S3MediaStorage(bucket="my-bucket"),
)
```

Learn more about [media storage](https://docs.agno.com/sessions/persisting-sessions/media-storage/overview).
