Skip to main content
Fleet RLM requires PostgreSQL. It stores Sessions, Turns, chat messages, notes, runtime selections, Sandbox ownership records, published file records, selected replay snapshots, review labels, and GEPA optimization and evaluation jobs there. Workspace files live on the Session’s Daytona Volume. Fleet copies file contents into PostgreSQL only for selected replay snapshots. Attachments and published files go to a private S3-compatible bucket that you configure with the host-only FLEET_STORAGE_* variables. PostgreSQL keeps only their object keys. See the configuration reference.

Prerequisites

  • An existing PostgreSQL database reachable from the Fleet host. Fleet creates its tables, but not the database.
  • Fleet RLM installed with uv sync --dev
  • Daytona and model credentials configured as in the quickstart

Point Fleet at PostgreSQL

Set FLEET_DATABASE_URL in .env to a regular PostgreSQL DSN that includes the role’s credentials. Without it, Fleet uses postgresql://postgres:postgres@localhost:5432/fleet. With Neon, use the direct endpoint over TLS, not the pooler endpoint:
.env
Fleet puts its tables in the fleet schema by default. Set FLEET_DATABASE_SCHEMA or storage.database_schema to use another one. The schema name must be a lowercase PostgreSQL identifier.

Schema migrations

Fleet applies its schema when the API server starts. It takes a transaction-scoped advisory lock, reads the schema_migrations ledger, and applies each pending numbered migration once. You don’t run a separate migration command. The current schema version is 2. When Fleet finds the old fleet_lite_schema_migrations ledger, it renames it to schema_migrations first. Migration 2 then changes an existing version 1 schema in place:
  • It renames the fleet_lite_* tables to sessions, sandbox_resources, turns, notes (was fleet_lite_memories), replay_blobs, replay_snapshots, review_labels, leases, global_settings, and jobs (was fleet_lite_optimization_runs).
  • It adds the chat persistence tables messages, files, message_files, and workspace_files, and fills messages from the stored Turns.
Back up the database and review the migration before you upgrade. Fleet has no down migration, so the backup is how you roll back. To run DDL as a different role, set FLEET_DATABASE_MIGRATION_URL. It must point at the same host, port, and database as FLEET_DATABASE_URL. Fleet closes the migration connection once startup migrations finish. If the database already has a newer schema than your Fleet version, startup fails with Database schema version <n> is newer than this Fleet version <m>. Upgrade Fleet instead of downgrading the database. To test a release without touching a shared database, point it at a separate schema with FLEET_DATABASE_SCHEMA (or storage.database_schema). Fleet creates the schema if it doesn’t exist and applies every migration inside it. Drop the schema when you’re done. Don’t reopen Sessions from an old schema by ID against the same Daytona Volume. Fleet marks a Session it creates as having an empty workspace from the database alone, without listing the Volume. A Direct Turn that skips the sandbox would then miss the files already on the Volume.
Fleet RLM 0.13.0 replaced the numbered migrations of Fleet RLM 0.12.0 and earlier with a new version 1 baseline. Fleet doesn’t upgrade a 0.12.0 schema in place. A schema created by those releases records version 12, so startup fails with Database schema version 12 is newer than this Fleet version 2, and fleet doctor reports that the database requires a newer Fleet version. Fleet RLM 0.13.0 doesn’t migrate or restore the old data: it doesn’t copy Sessions, Turns, or replay data from the old schema. Deploy 0.13.0 with a new empty schema and a new Daytona Volume. Set FLEET_DATABASE_SCHEMA or storage.database_schema to a new schema name, or point FLEET_DATABASE_URL at a new database, and set FLEET_DAYTONA_VOLUME_ID to the new Volume. Keep your previous deployment and its data available for history and rollback.

Connection handling

Fleet uses one connection pool for all queries.
  • Fleet recycles pooled connections after 40 minutes and closes surplus connections idle for more than 10 minutes.
  • Fleet checks each connection when it takes it from the pool, so it never hands out a connection the server closed while idle.
  • A query that fails with a connection error is retried once. Writes are safe to retry: storing a Turn is conditional on its Turn ID, so a retry can’t store it twice.
Each active Session runtime holds a lease row in PostgreSQL that gives one worker ownership of the Session. A lease expires after 60 seconds unless renewed. One background thread per process renews every lease it holds every 20 seconds through the shared pool, so a lease doesn’t hold a dedicated connection. Each new owner advances the Session’s ownership epoch, which fences writes from a stale worker. Session history and Turn status reads don’t need the lease. If a worker loses the lease, Fleet cancels that Session’s Sandbox work, fences the runtime so it accepts no further Turns, and rebuilds it on the next request. Fleet also records each Sandbox it creates, stops, or deletes for a Session in sandbox_resources. A new owner reconciles those records with Daytona before it accepts writable work.

Replay storage

Fleet stores the file contents of selected replay snapshots in replay_blobs, keyed by SHA-256. Files that don’t change between Turns are stored once. When Fleet opens the database at startup, it deletes replay snapshots older than 30 days that have no review label, then removes blobs that no snapshot references. Each startup removes at most 500 snapshots and 500 blobs. Labelled snapshots stay. Expiry runs only at startup, so an unlabelled snapshot can outlive 30 days while Fleet is stopped.

Run the API server

The server binds to 127.0.0.1:8000 by default ([server]). An invalid --port fails with fleet: error: invalid configuration instead of falling back to the default. fleet serve needs a reachable MLflow server. With the default local backend, start one with fleet cli or run your own on port 5001. See Observability.
The Fleet API has no caller authentication. A non-loopback --host fails with non-loopback binding requires FLEET_ALLOW_NON_LOOPBACK_BIND=true. Setting that variable adds no access control, so only do it behind a trusted network boundary or an authenticating proxy. See Security.

Health check

GET /health returns 200 with status: "ok", the Fleet version, and an mlflow object describing the initialized MLflow destination. mlflow.ready is true once Fleet has initialized its runtime experiment.

Upgrade

  1. Stop Fleet.
  2. Pull the new release and run uv sync --dev.
  3. Back up the database and review the schema migrations the new release applies.
  4. When you upgrade from Fleet RLM 0.12.0 or earlier to 0.13.0, select a new schema or database and a new Daytona Volume first.
  5. Start Fleet. It applies any new schema migrations at startup.
The default schema is now fleet. Earlier releases used fleet_rlm_lite in the shipped configuration and public in code. Before you start the new release against an existing installation, set FLEET_DATABASE_SCHEMA or storage.database_schema to the schema that holds your data, for example fleet_rlm_lite or public. Otherwise Fleet creates empty tables in the fleet schema and doesn’t see your Sessions.
Last modified on November 19, 2026