# rlinf/rpent architecture

> Architecture diagram of the GitHub repository rlinf/rpent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rlinf/rpent
- Repository: https://github.com/rlinf/rpent

## Overview

RPent is an agent framework for embodied manipulation: an operator starts a run, a robot-specific setup supplies task context and tools, and a planner reasons and dispatches actions through those tools to a simulated or real environment. Memory, dashboard interaction, VLA primitives, and evaluation or episode capture extend that core loop. The README documents multiple planner, simulator, and real-robot options; several of their implementation details were not sampled, so those branches are represented at their existing directories rather than with inferred internal connections.

Main entry points: [`rpent/cli/main.py`](https://github.com/rlinf/rpent/blob/main/rpent/cli/main.py) (Run CLI), [`rpent/robots/components/env_client_base.py`](https://github.com/rlinf/rpent/blob/main/rpent/robots/components/env_client_base.py) (Environment clients), [`rpent/tools/toolkit.py`](https://github.com/rlinf/rpent/blob/main/rpent/tools/toolkit.py) (Tool dispatch), [`rpent/planner/base.py`](https://github.com/rlinf/rpent/blob/main/rpent/planner/base.py) (Planner backends)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Run orchestration"]
  node_cli["Run CLI<br/>[main.py]"]
  node_robot_spec["Robot specification<br/>[robot_spec.py]"]
  node_prompts["Robot prompts<br/>[prompt_bundle.py]"]
end

subgraph group_agent["Planning and tools"]
  node_planner["Planner backends<br/>[base.py]"]
  node_codex["Codex planner<br/>[codex.py]"]
  node_claude["Claude Code planner<br/>[claude_code.py]"]
  node_toolkit["Tool dispatch<br/>[toolkit.py]"]
  node_common_tools["Common tools<br/>[common.py]"]
end

subgraph group_robot["Robot runtimes"]
  node_runtime["Robot runtime<br/>[runtime.py]"]
  node_env_clients["Environment clients<br/>[env_client_base.py]"]
  node_simulators["Simulators"]
  node_franka["Franka extensions"]
  node_dual_franka["Dual Franka"]
  node_robocasa["RoboCasa"]
  node_robotwin["RoboTwin"]
  node_vla["VLA clients<br/>[vla_client_base.py]"]
end

subgraph group_support["Memory and oversight"]
  node_memory[("Memory manager<br/>[manager.py]")]
  node_memory_tools["Memory tools<br/>[tools.py]"]
  node_dashboard["Dashboard<br/>[server.py]"]
  node_dashboard_state["Dashboard state<br/>[state.py]"]
  node_session["Run session<br/>[base.py]"]
  node_evaluation["Evaluation results<br/>[result.py]"]
  node_flywheel["Episode capture<br/>[episode.py]"]
end

node_operator(("Operator"))

node_operator -->|"starts run"| node_cli
node_cli -->|"selects robot"| node_robot_spec
node_cli -->|"creates planner"| node_planner
node_cli -->|"passes toolkit"| node_toolkit
node_cli -->|"renders prompts"| node_prompts
node_planner -->|"selects backend"| node_codex
node_planner -->|"selects backend"| node_claude
node_planner -->|"dispatches tools"| node_toolkit
node_toolkit -->|"registers handlers"| node_common_tools
node_toolkit -->|"registers handlers"| node_memory_tools
node_memory_tools -->|"accesses memory"| node_memory
node_robot_spec -.->|"configures runtime"| node_runtime
node_runtime -.->|"uses clients"| node_env_clients
node_env_clients -.->|"connects to"| node_simulators
node_env_clients -.->|"connects to"| node_franka
node_env_clients -.->|"connects to"| node_dual_franka
node_env_clients -.->|"connects to"| node_robocasa
node_env_clients -.->|"connects to"| node_robotwin
node_toolkit -.->|"uses primitives"| node_vla
node_cli -->|"starts optionally"| node_dashboard
node_dashboard -->|"serves state"| node_dashboard_state
node_dashboard_state -->|"projects session"| node_session
node_cli -->|"finalizes result"| node_evaluation
node_cli -.->|"captures episodes"| node_flywheel

click node_cli "https://github.com/rlinf/rpent/blob/main/rpent/cli/main.py"
click node_robot_spec "https://github.com/rlinf/rpent/blob/main/rpent/robots/robot_spec.py"
click node_runtime "https://github.com/rlinf/rpent/blob/main/rpent/robots/runtime.py"
click node_prompts "https://github.com/rlinf/rpent/blob/main/rpent/robots/prompt_bundle.py"
click node_planner "https://github.com/rlinf/rpent/blob/main/rpent/planner/base.py"
click node_codex "https://github.com/rlinf/rpent/blob/main/rpent/planner/codex.py"
click node_claude "https://github.com/rlinf/rpent/blob/main/rpent/planner/claude_code.py"
click node_toolkit "https://github.com/rlinf/rpent/blob/main/rpent/tools/toolkit.py"
click node_common_tools "https://github.com/rlinf/rpent/blob/main/rpent/tools/common.py"
click node_memory "https://github.com/rlinf/rpent/blob/main/rpent/memory/manager.py"
click node_memory_tools "https://github.com/rlinf/rpent/blob/main/rpent/memory/tools.py"
click node_env_clients "https://github.com/rlinf/rpent/blob/main/rpent/robots/components/env_client_base.py"
click node_simulators "https://github.com/rlinf/rpent/tree/main/robots/libero"
click node_franka "https://github.com/rlinf/rpent/tree/main/robots/franka"
click node_dual_franka "https://github.com/rlinf/rpent/tree/main/robots/dual_franka"
click node_robocasa "https://github.com/rlinf/rpent/tree/main/robots/robocasa"
click node_robotwin "https://github.com/rlinf/rpent/tree/main/robots/robotwin"
click node_vla "https://github.com/rlinf/rpent/blob/main/rpent/robots/components/vla_client_base.py"
click node_dashboard "https://github.com/rlinf/rpent/blob/main/rpent/dashboard/server.py"
click node_dashboard_state "https://github.com/rlinf/rpent/blob/main/rpent/dashboard/state.py"
click node_session "https://github.com/rlinf/rpent/blob/main/rpent/session/base.py"
click node_evaluation "https://github.com/rlinf/rpent/blob/main/rpent/evaluation/result.py"
click node_flywheel "https://github.com/rlinf/rpent/blob/main/rpent/flywheel/episode.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_robot_spec,node_prompts toneBlue
class node_planner,node_codex,node_claude,node_toolkit,node_common_tools toneAmber
class node_runtime,node_env_clients,node_simulators,node_franka,node_dual_franka,node_robocasa,node_robotwin,node_vla toneMint
class node_memory,node_memory_tools,node_dashboard,node_dashboard_state,node_session,node_evaluation,node_flywheel toneRose
class node_operator toneIndigo
```

## Components

### Run orchestration

- [Run CLI](https://github.com/rlinf/rpent/blob/main/rpent/cli/main.py): `rpent/cli/main.py`
- [Robot specification](https://github.com/rlinf/rpent/blob/main/rpent/robots/robot_spec.py): `rpent/robots/robot_spec.py`
- [Robot prompts](https://github.com/rlinf/rpent/blob/main/rpent/robots/prompt_bundle.py): `rpent/robots/prompt_bundle.py`

### Planning and tools

- [Planner backends](https://github.com/rlinf/rpent/blob/main/rpent/planner/base.py): `rpent/planner/base.py`
- [Codex planner](https://github.com/rlinf/rpent/blob/main/rpent/planner/codex.py): `rpent/planner/codex.py`
- [Claude Code planner](https://github.com/rlinf/rpent/blob/main/rpent/planner/claude_code.py): `rpent/planner/claude_code.py`
- [Tool dispatch](https://github.com/rlinf/rpent/blob/main/rpent/tools/toolkit.py): `rpent/tools/toolkit.py`
- [Common tools](https://github.com/rlinf/rpent/blob/main/rpent/tools/common.py): `rpent/tools/common.py`

### Robot runtimes

- [Robot runtime](https://github.com/rlinf/rpent/blob/main/rpent/robots/runtime.py): `rpent/robots/runtime.py`
- [Environment clients](https://github.com/rlinf/rpent/blob/main/rpent/robots/components/env_client_base.py): `rpent/robots/components/env_client_base.py`
- [Simulators](https://github.com/rlinf/rpent/tree/main/robots/libero): `robots/libero`
- [Franka extensions](https://github.com/rlinf/rpent/tree/main/robots/franka): `robots/franka`
- [Dual Franka](https://github.com/rlinf/rpent/tree/main/robots/dual_franka): `robots/dual_franka`
- [RoboCasa](https://github.com/rlinf/rpent/tree/main/robots/robocasa): `robots/robocasa`
- [RoboTwin](https://github.com/rlinf/rpent/tree/main/robots/robotwin): `robots/robotwin`
- [VLA clients](https://github.com/rlinf/rpent/blob/main/rpent/robots/components/vla_client_base.py): `rpent/robots/components/vla_client_base.py`

### Memory and oversight

- [Memory manager](https://github.com/rlinf/rpent/blob/main/rpent/memory/manager.py): `rpent/memory/manager.py`
- [Memory tools](https://github.com/rlinf/rpent/blob/main/rpent/memory/tools.py): `rpent/memory/tools.py`
- [Dashboard](https://github.com/rlinf/rpent/blob/main/rpent/dashboard/server.py): `rpent/dashboard/server.py`
- [Dashboard state](https://github.com/rlinf/rpent/blob/main/rpent/dashboard/state.py): `rpent/dashboard/state.py`
- [Run session](https://github.com/rlinf/rpent/blob/main/rpent/session/base.py): `rpent/session/base.py`
- [Evaluation results](https://github.com/rlinf/rpent/blob/main/rpent/evaluation/result.py): `rpent/evaluation/result.py`
- [Episode capture](https://github.com/rlinf/rpent/blob/main/rpent/flywheel/episode.py): `rpent/flywheel/episode.py`

### Other components

- **Operator**

## Connections

- Operator → Run CLI: starts run (evidence: `README.md`)
- Run CLI → Robot specification: selects robot (evidence: `rpent/cli/main.py`)
- Run CLI → Planner backends: creates planner (evidence: `rpent/cli/main.py`)
- Run CLI → Tool dispatch: passes toolkit (evidence: `rpent/cli/main.py`)
- Run CLI → Robot prompts: renders prompts (evidence: `rpent/cli/main.py`)
- Planner backends → Codex planner: selects backend (evidence: `rpent/planner/base.py`)
- Planner backends → Claude Code planner: selects backend (evidence: `rpent/planner/base.py`)
- Planner backends → Tool dispatch: dispatches tools (evidence: `rpent/planner/base.py`)
- Tool dispatch → Common tools: registers handlers (evidence: `rpent/tools/toolkit.py`)
- Tool dispatch → Memory tools: registers handlers (evidence: `rpent/memory/tools.py`)
- Memory tools → Memory manager: accesses memory (evidence: `rpent/memory/tools.py`)
- Robot specification → Robot runtime: configures runtime
- Robot runtime → Environment clients: uses clients
- Environment clients → Simulators: connects to (evidence: `robots/libero/env_client.py`)
- Environment clients → Franka extensions: connects to (evidence: `robots/franka/env_client.py`)
- Environment clients → Dual Franka: connects to
- Environment clients → RoboCasa: connects to (evidence: `robots/robocasa/env_client.py`)
- Environment clients → RoboTwin: connects to (evidence: `robots/robotwin/env_client.py`)
- Tool dispatch → VLA clients: uses primitives
- Run CLI → Dashboard: starts optionally (evidence: `rpent/cli/dashboard.py`)
- Dashboard → Dashboard state: serves state (evidence: `rpent/dashboard/server.py`)
- Dashboard state → Run session: projects session (evidence: `rpent/dashboard/state.py`)
- Run CLI → Evaluation results: finalizes result (evidence: `rpent/cli/main.py`)
- Run CLI → Episode capture: captures episodes
