# toolmanip/toolmanip architecture

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

- Interactive diagram: https://gitdiagram.com/toolmanip/toolmanip
- Repository: https://github.com/toolmanip/toolmanip

## Overview

ToolManip is a pre-release robotic tool-manipulation project. Its apparent workflow combines staged VLM task reasoning with image/keypoint processing, conversion of image coordinates into robot-world points, and calculation of a robot end-effector alignment pose. The source excerpts show the VLM agents calling a shared inference layer and show keypoint conversion using depth data; several intermediate scripts are not connected by evidence shown here. The README is only a pre-release notice, so the broader product workflow is inferred from the sampled modules and filenames.

Main entry points: [`VLM/VLM_agents/VLM1_TaskPlanning.py`](https://github.com/toolmanip/toolmanip/blob/main/VLM/VLM_agents/VLM1_TaskPlanning.py) (Task planning), [`VLM/utils.py`](https://github.com/toolmanip/toolmanip/blob/main/VLM/utils.py) (Inference and memory), [`VLM/VLM_agents/VLM2_AfordanceReasoning.py`](https://github.com/toolmanip/toolmanip/blob/main/VLM/VLM_agents/VLM2_AfordanceReasoning.py) (Affordance reasoning), [`keypoint_gen/S3_keypointToWorld.py`](https://github.com/toolmanip/toolmanip/blob/main/keypoint_gen/S3_keypointToWorld.py) (Keypoints to world)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vlm["VLM reasoning"]
  node_taskplan["Task planning"]
  node_affordance["Affordance reasoning"]
  node_motion["Motion planning"]
  node_stepcheck["Step checking"]
  node_vlmcore["Inference and memory<br/>[utils.py]"]
end

subgraph group_vision["Image and keypoints"]
  node_original["Image URL setup<br/>[S0_OriginalURL.py]"]
  node_bbox["Bounding boxes<br/>[S1_boundingBox.py]"]
  node_dotprompt["Dotted prompts<br/>[S2_dotPrompt.py]"]
end

subgraph group_geometry["Robot geometry"]
  node_worldpoints["Keypoints to world"]
  node_depth["Depth lookup<br/>[getDepth.py]"]
  node_posealign["Robot pose alignment"]
end

subgraph group_integrations["External services"]
  node_urlhelper["Image upload helper<br/>[updateURL.py]"]
  node_vlmservice{{"VLM API"}}
  node_github{{"GitHub image hosting"}}
end

node_operator(("Task operator"))

node_operator -.->|"provides task"| node_taskplan
node_taskplan -->|"runs dialog"| node_vlmcore
node_affordance -->|"runs inference"| node_vlmcore
node_motion -->|"runs inference"| node_vlmcore
node_stepcheck -->|"runs inference"| node_vlmcore
node_vlmcore -->|"calls API"| node_vlmservice
node_taskplan -->|"provides plan"| node_affordance
node_taskplan -->|"provides steps"| node_motion
node_taskplan -->|"provides steps"| node_stepcheck
node_affordance -->|"provides keypoints"| node_worldpoints
node_original -->|"uploads images"| node_urlhelper
node_urlhelper -->|"stores images"| node_github
node_worldpoints -->|"reads depth"| node_depth
node_worldpoints -.->|"writes world points"| node_posealign
node_affordance -->|"provides direction"| node_posealign

click node_taskplan "https://github.com/toolmanip/toolmanip/blob/main/VLM/VLM_agents/VLM1_TaskPlanning.py"
click node_affordance "https://github.com/toolmanip/toolmanip/blob/main/VLM/VLM_agents/VLM2_AfordanceReasoning.py"
click node_motion "https://github.com/toolmanip/toolmanip/blob/main/VLM/VLM_agents/VLM3_MotionPlanning.py"
click node_stepcheck "https://github.com/toolmanip/toolmanip/blob/main/VLM/VLM_agents/VLM4_StepChecking.py"
click node_vlmcore "https://github.com/toolmanip/toolmanip/blob/main/VLM/utils.py"
click node_original "https://github.com/toolmanip/toolmanip/blob/main/keypoint_gen/S0_OriginalURL.py"
click node_bbox "https://github.com/toolmanip/toolmanip/blob/main/keypoint_gen/S1_boundingBox.py"
click node_dotprompt "https://github.com/toolmanip/toolmanip/blob/main/keypoint_gen/S2_dotPrompt.py"
click node_worldpoints "https://github.com/toolmanip/toolmanip/blob/main/keypoint_gen/S3_keypointToWorld.py"
click node_depth "https://github.com/toolmanip/toolmanip/blob/main/keypoint_gen/utils/getDepth.py"
click node_posealign "https://github.com/toolmanip/toolmanip/blob/main/keypoint_gen/S4_Robot_PoseAlign.py"
click node_urlhelper "https://github.com/toolmanip/toolmanip/blob/main/keypoint_gen/utils/updateURL.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_taskplan,node_affordance,node_motion,node_stepcheck,node_vlmcore toneBlue
class node_original,node_bbox,node_dotprompt toneAmber
class node_worldpoints,node_depth,node_posealign toneMint
class node_urlhelper,node_vlmservice,node_github,node_operator toneRose
```

## Components

### VLM reasoning

- [Task planning](https://github.com/toolmanip/toolmanip/blob/main/VLM/VLM_agents/VLM1_TaskPlanning.py): `VLM/VLM_agents/VLM1_TaskPlanning.py`
- [Affordance reasoning](https://github.com/toolmanip/toolmanip/blob/main/VLM/VLM_agents/VLM2_AfordanceReasoning.py): `VLM/VLM_agents/VLM2_AfordanceReasoning.py`
- [Motion planning](https://github.com/toolmanip/toolmanip/blob/main/VLM/VLM_agents/VLM3_MotionPlanning.py): `VLM/VLM_agents/VLM3_MotionPlanning.py`
- [Step checking](https://github.com/toolmanip/toolmanip/blob/main/VLM/VLM_agents/VLM4_StepChecking.py): `VLM/VLM_agents/VLM4_StepChecking.py`
- [Inference and memory](https://github.com/toolmanip/toolmanip/blob/main/VLM/utils.py): `VLM/utils.py`

### Image and keypoints

- [Image URL setup](https://github.com/toolmanip/toolmanip/blob/main/keypoint_gen/S0_OriginalURL.py): `keypoint_gen/S0_OriginalURL.py`
- [Bounding boxes](https://github.com/toolmanip/toolmanip/blob/main/keypoint_gen/S1_boundingBox.py): `keypoint_gen/S1_boundingBox.py`
- [Dotted prompts](https://github.com/toolmanip/toolmanip/blob/main/keypoint_gen/S2_dotPrompt.py): `keypoint_gen/S2_dotPrompt.py`

### Robot geometry

- [Keypoints to world](https://github.com/toolmanip/toolmanip/blob/main/keypoint_gen/S3_keypointToWorld.py): `keypoint_gen/S3_keypointToWorld.py`
- [Depth lookup](https://github.com/toolmanip/toolmanip/blob/main/keypoint_gen/utils/getDepth.py): `keypoint_gen/utils/getDepth.py`
- [Robot pose alignment](https://github.com/toolmanip/toolmanip/blob/main/keypoint_gen/S4_Robot_PoseAlign.py): `keypoint_gen/S4_Robot_PoseAlign.py`

### External services

- [Image upload helper](https://github.com/toolmanip/toolmanip/blob/main/keypoint_gen/utils/updateURL.py): `keypoint_gen/utils/updateURL.py`
- **VLM API**
- **GitHub image hosting**

### Other components

- **Task operator**

## Connections

- Task operator → Task planning: provides task
- Task planning → Inference and memory: runs dialog (evidence: `VLM/VLM_agents/VLM1_TaskPlanning.py`)
- Affordance reasoning → Inference and memory: runs inference (evidence: `VLM/VLM_agents/VLM2_AfordanceReasoning.py`)
- Motion planning → Inference and memory: runs inference (evidence: `VLM/VLM_agents/VLM3_MotionPlanning.py`)
- Step checking → Inference and memory: runs inference (evidence: `VLM/VLM_agents/VLM4_StepChecking.py`)
- Inference and memory → VLM API: calls API (evidence: `VLM/utils.py`)
- Task planning → Affordance reasoning: provides plan (evidence: `VLM/VLM_agents/VLM2_AfordanceReasoning.py`)
- Task planning → Motion planning: provides steps (evidence: `VLM/VLM_agents/VLM3_MotionPlanning.py`)
- Task planning → Step checking: provides steps (evidence: `VLM/VLM_agents/VLM4_StepChecking.py`)
- Affordance reasoning → Keypoints to world: provides keypoints (evidence: `keypoint_gen/S3_keypointToWorld.py`)
- Image URL setup → Image upload helper: uploads images (evidence: `keypoint_gen/S0_OriginalURL.py`)
- Image upload helper → GitHub image hosting: stores images (evidence: `keypoint_gen/utils/updateURL.py`)
- Keypoints to world → Depth lookup: reads depth (evidence: `keypoint_gen/S3_keypointToWorld.py`)
- Keypoints to world → Robot pose alignment: writes world points
- Affordance reasoning → Robot pose alignment: provides direction (evidence: `keypoint_gen/S4_Robot_PoseAlign.py`)
