← Back to Blog

How to Run an AI S3 File Storage Agent with OE Runtime

Audit, analyse, and manage your S3-compatible storage with AI. OE Runtime connects to any S3 bucket, inventories your files, identifies the largest objects, and recommends cleanup and archiving actions — all locally, no third-party tool required.

🗄
Step 1
List Bucket Contents
List all files with key, size, last modified date, and storage class.
Step 2
Analyze Storage
Calculate total usage, identify the 5 largest files, group by type, and flag files older than 90 days.
Step 3
Report
Produce a storage summary with totals, type breakdown, top files, and archiving recommendations.

The Agent YAML

Create a file called agent.yaml inside a file-storage/ directory:

name: File Storage Agent
description: Upload, list, download, and manage files in S3-compatible storage
instructions: |
  You are a file management agent with access to S3-compatible storage.
  List, inspect, and report on stored files. Confirm before any delete operations.
  Complete all steps fully before writing your report.
steps:
  - name: List Bucket Contents
    content: |
      List all files in the configured S3 bucket.
      For each file note: key (path), size in KB/MB, last modified date, and storage class.
  - name: Analyze Storage
    content: |
      From the listed files:
      - Calculate total storage used
      - Identify the 5 largest files
      - Group files by extension type (images, documents, archives, other)
      - Flag any files older than 90 days that may be candidates for archiving
  - name: Report
    content: |
      Produce a storage summary:
      - Total files and total size
      - Breakdown by file type
      - Top 5 largest files
      - Files flagged for archiving
      - Recommended cleanup or archiving actions
connectors:
  - connection_name: My S3 Bucket
    connection_type: s3

The Config File

Create oe-config.json in the same directory:

{
  "llm": {
    "provider": "openai",
    "model": "gpt-4o",
    "apiKey": "YOUR_OPENAI_API_KEY"
  },
  "server": {
    "enabled": false,
    "port": 3333,
    "apiKey": "your-secret-api-key"
  },
  "connectors": [
    {
      "connection_name": "My S3 Bucket",
      "connection_type": "s3",
      "accessKeyId": "YOUR_AWS_ACCESS_KEY",
      "secretAccessKey": "YOUR_AWS_SECRET_KEY",
      "region": "us-east-1",
      "bucket": "my-bucket"
    }
  ]
}

Create an IAM user with AmazonS3ReadOnlyAccess (or scoped bucket permissions) and generate an access key at console.aws.amazon.com/iam. The agent works with any S3-compatible storage including MinIO, Backblaze B2, and Cloudflare R2 — just update the endpoint URL.

Download OE Runtime

OE Runtime — Direct Downloads

Run the Agent

Windows

# Run the agent
oe-runtime-win.exe file-storage/agent.yaml --config file-storage/oe-config.json

macOS

# Make executable (first time only)
chmod +x oe-runtime-macos

# Run the agent
oe-runtime-macos file-storage/agent.yaml --config file-storage/oe-config.json

Linux

# Make executable (first time only)
chmod +x oe-runtime-linux

# Run the agent
oe-runtime-linux file-storage/agent.yaml --config file-storage/oe-config.json

macOS Gatekeeper: On first run, macOS may block the binary. Go to System Settings → Privacy & Security → click "Allow Anyway" next to oe-runtime-macos.

Running as an API Server

Add --serve to start OE Runtime as an HTTP server on port 3333:

oe-runtime-win.exe --serve --config file-storage/oe-config.json

Then send a request:

curl -X POST http://localhost:3333/run \
  -H "Content-Type: application/json" \
  -d '{"yaml": "file-storage/agent.yaml", "params": {}}'

Or import the Postman collection (download above) to test all endpoints visually.

Use Cases

Build your own agents with OE Runtime

Download OE Runtime and run any AI agent locally or as a server — no cloud required.

Get OE Runtime →