# insait-institute/phirie architecture

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

- Interactive diagram: https://gitdiagram.com/insait-institute/phirie
- Repository: https://github.com/insait-institute/phirie

## Overview

ϕ-RIE converts captured room data into editable, physically interactive environments. Its principal workflow moves from scene reconstruction and object discovery through 3D asset generation, metric registration, background completion, and simulation; PhiView then presents those environments for exploration and interaction. The repository also contains robot-policy evaluation, appearance harmonization, and a command/studio layer. README statements support the broad workflow links; source excerpts and the SOURCE INDEX support only the specific internal links shown, so unsampled subsystem wiring is left out.

Main entry points: [`robo/sim/s7_sim.py`](https://github.com/insait-institute/phirie/blob/main/robo/sim/s7_sim.py) (Physics simulation), [`agents/recon`](https://github.com/insait-institute/phirie/tree/main/agents/recon) (Scene reconstruction), [`agents/discover`](https://github.com/insait-institute/phirie/tree/main/agents/discover) (Object discovery), [`agents/models`](https://github.com/insait-institute/phirie/tree/main/agents/models) (3D asset generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_construction["Scene construction"]
  node_reconstruction["Scene reconstruction"]
  node_discovery["Object discovery"]
  node_generation["3D asset generation"]
  node_registration["Metric registration<br/>[metricize.py]"]
  node_background["Background completion"]
  node_shared["Scene utilities<br/>[common.py]"]
end

subgraph group_interaction["Simulation and robotics"]
  node_simulation["Physics simulation<br/>[s7_sim.py]"]
  node_room_collision["Room collision export<br/>[room_collision.py]"]
  node_robot_rig["Robot rig<br/>[pi05_rig.py]"]
  node_robot_tasks["Robot tasks<br/>[pi05_tasks.py]"]
  node_policy_client["Policy client<br/>[pi05_client.py]"]
end

subgraph group_view["Viewing and editing"]
  node_studio["PhiView Studio<br/>[app.py]"]
  node_job_builder["Stage job builder<br/>[pipeline.py]"]
  node_harmonizer_client["Appearance harmonizer"]
  node_harmonizer_service["Harmonizer service<br/>[server.py]"]
end

subgraph group_runtime["Runtime and evaluation"]
  node_cli["Module command runtime<br/>[cli.py]"]
  node_manifest["Run manifests<br/>[io.py]"]
  node_robot_eval["Robot evaluation<br/>[pi05_eval.py]"]
  node_fidelity_eval["Fidelity metrics"]
end

node_capture(("Captured scene input"))

node_capture -->|"reconstructs from"| node_reconstruction
node_reconstruction -->|"feeds discovery"| node_discovery
node_discovery -->|"generates assets"| node_generation
node_generation -->|"registers assets"| node_registration
node_registration -->|"completes background"| node_background
node_background -->|"builds environment"| node_simulation
node_simulation -->|"explores interactively"| node_studio
node_shared -->|"used by"| node_simulation
node_room_collision -->|"used by"| node_simulation
node_robot_tasks -->|"defines tasks for"| node_robot_rig
node_studio -.->|"harmonizes appearance"| node_harmonizer_client
node_harmonizer_client -->|"sends requests"| node_harmonizer_service
node_cli -.->|"runs modules"| node_manifest
node_robot_eval -.->|"uses policy"| node_policy_client
node_fidelity_eval -->|"reads manifests"| node_manifest

click node_reconstruction "https://github.com/insait-institute/phirie/tree/main/agents/recon"
click node_discovery "https://github.com/insait-institute/phirie/tree/main/agents/discover"
click node_generation "https://github.com/insait-institute/phirie/tree/main/agents/models"
click node_registration "https://github.com/insait-institute/phirie/blob/main/agents/recon/metricize.py"
click node_background "https://github.com/insait-institute/phirie/tree/main/agents/edit"
click node_shared "https://github.com/insait-institute/phirie/blob/main/agents/core/common.py"
click node_simulation "https://github.com/insait-institute/phirie/blob/main/robo/sim/s7_sim.py"
click node_room_collision "https://github.com/insait-institute/phirie/blob/main/robo/sim/room_collision.py"
click node_robot_rig "https://github.com/insait-institute/phirie/blob/main/robo/rigs/pi05_rig.py"
click node_robot_tasks "https://github.com/insait-institute/phirie/blob/main/robo/tasks/pi05_tasks.py"
click node_policy_client "https://github.com/insait-institute/phirie/blob/main/robo/policy/clients/pi05_client.py"
click node_studio "https://github.com/insait-institute/phirie/blob/main/tools/phiview/physicalview/app.py"
click node_job_builder "https://github.com/insait-institute/phirie/blob/main/tools/phiview/physicalview/pipeline.py"
click node_harmonizer_client "https://github.com/insait-institute/phirie/blob/main/robo/rendering/harmonizer_client.py"
click node_harmonizer_service "https://github.com/insait-institute/phirie/blob/main/tools/harmonizer/server.py"
click node_cli "https://github.com/insait-institute/phirie/blob/main/phiroom/cli.py"
click node_manifest "https://github.com/insait-institute/phirie/blob/main/robo/manifest/io.py"
click node_robot_eval "https://github.com/insait-institute/phirie/blob/main/robo/eval/pi05_eval.py"
click node_fidelity_eval "https://github.com/insait-institute/phirie/blob/main/robo/eval/fidelity_metrics.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_reconstruction,node_discovery,node_generation,node_registration,node_background,node_shared toneBlue
class node_simulation,node_room_collision,node_robot_rig,node_robot_tasks,node_policy_client toneAmber
class node_studio,node_job_builder,node_harmonizer_client,node_harmonizer_service toneMint
class node_cli,node_manifest,node_robot_eval,node_fidelity_eval toneRose
class node_capture toneIndigo
```

## Components

### Scene construction

- [Scene reconstruction](https://github.com/insait-institute/phirie/tree/main/agents/recon): `agents/recon`
- [Object discovery](https://github.com/insait-institute/phirie/tree/main/agents/discover): `agents/discover`
- [3D asset generation](https://github.com/insait-institute/phirie/tree/main/agents/models): `agents/models`
- [Metric registration](https://github.com/insait-institute/phirie/blob/main/agents/recon/metricize.py): `agents/recon/metricize.py`
- [Background completion](https://github.com/insait-institute/phirie/tree/main/agents/edit): `agents/edit`
- [Scene utilities](https://github.com/insait-institute/phirie/blob/main/agents/core/common.py): `agents/core/common.py`

### Simulation and robotics

- [Physics simulation](https://github.com/insait-institute/phirie/blob/main/robo/sim/s7_sim.py): `robo/sim/s7_sim.py`
- [Room collision export](https://github.com/insait-institute/phirie/blob/main/robo/sim/room_collision.py): `robo/sim/room_collision.py`
- [Robot rig](https://github.com/insait-institute/phirie/blob/main/robo/rigs/pi05_rig.py): `robo/rigs/pi05_rig.py`
- [Robot tasks](https://github.com/insait-institute/phirie/blob/main/robo/tasks/pi05_tasks.py): `robo/tasks/pi05_tasks.py`
- [Policy client](https://github.com/insait-institute/phirie/blob/main/robo/policy/clients/pi05_client.py): `robo/policy/clients/pi05_client.py`

### Viewing and editing

- [PhiView Studio](https://github.com/insait-institute/phirie/blob/main/tools/phiview/physicalview/app.py): `tools/phiview/physicalview/app.py`
- [Stage job builder](https://github.com/insait-institute/phirie/blob/main/tools/phiview/physicalview/pipeline.py): `tools/phiview/physicalview/pipeline.py`
- [Appearance harmonizer](https://github.com/insait-institute/phirie/blob/main/robo/rendering/harmonizer_client.py): `robo/rendering/harmonizer_client.py`
- [Harmonizer service](https://github.com/insait-institute/phirie/blob/main/tools/harmonizer/server.py): `tools/harmonizer/server.py`

### Runtime and evaluation

- [Module command runtime](https://github.com/insait-institute/phirie/blob/main/phiroom/cli.py): `phiroom/cli.py`
- [Run manifests](https://github.com/insait-institute/phirie/blob/main/robo/manifest/io.py): `robo/manifest/io.py`
- [Robot evaluation](https://github.com/insait-institute/phirie/blob/main/robo/eval/pi05_eval.py): `robo/eval/pi05_eval.py`
- [Fidelity metrics](https://github.com/insait-institute/phirie/blob/main/robo/eval/fidelity_metrics.py): `robo/eval/fidelity_metrics.py`

### Other components

- **Captured scene input**

## Connections

- Captured scene input → Scene reconstruction: reconstructs from (evidence: `README.md`)
- Scene reconstruction → Object discovery: feeds discovery (evidence: `README.md`)
- Object discovery → 3D asset generation: generates assets (evidence: `README.md`)
- 3D asset generation → Metric registration: registers assets (evidence: `README.md`)
- Metric registration → Background completion: completes background (evidence: `README.md`)
- Background completion → Physics simulation: builds environment (evidence: `README.md`)
- Physics simulation → PhiView Studio: explores interactively (evidence: `README.md`)
- Scene utilities → Physics simulation: used by (evidence: `robo/sim/s7_sim.py`)
- Room collision export → Physics simulation: used by (evidence: `robo/sim/s7_sim.py`)
- Robot tasks → Robot rig: defines tasks for (evidence: `robo/tasks/pi05_tasks.py`)
- PhiView Studio → Appearance harmonizer: harmonizes appearance
- Appearance harmonizer → Harmonizer service: sends requests (evidence: `robo/rendering/harmonizer_client.py`)
- Module command runtime → Run manifests: runs modules
- Robot evaluation → Policy client: uses policy
- Fidelity metrics → Run manifests: reads manifests (evidence: `robo/eval/fidelity_metrics.py`)
