Skip to main content

S3 Adapter


Overview

The S3 adapter stores memory entries as versioned JSON objects in any S3-compatible bucket. This makes SenseLab compatible with the broader cloud storage ecosystem — AWS S3, Accelerated Cloud Storage (ACS), Cloudflare R2, MinIO, DigitalOcean Spaces, and others. Best for:
  • Distributed teams needing shared memory across regions
  • AI training pipelines where memory lives alongside model weights and datasets
  • Serverless environments where a local filesystem isn’t available
  • Large-scale deployments storing millions of memory entries

Installation

Requires boto3. AWS credentials are resolved via the standard credential chain (env vars, ~/.aws/credentials, IAM role, etc.).

Configuration

YAML

Environment Variables

Programmatic


Object Layout

Entries are stored as JSON objects with the following key structure:
For example, with prefix amfs/ and namespace default:
Each version is a complete snapshot of the MemoryEntry — no deltas, no dependencies. This makes individual entries independently readable and portable.

Using with ACS (Accelerated Cloud Storage)

Accelerated Cloud Storage provides S3-compatible object storage optimized for AI workloads. To use SenseLab with ACS:
Or via environment variables:

Using with MinIO

For local development or self-hosted S3:

Watch (Polling)

The S3 adapter implements watch() via periodic polling (every 5 seconds by default), since S3 does not support native change notifications. For real-time streaming, use the HTTP API server with SSE.

Limitations

  • No native full-text searchsearch() falls back to scanning all entries and filtering in memory. For high-volume search, use the Postgres adapter or route through the HTTP API.
  • No native vector searchsemantic_search() requires an embedder and scans entries in memory. For production-scale semantic search, combine with Postgres + pgvector.
  • Eventual consistency — S3 provides strong read-after-write consistency for PUTs, but LIST operations may show stale results briefly.

Next Steps