Skip to main content
Fleet RLM is a small Python system. A FastAPI server owns the HTTP and SSE API, DSPy runs each Turn, Daytona runs generated Python, PostgreSQL stores durable Session state, and MLflow records traces.

Components

Routes and modes

Each Turn runs through one route: The Session mode decides how Fleet picks the route. In hybrid mode, the default, a router selects direct, flex, or rlm for each Turn. A selected input file rules out direct, and routing errors fall back to rlm. In direct, flex, or rlm mode, Fleet uses that route directly. Explicit direct mode inlines the Session’s workspace files into its single prompt. See Reasoning and recursion.

The life of a Turn

A Turn is one user request in a Session.
  1. Request. Your client sends POST /sessions/{session_id}/turn with a task and an optional idempotency_key. The server opens an SSE stream.
  2. Lock. One Turn runs per Session at a time. If another Turn or a workspace change holds the Session lock for more than 2 seconds, the server answers 409 before the stream starts.
  3. Prepare. Fleet refreshes the sandbox, restarting it if Daytona stopped it while idle. It syncs Skills and gathers file digests and memory for the Turn.
  4. Route and execute. The engine picks a route. Generated Python runs in the Daytona sandbox and calls back to Fleet for host tools. Child agents run in their own sandboxes within shared limits.
  5. Commit. Fleet commits the Turn to PostgreSQL. Committing is idempotent per Turn, so a connection retry can’t store a Turn twice.
  6. Report. The stream always ends with exactly one outcome event: turn_complete, error, or turn_cancelled. The server then releases the Session lock.
If the client disconnects mid-Turn, Fleet cancels the Turn and keeps the Session locked until sandbox work drains. See Stream events.

Where state lives

  • Turn history lives in PostgreSQL. You can read history and Turn status even when no runtime is active for the Session.
  • The workspace holds files, artifacts, memory, skills, buffers, and sessions areas on a per-Session Daytona Volume subpath.
  • Session selections such as mode, selected context, and root and sub models persist across restarts.
  • Python variables in the sandbox are not durable state.
See Sessions and workspaces for details.

Runtime policy

Non-secret defaults live in config/fleet.toml. Credentials and DSNs come only from .env or the environment. Precedence is built-in defaults, then TOML, .env, the process environment, and explicit overrides such as CLI flags. See the configuration reference.
Last modified on November 8, 2026