A foundation-model call can take seconds, but the environment does not pause during inference: control must continue, and the result may be stale when it arrives. Unlike layers in a deep learning graph, robot modules must also compose in time: when each runs and which inputs it consumes. We call this temporal compositionality. Retriever makes these temporal choices explicit in the graph, separate from module code, so they can be specified and inspected.
This post walks through the design requirements, how they lead to three primitives, the guarantees they give, the runtime and middleware comparison, and the evidence. The home page shows the Retriever-0 robot agent and its program.
Design requirements
A foundation model may think for seconds while the controller must keep acting. So a robot program must say when each part runs and what it reads.
Compose modules
and their timing.
Temporal compositionality. Reusable Flows compute from their inputs and local state. Each Flow declares a Clock, and each input edge declares a Sync policy. Feedback such as inspect, update memory, replan, run the next skill is wired in the graph, not hidden in callbacks.
Paper: D1 compositionality, D3 closed‑loop modularity
Slow models,
fast control.
Physical time. A foundation-model call may take seconds while control must keep acting. Flows run side by side, each on its own Clock. At each tick, a Sync policy decides which inputs a Flow reads, whether the producer is faster or slower: drop stale data, play back an action chunk, time out, or fall back when an input lags.
Paper: D2 asynchronous multi‑rate, D4 explicit time semantics
Replay what ran,
and when.
Replayable timing. With deterministic Flows and Sync policies, fixed initial states, recorded inputs, clock and commit decisions (including lag), fixed random draws, strictly causal feedback, and same-tick reads in dependency order, the agent's output history is unique under replay. It replays the program, not the physical world. Timing is declared in the graph, not in the backend, so the same graph and its declarations run on any backend with an adapter; live traces can still differ.
Paper: D5 determinism and replay, D6 supported backend mapping
The six design requirements (D1–D6)
| Requirement | Question it answers | Drawer-search example |
|---|---|---|
| D1 · Compositionality | Can a stateful component be reused? | Memory keeps which drawers were checked |
| D2 · Asynchronous multi-rate | When does each component run? | Planning is slow, control is fast |
| D3 · Closed-loop modularity | Can information flow back upstream? | Skill progress returns to the monitor |
| D4 · Explicit time semantics | Which inputs belong to each invocation? | Each policy call reads specific camera frames |
| D5 · Determinism, replay, and debuggability | When can we replay the computation? | Deterministic modules, fixed initial states, logged inputs, clocks, and random draws |
| D6 · Supported backend mapping | Is the program separate from its runtime? | Same program runs in-process, across processes, or on Dora |
From requirements to primitives
Each part of Retriever’s design answers one of these requirements directly:
- Multi-rate stateful feedback (D1–D3) →
Flow+Clock. Each module needs a sequentialstep()boundary with local state so perception, belief memory, planning, skills, and control can be swapped and wired into explicit feedback loops rather than hidden in callbacks. Attaching a Clock (@Rateor@Trigger) to each Flow lets slow reasoning and fast control run side by side without locking the graph to one global tick. - Variable latency and rate mismatch (D2, D4) →
Syncpolicies + temporal chunking. When producers and consumers run at different rates and inference takes variable time, every edge declares a deterministic rule for which committed upstream history a step reads (Latest,Window,Prev). When a slow producer must keep a fast consumer fed without blocking, the same primitives carry time-extended plan chunks and action chunks. - Reproducible debugging and deployment (D5–D6) → Graph IR → actors. Keeping timing and input-selection rules declarative in the graph separates program semantics from runtime placement. Compiling the graph to a static IR lets the same program step deterministically in a single process for debugging (
pipe.step()/run_logical()) and lower onto multiprocessing or Dora actors on the robot (pipe.run()).
Three primitives
We lift the standard agent–environment loop to continuous time: observations, computation completions, and actions become streams over event time rather than values locked to one global step. A causal map between these streams is a causal stream function (CSF). A Flow is a CSF bound to a clock and sync policies: the CSF fixes what it computes, the clock when it runs, and the sync policies which aligned snapshot it consumes.
In code, a clock attaches to a Flow with @, and each edge declares its sync policy:
# 1) Define Flows (what) + run clocks (when)vla = VLASkillFlow("pi05") @Rate(hz=2)robot = ControllerFlow(id=0) @Rate(hz=200)
# 2) Build the graph (composition + sync on edges)with pipe: wrist_cam.then(vla, sync=Latest())\ .then(robot, sync=Latest())Flow: what it computes
A Flow is analogous to nn.Module in PyTorch: a stateful Python class with typed inputs and outputs that you can instantiate, call directly with flow(inp), and compose with others—no async runtime required for local testing. The difference is that PyTorch has no notion of when a module runs or how long computation takes; Retriever adds that timing layer by binding each Flow to one declared clock and attaching sync policies to its incoming edges.
At the -th tick , a Flow evaluates its synchronous local transition
where and are the local state immediately before and after the event, and is the synchronized input snapshot consumed by the step. Every Flow owns exactly one run clock, enforcing single-threaded sequential semantics per module.
# Example: a VLA skill flow @2Hz# (wrist cam, robot state, SkillCmd) -> ActionChunkclass VLASkillFlow(Flow): def reset(self): self.skill = None
def step(self, inp): # inp is aligned by sync policies cam_obs, state, skill_cmd = inp self.skill = skill_cmd return self.vla(cam_obs, state, self.skill)Inputs are aligned before step(inp); the Flow owns local state and runs on its one declared clock.
Full typed Flow and Retriever-0 port-mapping example
from dataclasses import dataclassfrom retriever import Flow, io
@io@dataclassclass VLAInput: camera: CameraData state: RobotState skill_cmd: SkillCommand
class VLASkillFlow(Flow[VLAInput, ActionChunk]): def __init__(self, model_name: str): self.processor = load_vla_processor(model_name) self.policy = load_vla_policy(model_name) self.last_chunk = None
def reset(self): self.last_chunk = None
def step(self, inp: VLAInput) -> ActionChunk: model_inputs = self.processor.prepare( image=inp.camera.rgb, proprio=self._encode_state(inp.state), instruction=inp.skill_cmd.text, previous_chunk=self.last_chunk, ) raw_actions = self.policy.sample_actions(model_inputs, horizon=8) chunk = self.processor.decode_chunk(raw_actions, reference_state=inp.state) self.last_chunk = chunk return chunk
# Direct local call without any runtime infrastructure:vla = VLASkillFlow("pi05")chunk = vla(VLAInput(camera=cam_frame, state=robot_state, skill_cmd=cmd))# Illustrative Retriever-0 port mappings; field and trigger names are simplifiedwrist_cams = WristCameraFlow() @ Rate(hz=30)head_cam = HeadCameraFlow() @ Rate(hz=30)goal = GoalFlow() @ Rate(hz=1)belief = BeliefMemoryFlow() @ Trigger("inspection_done")planner = VLMPlanFlow("gemini") @ Trigger("replan_request")monitor = ExecMonitorFlow() @ Trigger("belief_or_progress")vla = VLASkillFlow("pi05") @ Rate(hz=2)ctrl = ControllerFlow() @ Rate(hz=200)teleop = TeleopFlow() @ Rate(hz=100)
with Pipeline("Retriever-0") as pipe: goal.then(planner, map={"task": "task"}, sync=Latest()) goal.then(monitor, map={"task": "task"}, sync=Latest())
wrist_cams.then(belief, map={"frame": "frames"}, sync=Latest()) belief.then(planner, map={"belief": "state"}, sync=Latest()) belief.then(monitor, map={"belief": "state"}, sync=Latest()) head_cam.then(planner, map={"frame": "frame"}, sync=Latest())
planner.then(monitor, map={"result": "planner_result"}, sync=Latest()) monitor.then(planner, map={"replan_trigger": "context"}, sync=Latest()) monitor.then(belief, map={"inspection_done": "inspection"}, sync=Latest())
monitor.then(vla, map={"current_skill": "prompt"}, sync=Latest()) vla.then(monitor, map={"feedback": "policy_feedback"}, sync=Latest())
wrist_cams.then(vla, map={"frame": "obs_dict"}, sync=Latest()) vla.then(ctrl, sync=Latest())
teleop.then(ctrl, sync=Latest())
pipe.run(backend="dora", duration=300.0)Clock: when it runs
A clock defines when a module runs. Clocks can be periodic, event-driven, a union of both, or driven by external synchronization signals. Event time remains continuous; clocks induce local decision epochs, so composition yields interleaved local steps rather than one global step sequence. In Retriever-0, the cameras run at @Rate(hz=30), the VLA at @Rate(hz=2), the controller at @Rate(hz=200), and the planner at @Trigger("replan").
Sync policy: which inputs each run consumes
Each Flow runs on its own clock, so upstream outputs arrive at different rates and times, and each Flow must align its inputs locally. A sync policy is a deterministic function of the upstream inputs and their timestamps. Before each step(), it selects values from the committed upstream histories and builds one input snapshot. Downstream sync policies read events committed up to their own tick, with events of the same tick read in dependency order, and a Prev() edge reads only events committed before the tick.
For example, an edge carries the (time, value) events (0.10, 1), (0.20, 4), (0.35, 9), (0.60, 16), and the consumer ticks at 0.50. Assume each event becomes visible at its timestamp; the history visible at this tick drops the future event at 0.60. The same history then yields different snapshots under different policies:
hist = edge.visible_history(0.50)
sync(Latest(), hist) -> 9sync(Window(duration=0.30), hist) -> [4, 9]sync(Window(duration=0.45), hist) -> [1, 4, 9]Latest samples and holds at the downstream tick, Window(duration=w) keeps events timestamped in [t − w, t], and Join bundles synchronized edge values into one downstream input record. A sensor timestamp alone does not establish that the event had arrived by the tick. When compute cannot keep up, the user chooses the fallback for each edge and clock: hold the last valid value for a bounded duration, mark an input missing or expired, trigger a safe fallback, or raise an error in debug mode.
A downstream step() consumes a synchronized snapshot assembled by deterministic policies such as Latest() and Window() from asynchronous streams.
Temporal chunking
Between Flows with mismatched rates, plan chunks and action chunks carry time-extended outputs, so slow planning overlaps skill execution and 2 Hz inference keeps 200 Hz control fed. Chunking uses the same primitives, as a buffering policy on an edge or as a small Flow.
- Action chunks. The skill Flow emits an
ActionChunk; the controller samples one action per 200 Hz control tick. - Plan chunks. By default, the VLM plans the next chunk of up to five skills (
PlanChunk) while the VLA executes the current one. The monitor removes overlap from each newPlanChunkand appends only its new suffix:A,B,C,DatCplusB,C,D,EbecomesA,B,C,D,E. It uses predicted progress to switch to the next skill when the skill is nearing completion.
Arrows are computation intervals; blocks are chunk-validity horizons. Overlap keeps downstream clocks running while the next plan or action chunk is produced.
Theoretical guarantees
Closed-loop composition makes these graphs cyclic. Instantaneous cycles would impose algebraic constraints such as . Therefore every directed cycle must contain at least one delay or strictly causal edge whose consumer sees only producer events from times . A finite graph of CSFs is itself a CSF when its feedback is strictly causal and its events are locally finite.
If all its ticks, including event-driven ones, are locally finite and its same-instant dependencies are acyclic, a finite graph of Flows is again a Flow: for fixed initial states, boundary inputs, and a fixed clock/commit trace (including lag decisions), it has one behavior, and one Flow on the covering clock (the union of all tick and commit times in the graph) gives the same boundary outputs.
Any deterministic policy in the asynchronous agent–environment loop with locally finite decision times, computable transitions, fixed-size memory, finite aligned inputs from committed observation histories via deterministic sync policies, and strictly causal feedback can be implemented by a Retriever graph with the same action stream for every committed observation history and clock/commit trace.
The proof constructs a single-rate policy as a Scan, optionally followed by a Map, under one Clock; multi-rate policies couple such loops through deterministic sync edges. Policies whose actions depend on message arrival order, or on wall-clock reads that are not logged as input streams, fall outside this class. A stream of realized draws, seeds, or logged model outputs extends the result to stochastic policies.
For a finite graph, fix deterministic Flow code and sync policies, initial states, committed external-input histories, and a locally finite clock/commit trace (including lag decisions and which commits each consumer sees at each tick), with strictly causal feedback and same-tick reads in dependency order. If stochastic calls use logged outputs or deterministic sampling with fixed seeds, the output history is unique and independent of runtime scheduling.
Replay requires initial states, consumed input identities and payloads, consumer-visible histories, clock/commit decisions (including lag and tie decisions), and stochastic seeds or outputs.
Runtime
Retriever separates graph definition from execution:
- Definition (Python). Users define Flows and connect them into a graph. This code is declarative; no threads are spawned yet.
- Compilation (IR). The system compiles the Python objects into a static IR that captures topology, clock definitions, and synchronization parameters.
- Execution (actors). The IR is sent to a backend. Each actor typically runs one Flow with its own state; edges become message channels and deterministic adapters.
The same graph can run with supported executors, including in-process stepping, multiprocessing, and Dora: pipe.step(dt=0.1) runs in the main process for debugging, and pipe.run(backend="dora") runs asynchronously to deploy. Live clock/commit traces can differ across backends, and graph portability alone does not guarantee real-time deadlines. ROS 2, Dora, and other messaging substrates still handle transport and device integration; Retriever complements this communication layer at a higher level of abstraction. The home page shows recording and replaying a run.
Definition
Write Flows, clocks, ports, and edge policies as one agent graph. No runtime placement is implied yet.
Clear semantics
Clocks and sync policies define input selection from visible histories. Exact replay also fixes initial states, the clock/commit trace, and stochastic outcomes.
Runtime mapping
Dispatch the graph to local stepping, multiprocessing, or a supported transport backend while preserving the same consumed-input contract.
Hardware abstraction
Device and transport adapters sit below the graph, so hardware-specific behavior is not treated as part of the algorithm.
Illustrative IR snippet
{ "version": "1.0.0", "metadata": { "name": "Agent", "validated": true, "optimized": false }, "nodes": [ { "id": "camera", "type": "CameraSourceFlow", "config": {"clock": {"Rate": {"hz": 30}}} }, { "id": "vla", "type": "VLASkillFlow", "config": {"clock": {"Rate": {"hz": 2}}} } ], "edges": [ { "source": {"node": "camera", "port": "rgb"}, "destination": {"node": "vla", "port": "camera"}, "adapter": {"latest": {"buffer_size": 1}}, "qsize": 10 } ], "topology": { "node_count": 2, "edge_count": 1, "has_cycle": false }}Execution modes: in-process, multiprocess, and Dora
The same authored graph can be lowered into several execution modes:
- in-process for local debugging and deterministic stepping, where
pipe.step()lets you inspect one logical firing at a time - multiprocess when you want isolation between modules on one machine while keeping the same authored graph
- Dora-backed execution when you want the same graph on a different runtime substrate with explicit transport underneath
What changes between those modes is the execution mapping underneath the graph, not the authored graph itself. The Python Flow classes, the clocks, and the edgewise sync policies stay fixed while the runtime decides how to place and schedule them.
Middleware comparison
Program semantics are separate from communication: different communication substrates can support the same abstraction. Retriever makes activation clocks and input selection explicit in the authored graph, whereas ROS 2 and Dora provide transport and scheduling tools on top of which applications define their own callback, buffer, and timer contracts.
Authoring model
Ordinary step() code over one aligned input
Async coordination logic spread across callbacks, timers, and topic state
Time semantics
Explicit clocks and sync policies select from consumer-visible histories
The application defines its input-selection contract using callbacks, buffers, and timers
Functional determinism
Same outputs under the fixed-trace replay conditions above
Equivalent contracts can reproduce the same selections and decisions; transport alone does not define them
Variable latency
Declared via clocks, triggers, and buffer policies
Manual worker threads, queues, drop logic, and stale-data handling
Illustrative code: Retriever vs. ROS 2
The snippets below omit message definitions and model-loading boilerplate. They show where timing, buffering, and launch logic end up.
from dataclasses import dataclass
from retriever import Flow, Pipeline, Rate, Latest, io
from retriever.flow import Trigger
@io
@dataclass
class VLAInput:
camera: "CameraFrame"
state: "RobotState"
active_skill: "SkillCommand"
class PlannerFlow(Flow["BeliefState", "PlanChunk"]):
def step(self, belief):
return self.vlm_plan(belief)
class VLASkillFlow(Flow[VLAInput, "ActionChunk"]):
def step(self, inp):
return self.vla(inp.camera, inp.state, inp.active_skill)
with Pipeline("Agent") as pipe:
cam = CameraSourceFlow() @ Rate(hz=30)
belief = BeliefUpdaterFlow() @ Trigger("observation")
planner = PlannerFlow("gemini") @ Trigger("state")
monitor = ExecutionMonitorFlow() @ Trigger("belief_or_progress")
vla = VLASkillFlow("pi05") @ Rate(hz=2)
ctrl = ControllerFlow() @ Rate(hz=200)
cam.then(belief, sync=Latest())
belief.then(planner, sync=Latest())
belief.then(monitor, sync=Latest())
planner.then(monitor, sync=Latest())
cam.then(vla, sync=Latest())
monitor.then(vla, sync=Latest())
vla.then(ctrl, sync=Latest())
if __name__ == "__main__":
pipe.run(backend="dora", duration=30.0)Design lineage
Retriever draws on classic systems ideas while adapting them to cyclic, stateful, latency-sensitive robot agents whose graphs must specify both what data flows and when each output is valid.
Composable processes. Small units become powerful when connected by simple streams; Retriever keeps that compositional instinct while adding clocks, feedback, and typed temporal handoff.
Graphs as program structure. ML frameworks make computation graphs concrete enough to inspect and execute; Retriever uses a graph boundary for stateful robot Flows over time.
Actors as runtime units. Actor systems are a natural execution model for independent modules; Retriever uses that lesson below the programming model while preserving graph semantics.
Robotics middleware. Robot systems need practical message passing and device integration; Retriever focuses on the agent-level timing and handoff contract above that substrate.
Evidence
The evaluation asks three questions. Capability: can Retriever support long-horizon real-world manipulation that coordinates slow reasoning (VLM), medium-frequency skills (VLA), and fast control? Efficiency: how much transport overhead does Retriever add, and how does the pipeline behave when each of four architectural features is removed? Usability: does making time explicit help reproduce, replay, and debug agent behavior?
Capability and ablations
Retriever-0 runs on a bimanual robot in two tasks. In spice search, spice bottles are placed across four closed drawers, with the target in the second, third, or fourth drawer. In bag retrieval, one arm lifts and steadies a deformable bag while the other reaches in to retrieve the target item. Task progress is the fraction of the task’s skills completed, with partial credit for the skill in progress; it is not a success rate.
The full pipeline reaches 73% on spice search (averaged over the three cases) and 100% on bag retrieval. The policy-only baselines receive camera observations, robot state, and the language goal, but no explicit planner, belief memory, execution monitor, or skill-program structure. They score 0% on the drawer cases; on bag retrieval, π0.5 reaches 41% and the diffusion policy 23%.
The full pipeline makes the most progress on both tasks; policies alone reach 0% on drawer search.
Each ablation removes one feature:
- Plan chunking is replaced by single-skill blocking planning, which changes both planning horizon and overlap (63% and 93%).
- Progress prediction is replaced by VLM queries that ask whether the skill has finished; the VLM did not detect completion, so execution does not advance (12.5% and 25%).
- Belief memory: on spice search the agent repeatedly re-searches the first drawer and never terminates; on bag retrieval it finishes but sometimes misses objects (20% and 66%).
- Replanning: after opening a drawer, the plan no longer matches what the agent now knows (15% and 47%).
Table III as published
| Condition | Spice: proj. time | Spice: task progress | Bag: proj. time | Bag: task progress |
|---|---|---|---|---|
| Retriever-0 (full) | 56 s | 73% | 36 s | 100% |
| − Plan chunking | 65 s | 63% | 37 s | 93% |
| − Progress prediction | — | 12.5% | — | 25% |
| − Belief memory | — | 20% | 45 s | 66% |
| − Replanning | — | 15% | — | 47% |
| + Human-in-the-loop | 50 s | 100% | 35 s | 100% |
| π0.5 (VLA only) | — | 0% | 41 s | 41% |
| Diffusion policy only | — | 0% | 40 s | 23% |
Projected time divides elapsed time to best progress by that progress, rounded to seconds. It is a descriptive linear normalization, not measured completion time or a validated speedup estimate. ”—” denotes a stalled or otherwise non-projectable run. The human-in-the-loop condition uses teleoperation; it is not autonomous.
Efficiency: message-passing overhead
Message latency benchmark
Retriever adds little overhead to the transport it runs on: with the Dora backend, it closely matches native Dora.
Compared with the ROS 2 process-based baselines (Python and C++), Retriever-Dora has higher median latency for small payloads, from 512 B through 64 KB (through 256 KB for C++), and lower latency from about 512 KB upward. The figure also shows a stronger ROS 2 C++ components baseline, in which composable nodes share one process; it should be compared with Retriever’s single-process backend, which has lower latency for small messages used in control and coordination.
Producer–consumer message latency versus payload size.
Hybrid differentiable physics
A discrete bouncing-ball program combines numerical integration with impact branches over 100 steps of 0.01 s; fixing which earlier state each step reads fixes the differentiated program.
Path-gradient consistency. The nominal loop produces one identical trace and gradient (−0.005496) across 100 runs, while an arbitrary-history stress variant (uniform earlier state with probability 0.2) yields a gradient standard deviation of 0.1788.
Illustrative bouncing-ball trajectories with discrete impact events.
Discrete-program gradients of squared terminal-height loss across 100 runs: the nominal loop gives one gradient (−0.005496, matching the dashed central finite-difference reference), while arbitrary-history state selection spreads across runs (σ = 0.1788).
Usability: determinism and replay
- Path gradients. In a discrete bouncing-ball program of 100 steps of 0.01 s, the nominal loop produces one identical trace and gradient (−0.005496) across 100 runs. An arbitrary-history stress variant selects a uniformly sampled earlier state with probability 0.2; its 100 traces yield a gradient standard deviation of 0.1788. This intervention changes the differentiated program rather than measuring transport jitter.
- Flow differentiation. Tensor-valued Flows executed through Retriever’s in-process stepper reproduce the nominal derivatives in four configurations, with ten fresh executions each.
- Matched ROS 2 component comparison. A ROS 2 reimplementation of the
Latestselection rule matches an independent reference in selected inputs, states, and decisions on all 19,200 samples in 400 synthetic cases per campaign, including a repeat with requested host sleeps up to 500 microseconds. This tests equivalent component contracts, not autonomous scheduling or the native recorder’s round trip.
Theorem 2 gives the replay guarantee for a fixed trace.