Construct & verify
Infer the task specification, reconstruct an interactive simulation, and generate and refine manipulation programs.
Coding agents have demonstrated enormous success in solving complex programming problems. We introduce Robot Agentic Programming from Demonstrations (RAPID), which automatically generates, verifies, and refines robot programs given a single visual human demonstration. Closing this agentic loop requires a testable task specification, manipulation primitives, and an interactive verification environment. RAPID infers all three from the demonstration. To make the resulting program reusable, RAPID uses an object-centric relational program representation that captures the underlying structure of the demonstrated strategy. Primitives are trajectory-optimization programs that realize object-level effects, composed through relational constraints that resolve scene-specific geometry at runtime. We evaluate RAPID on eight contact-rich nonprehensile manipulation tasks in simulation and on a real Franka arm, and further evaluate its generality on LIBERO-Pro.
The method
Demonstrations as the programming interface
Infer the task specification, reconstruct an interactive simulation, and generate and refine manipulation programs.
Express object-level effects as trajectory-optimization programs. Relational constraints compose successive primitives.
Bind new scene objects to semantic roles in just a few seconds without needing to change the strategy and primitives, then optimize and execute.
Building reusable and generalizable manipulation primitives and strategy
Real-world experiments
The robot uses contact with the surrounding scene to grasp objects or move them into narrow spaces.
Task 03 / 08
Move the object clear of surrounding obstacles. Then push it toward the fixture, flip it, and grasp the exposed edge.
Franka Research 3 · 10× speed
Simulation evaluation
50 novel scenes per task, with changes in object pose, appearance, geometry, material, and scene configuration.
Across eight nonprehensile tasks.
Mean ± standard deviation: 75.9 ± 2.4% over three trials.
OReP: object-centric relational programs. SV: scene variants.
Physical reasoning benchmark
KinDER experiments conducted by Cunjun Yu.
We evaluate RAPID on KinDER, a physical reasoning benchmark for robot learning and planning.Our baseline is Robocode, a framework for robot agentic programming.
Both methods solve most tasks. RAPID performs better on Dynamic 3D tasks and has a lower average cost overall.
Success rate · higher is better
Success rate · higher is better
All tasks, USD · lower is better
RAPID produces behavior that more closely follows the demonstration. Compare the input demonstration with Robocode and RAPID below.
Benchmark: Huang, Yixuan, et al. KinDER: A Physical Reasoning Benchmark for Robot Learning and Planning. RSS 2026.
Baseline: Merler, Matteo, et al. Coding agents for generalized task and motion planning problems. arXiv 2026.
@article{liu2026rapid,
title = {RAPID: Robot Agentic Programming from Demonstrations},
author = {Liu, Yuyao and Mao, Jiayuan and Hsu, David and
Kaelbling, Leslie Pack and Lozano-Pérez, Tomás},
journal = {arXiv preprint arXiv:2609.30249},
year = {2026},
url = {https://arxiv.org/abs/2609.30249}
}