How nvlabs/enpire works
ENPIRE is a real-world robot-policy improvement harness. Its documented workflow resets an environment, runs a policy on a robot, verifies and records the result, then uses evidence to refine the next experiment. Code-as-Policy and real-world RL are distinct improvement paths; station tooling supports both. The README establishes the overall loop, while sampled files show selected CAP-agent, UI, and RL relationships. Other subsystem links are documented capabilities rather than inspected call paths.
Main entry points: context.py RL actor context · agent_step.py Generate and execute steps · agent_pipeline.py Agent iteration loop · env.py Task environment
Components 21
Environment and station
- Task environment
enpire/env/forge/cap/env/real_bimanual_yam/env.py - Robot and station
enpire/env/forge/robot/yam/yam_controller.py - Station calibration
enpire/env/forge/yam/calibration/calibrator.py
Code-as-Policy
- CAP operator UI
enpire/env/forge/cap/ui/src/App.tsx - CAP UI API client
enpire/env/forge/cap/ui/src/api/client.ts - Agent iteration loop
enpire/env/forge/cap/agent/agent_pipeline.py - Agent run context
enpire/env/forge/cap/agent/agent_context.py - Generate and execute steps
enpire/env/forge/cap/agent/agent_step.py - LLM backend interface
enpire/env/forge/cap/agent/llm/base.py - Skill scripts and library
enpire/env/forge/cap/agent/skill_library.py
Real-world RL
- RL actor context
enpire/policy/rl/context.py - RL configuration
enpire/policy/rl/config.py - Reset and safety handlers
enpire/policy/rl/handlers.py - RL policy runtime
enpire/policy/rl/policy.py - Policy learner
enpire/policy/rl/learner.py - Rollout recording
enpire/policy/rl/record_episode_wrapper.py
Evaluation and refinement
- Reward verification
enpire/env/forge/cap/reward/evaluator.py - Failure analysis and reflection
enpire/env/forge/cap/agent/reflection.py - Experiment outcomes
enpire/policy/rl/record_episode_wrapper.py
Other components
- Researcher or agent
- ENPIRE CLI
enpire/cli.py
Connections 23
- Researcher or agent → ENPIRE CLI: starts runs
README.md - ENPIRE CLI → Task environment: runs examples
enpire/cli.py - Researcher or agent → CAP operator UI: operates
- CAP operator UI → CAP UI API client: requests actions
enpire/env/forge/cap/ui/src/App.tsx - CAP UI API client → Agent iteration loop: calls services
- Agent iteration loop → Agent run context: updates context
enpire/env/forge/cap/agent/agent_pipeline.py - Agent iteration loop → Generate and execute steps: runs steps
enpire/env/forge/cap/agent/agent_pipeline.py - Generate and execute steps → Agent run context: reads and writes
enpire/env/forge/cap/agent/agent_step.py - Generate and execute steps → LLM backend interface: generates code
enpire/env/forge/cap/agent/agent_step.py - Generate and execute steps → Skill scripts and library: executes scripts
- Task environment → Robot and station: runs on robot
- Station calibration → Robot and station: calibrates
- Researcher or agent → RL actor context: starts training
- RL actor context → RL configuration: uses settings
enpire/policy/rl/context.py - RL actor context → Reset and safety handlers: handles resets
enpire/policy/rl/handlers.py - RL actor context → RL policy runtime: routes actions
enpire/policy/rl/context.py - RL actor context → Policy learner: coordinates learner
enpire/policy/rl/context.py - Task environment → Reward verification: verifies outcomes
- RL actor context → Rollout recording: wraps episodes
enpire/policy/rl/context.py - Rollout recording → Experiment outcomes: records episodes
- Reward verification → Failure analysis and reflection: informs refinement
- Failure analysis and reflection → Agent iteration loop: guides next iteration
enpire/env/forge/cap/agent/agent_pipeline.py - Policy learner → RL policy runtime: improves policy