Record, train, and deploy from one place with Strands Agents, LeRobot, and Hugging Face Storage Buckets
2026-08-20 · Hugging Face
Record, Train, and Deploy from One Place with Strands Agents, LeRobot, and Hugging Face Storage Buckets
Introduction
This post presents a complete streaming data loop inside a single Strands agent. It records robot demonstrations into a Hugging Face Storage Bucket, trains by streaming the dataset directly from the Hub, and deploys the resulting policy back to hardware while keeping the data in the original LeRobot on-disk format throughout.
The Continuous Learning Challenge
Once an agent can record a demonstration and push it to the Hub, the next requirement is to run the loop continuously: collect episodes throughout the day, train a policy on the growing dataset, deploy it, and pull the next batch to keep improving. Running the loop once works easily, but running it daily leads to paying for the same byte transfers repeatedly. Recordings grow, each training run copies the entire dataset to GPUs, and every new checkpoint is shipped while the next batch of recordings returns.
What is Strands Robots?
Strands Robots is an open-source SDK from AWS (Apache 2.0) that exposes robot abstractions, simulation, and the LeRobot stack as AgentTools. These can be composed into a single Strands agent. The first post in the series introduced the Robot() factory, recording demonstrations in simulation, running a policy, and deploying the same agent code to a physical SO-101 robot.
The Robot() factory resolves a name against a registry of supported embodiments including arms, humanoids, mobile bases, and hands. The SO-100 used in this post is one of many supported platforms. LeRobot's dataset format is already used by over 90,000 datasets and models on the Hub from more than 8,000 publishers, so any tool built for LeRobot data can read Strands recordings without conversion.
Hugging Face Storage Buckets
This post follows the data in the opposite direction — from the first recorded frame back to the deployed policy — using Hugging Face Storage Buckets. Announced in March 2026, these are mutable, non-versioned, Xet-backed object-storage repositories that live alongside datasets in the hf:// namespace and use the familiar hf CLI.
A Storage Bucket acts as the working layer that holds data between the day it is recorded and the day it is used for training, avoiding repeated full-dataset transfers.
What You Will Build
The agent records a LeRobotDataset from a natural-language prompt, syncs it into a Storage Bucket, then streams the same dataset back frame by frame with on-the-fly camera video decoding and no local copy. The same Robot() instance that recorded the data also streams it. The trained checkpoint is deployed to that same Robot() with a single keyword argument change (`mode="real"`).
All four stages — recording, syncing, streaming, and deployment — share one backend. The on-disk format remains exactly as LeRobot wrote it.
The Agent Loop
Because one Robot() handles both recording and reading, data collection and training become two methods on the same object. The complete loop can be expressed in a handful of lines:
from strands import Agent
from strands_robots import Robot
sim = Robot("so100") # mode="sim" (default)
agent = Agent(tools=[sim])
# Record and sync
agent("Record a pick-the-cube demo and sync it to my-org/robot-fave.")
# Stream directly from bucket for training
for batch in sim.stream_dataset("my-org/robot-fave/cube_pick", repo_type="bucket").dataloader(batch_size=64):
...
The agent decides when to run an episode; the rollout then proceeds at the robot's control frequency using the trained policy.
Prerequisites
The minimal setup requires:
- Python 3.12+ on Linux or macOS (Apple Silicon supported for MuJoCo)
- A Strands-compatible model provider (Amazon Bedrock, Anthropic, OpenAI, or local Ollama)
- Strands Robots with dataset extras: `uv pip install -U "strands-robots[sim-mujoco,lerobot]>=0.5.1"`
The `lerobot` extra installs LeRobot (>=0.6.1), datasets, av, and torchcodec, enabling both recording and video decoding without further configuration.
All stages in this post run on a laptop with the above setup. The companion notebook is available at `examples/notebooks/05_streaming_data_loop.ipynb`.
This unified approach significantly reduces data movement overhead while maintaining full compatibility with the LeRobot ecosystem.