Skip to content

Architecture

RoboSmith is organized around a few explicit layers:

LayerResponsibility
CLITyper commands in robosmith.cmd.*.
Config modelsPydantic schemas in robosmith.config.
GraphsLangGraph workflows in robosmith.agent.graphs.*.
StagesDomain functions in robosmith.stages.*.
AgentsLiteLLM-backed model wrappers in robosmith.agent.models.*.
RegistriesEnvironment and trainer discovery.
InspectorsArtifact schema extraction and compatibility checking.
GeneratorsAdapter code generation.
DiagnosticsTrajectory analysis and comparison.

The robosmith run graph is built in robosmith.agent.graphs.run.pipeline.build_run_graph().

intake
-> scout or env_synthesis
-> env_synthesis
-> inspect_env
-> reward_design
-> training
-> evaluation
-> delivery or reward_design
-> END

Nodes are wrapped by _make_resumable_node(), which lets resumed runs skip completed nodes.

PipelineState is a TypedDict in robosmith.agent.state. It carries:

Field groupExamples
Identityrun_id, artifacts_dir
Inputstask_spec, config
Stage outputsknowledge_card, env_match, obs_docs, reward_candidate, training_result, eval_report
Controliteration, max_iterations, last_decision, status, status_message
Recoverycompleted_nodes, steps_log, training_reflection

The graph accumulates steps_log and treats most other fields as last-write-wins.

After every node, the graph writes checkpoint.json to the run directory. At the end, it writes a smaller run_state.json.

checkpoint.json # full resumable state
run_state.json # compact human-readable summary

Resume flow:

  1. Locate the run directory by full ID or prefix.
  2. Load checkpoint.json.
  3. Restore typed objects.
  4. Read completed_nodes.
  5. Re-run the graph while skipping completed nodes.

robosmith auto integrate is separate from the training graph. It uses IntegrateState and runs a narrower flow:

inspect_policy -> inspect_target -> check_compat -> gen_wrapper -> validate

The goal is not to train a policy. It is to make existing policy, dataset, and environment interfaces compatible enough for the next experiment.

RoboSmith uses registries for two extension surfaces:

RegistryModulePurpose
EnvRegistryrobosmith.envs.registrySearch a YAML catalog of environments.
EnvAdapterRegistryrobosmith.envs.adapter_registryLazy-load framework adapters.
TrainerRegistryrobosmith.trainers.registryLazy-load and select training backends.

Registries keep optional dependencies optional. Importing RoboSmith should not require every robotics framework.

Generated reward functions, external frameworks, and optional backends are all treated as failure-prone boundaries.

BoundaryRecovery pattern
Missing dependencyReport required packages and installation hint.
Reward exceptionConvert reward to 0.0 and store the error component.
Training failureReturn TrainingResult(error=...) and route to delivery or retry logic.
Evaluation failureRecord failed episode and continue remaining seeds.
Interrupted graphResume from checkpoint.json.

Delivery should leave enough behind to understand and reproduce a run:

ArtifactMeaning
reward_function.pyFinal evolved reward.
policy_*.zip or checkpointTrained policy artifact.
eval_report.jsonSuccess rate, reward stats, decision, criteria.
policy_rollout.mp4Optional video.
report.mdHuman-readable summary.
task_spec.jsonParsed task spec.
run_state.jsonCompact run state.
checkpoint.jsonResumable graph state.