Turso Databases

Synodes pairs every sandbox with a dedicated Turso database — a serverless SQLite-compatible (libSQL) database that runs at the edge. Your AI agents get an instantly available, fully provisioned database injected as environment variables — no manual setup, no connection string wrangling.

How It Works

When you create a sandbox, Synodes injects two environment variables:

Your agent reads these from the environment and connects using the standard @libsql/client (TypeScript) or libsql_client (Python) library. No additional configuration needed.

Provisioning Modes

Auto-provisioning

Set env vars to the {{auto}} placeholder and Synodes creates a fresh database on sandbox creation:

# CLI
synodes create --language python \
  --env TURSO_DATABASE_URL="{{auto}}" \
  --env TURSO_AUTH_TOKEN="{{auto}}"

# Python SDK
sandbox = synodes.create(
    language="python",
    env_vars={
        "TURSO_DATABASE_URL": "{{auto}}",
        "TURSO_AUTH_TOKEN": "{{auto}}"
    }
)

Manual / Pre-provisioned

Pass your own Turso database credentials. This is useful when you have a shared database or want to preserve data across sandbox lifecycles:

synodes create --language python \
  --env TURSO_DATABASE_URL=libsql://my-org.turso.io \
  --env TURSO_AUTH_TOKEN=eyJ...

Database Lifecycle

The database lifecycle mirrors the sandbox lifecycle:

Data retention: Auto-provisioned databases are ephemeral — they disappear when you delete the sandbox. For persistent data, use a manually provisioned database or snapshot the sandbox before deletion.

Key Features

Zero-Latency Local Replicas

Turso replicates your database to edge locations near your sandbox's region. Reads are served locally with sub-millisecond latency — ideal for agent memory lookups and state checks.

Branches & Restore

Create database branches for experimentation. Your agent can fork the database, try schema changes, and merge back or discard:

# Using the Turso CLI
turso db create agent-memory-dev --from agent-memory

SQLite Compatibility

Turso uses the libSQL protocol — fully compatible with SQLite, so any ORM or SQL library that works with SQLite works with Turso. Use Prisma, Drizzle, SQLAlchemy, or raw SQL.

Agent Memory Pattern

AI agents use Turso databases for:

See the Agent Memory with Turso section of the SDK quickstart for complete Python and TypeScript examples.

Limits & Pricing

Database storage is billed at $0.25 per GB-month (prorated). See the Pricing page for the full consumption model and cost examples.