Retriever is now open sourceGitHub →
Behavior-level robotics · Python

Program closed-loop robot behavior in Python.

Build perception, planning, memory, and control as reusable Python modules, or load ready-made pieces from Retriever Hub. Compose them like PyTorch modules; Retriever schedules each part independently at the behavior level.

InstallPython 3.11+
$ pip install retriever-core

For the camera demo: pip install "retriever-core[demo]".

AI agent?Read /llms.txt →
hub_webcam.py
from retriever import Latest, Pipeline, Rate, Trigger, hub

Camera = hub.use("openretriever/webcam-demo:CameraSource")
Detect = hub.use("openretriever/webcam-demo:ColorDetector")
View = hub.use("openretriever/webcam-demo:RerunDisplay")

with Pipeline("webcam") as pipe:
    camera = Camera() @ Rate(hz=20)
    detector = Detect() @ Trigger("image")
    viewer = View() @ Rate(hz=20)
    camera.then(detector, sync=Latest())
    detector.then(viewer, sync=Latest())

pipe.run(duration=60)

One program, from debugging to the robot

The same pipe from the example above, used three ways.

# one logical step, in this process
out = pipe.step(dt=0.1)
out = pipe.step(dt=0.1)

Step it to debug

Step the graph in your Python process and read what every Flow produced at that step.

# each Flow on its own clock and process
pipe.run(backend="multiprocessing")
pipe.run(backend="dora")

Run it asynchronously

Deploy the same graph on a runtime backend. The program does not change.

# record a run, then replay the camera
pipe.record("run.rrd", steps=200)
pipe.replay(camera, path="run.rrd")
pipe.run(backend="in-process")

Record and replay

Save a run to a Rerun file, then feed the recording back in place of the live camera.

The docs walk through each one with real commands and output.