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

# Introduction

> Introduction to rua: serve a Gym environment as a HUD environment, let an LLM drive it with Direct Control, and record every tick onto a replayable trace.

rua serves a Gym environment as a [HUD](https://hud.ai) environment that an LLM can drive. `attach_gym` takes any
env with `reset`, `step` and `close`, and Direct Control gives the LLM one `move` tool, checking every call before
it plays. Direct Control needs a short contract that says what the env's action means. The
[gym guide](https://docs.rua.hud.ai/guides/serving-a-gym-env.md) walks through it with a plain Gymnasium env.

## Motivation

A **robot-use agent** is a model that acts in the physical world through a robot: it reads camera frames
and joint state, and answers with motor commands. Measuring and improving one needs the same thing
every agent needs: a controlled world it can act in, reset, and be graded in. For robots, that world is
a **simulator**.

A simulator speaks its own language: a gym-style `reset` / `step` loop, batched tensors, a fixed control
rate. A language model speaks another: tool calls, text and images. rua is the layer between them, built on
[HUD](https://hud.ai)'s environment and rollout engine. It serves the robot as tools, checks every move
before it plays, and records the run.

```mermaid theme={"dark"}
flowchart LR
    subgraph AG["<b>agent</b>"]
        L["<b>LLM</b><br/>tool calls or code"]
    end

    subgraph EN["<b>robot environment</b>"]
        direction TB
        DC["<b>DirectControl / CodeControl</b><br/>checked moves"]
        S["<b>simulator</b><br/>RobotBridge"]
        DC -->|"rua/0 wire"| S
    end

    L <-->|"mcp"| DC
    EN -->|"state, requests, video"| TR["<b>HUD trace</b>"]

    classDef node fill:#f4f0e8,stroke:#1a1511,stroke-width:1px,color:#1a1511;
    classDef sim fill:#f7e3ee,stroke:#1a1511,stroke-width:1px,color:#1a1511;
    class L,DC,TR node;
    class S sim;
    style AG fill:transparent,stroke:#a89a8c,stroke-width:1px;
    style EN fill:transparent,stroke:#a89a8c,stroke-width:1px;
```

## rua

`rua` is a Python package with four parts:

* **Sim** (`rua.sim`) serves a simulator as a HUD environment. `attach_gym` serves any gym-style env;
  `RobotBridge` is the base class for a custom one. The sim runs in its own process, and the HUD environment
  drives it through a `RobotEndpoint`.
* **Direct control** (`rua.direct`) serves the robot as one MCP `move` tool, so an LLM can drive the
  simulator with timed keyframes. `create_direct_agent` builds an agent for it.
* **Code control** (`rua.code`) serves it to an LLM that writes Python cells in a kernel, with the same checked
  moves. `create_code_agent` builds an agent for it.
* **Telemetry** (`rua.telemetry`) records each run onto its HUD trace: numeric state, every request, and
  per-camera H.264 video.

It also ships the small **eval interface** (`Robot`,
`Agent`, `run`), re-exported from the top-level `rua` package.

## Reading the docs

* [**Quickstart**](https://docs.rua.hud.ai/start/quickstart.md) - install rua, serve a tiny simulator with direct control, and move it with a scripted agent.
* [**Concepts**](https://docs.rua.hud.ai/start/concepts.md) - the pieces of a robot rollout and how they talk to each other.
* [**Guides**](https://docs.rua.hud.ai/guides/serving-a-gym-env.md) - one page per workflow: serving a gym env, writing a bridge, direct and code control, recording traces, and the eval interface.
* [**Reference**](https://docs.rua.hud.ai/reference/interface.md) - every public class, function and wire format, as the code defines it today.
* [**FAQ**](https://docs.rua.hud.ai/more/faq.md) - install questions and known rough edges.

> [!NOTE]
>
> rua is at version `0.2.5` and in alpha. These pages describe what the code does today; where behavior is
> surprising or incomplete, the page says so.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.