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

# Collection

> Recording observations into structured datasets is a first-class primitive.

Collection is a primitive in rfx, not a side workflow. The collection API
records observations through the same robot interface used by deployment and
simulation.

## CLI

```bash theme={null}
rfx record \
  --robot so101 \
  --repo-id my-org/demos \
  --episodes 10 \
  --duration 30
```

Dry-run without hardware:

```bash theme={null}
rfx record --robot so101 --repo-id my-org/demos --mock --duration 5
```

Push after recording:

```bash theme={null}
rfx record --robot go2 --repo-id my-org/demos --duration 20 --push
```

See the full flag reference on the [`rfx record`](/cli/record) page.

## Python

```python theme={null}
import rfx

dataset = rfx.collection.collect(
    "so101",
    "my-org/demos",
    episodes=2,
    duration_s=10,
)
```

## Where data lives

Datasets land in the [LeRobot format](https://github.com/huggingface/lerobot)
— HuggingFace's open episode schema for robotics datasets. Episodes include
aligned observations and actions at the configured rate, with camera streams
recorded as video tracks. A manifest records robot config, contract version,
and the rfx version used during collection — this makes downstream training
reproducible and lets the operator checklist verify schema compatibility
before deploy.

## MCAP sidecar

Emit an MCAP sidecar alongside the dataset for ROS-compatible tooling:

```bash theme={null}
rfx record --robot so101 --repo-id my-org/demos --duration 15 --mcap
```
