> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qredence.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# fleet-rlm core concepts

> How fleet-rlm combines dspy.ReAct chat orchestration with recursive long-context dspy.RLM execution over a shared Daytona-backed code interpreter runtime.

`fleet-rlm` combines a ReAct chat orchestrator with recursive long-context execution over a shared Daytona-backed interpreter runtime.

## ReAct chat orchestrator

`FleetAgent` (wrapped by `AgentRuntime`) is the interactive orchestrator. It:

* Receives user requests from the CLI, HTTP API, or WebSocket transport.
* Decides tool actions using `dspy.ReAct`.
* Streams intermediate and final events back to the client.
* Maintains conversation history and document context.

The chat agent is the **entry point** for every user interaction. It does not by itself run long-context jobs — instead it dispatches them through a specific tool.

## Recursive long-context execution

For tasks that exceed a single ReAct context window, the agent delegates to a bounded `dspy.RLM` running inside a child Daytona sandbox. The recursive engine implements Algorithm 1 from [arXiv 2512.24601v2](https://arxiv.org/abs/2512.24601):

* Inputs are stored as REPL variables inside the child sandbox.
* Sub-queries are dispatched recursively, bounded by `max_iterations` and `max_llm_calls`.
* Sandboxes are isolated per delegation.
* A single shared semantic-call budget covers the entire recursive tree.

See [Recursive RLM](/fleet-rlm/concepts/recursive-rlm) for the delegation flow and isolation policy.

## Interpreter runtime backends

Interpreter backends provide isolated remote execution. The current contract is **Daytona-only**:

* Sandbox isolation from the host environment.
* Persistent storage via durable mounted volumes (`memory/`, `artifacts/`, `buffers/`, `meta/`).
* Controlled execution profiles for root and delegate behavior.

The same ReAct + recursive `dspy.RLM` runtime serves the CLI, HTTP API, and Web UI.

## Runtime surfaces

| Surface         | Command                                   |
| --------------- | ----------------------------------------- |
| Web UI + API    | `uv run fleet web`                        |
| Terminal chat   | `uv run fleet` or `uv run fleet-rlm chat` |
| API server only | `uv run fleet-rlm serve-api`              |

All surfaces converge on shared orchestration and runtime modules.

## Observability and state

The system emits two WebSocket streams:

* `/api/v1/ws/execution` — chat stream events
* `/api/v1/ws/execution/events` — execution graph events

Persistence lives in **Neon/Postgres** as canonical multi-tenant state. Session manifests on durable storage are the authoritative restart-restore source — the manifest's `state` payload restores `dspy.History` turns, agent core memory, loaded documents, and Daytona interpreter state.

## Auth and environment guardrails

Runtime behavior is environment-sensitive via configuration:

| Variable            | Purpose                             |
| ------------------- | ----------------------------------- |
| `APP_ENV`           | `local`, `staging`, or `production` |
| `AUTH_MODE`         | `dev` or `entra`                    |
| `AUTH_REQUIRED`     | Enforce auth on API routes          |
| `DATABASE_REQUIRED` | Enforce Neon/Postgres connectivity  |

When `AUTH_MODE=entra`, HTTP and WebSocket access use real Entra bearer-token validation plus Neon-backed tenant admission. Runtime settings writes are intentionally limited to `APP_ENV=local`.

## Goal-first, not repo-first

Repositories are **one** possible source of context, alongside local files, staged documents, pasted content, and URLs. Requests may include `repo_url`, `repo_ref`, `context_paths`, and `batch_concurrency` as per-turn execution hints.

## Next

<CardGroup cols={2}>
  <Card title="Architecture" icon="sitemap" href="/fleet-rlm/concepts/architecture">
    Thin transport, runtime core, and Daytona substrate.
  </Card>

  <Card title="Agent model" icon="robot" href="/fleet-rlm/concepts/agent-model">
    `FleetAgent`, `AgentRuntime`, signatures, and per-turn execution.
  </Card>

  <Card title="Recursive RLM" icon="diagram-project" href="/fleet-rlm/concepts/recursive-rlm">
    Algorithm 1, delegation, REPL-variable mode, and the shared call budget.
  </Card>

  <Card title="Daytona runtime" icon="cubes" href="/fleet-rlm/concepts/daytona-runtime">
    Sandbox lifecycle, volumes, and the host-callback bridge.
  </Card>

  <Card title="Sessions & persistence" icon="database" href="/fleet-rlm/concepts/sessions-persistence">
    Manifests, stateful restore, and the multi-tenant store.
  </Card>

  <Card title="Observability" icon="chart-line" href="/fleet-rlm/concepts/observability">
    MLflow tracing, WebSocket events, and diagnostics.
  </Card>
</CardGroup>
