# articraftresearch/articraft architecture

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

- Interactive diagram: https://gitdiagram.com/articraftresearch/articraft
- Repository: https://github.com/articraftresearch/articraft

## Overview

Articraft turns a text prompt or reference image into generated Python, compiles and checks the resulting articulated model, and exports a posable USDZ run. Users can inspect and pose saved versions or simulate them. The graph preserves the SDK’s modeling, validation, and visualization capabilities. Some subsystem links rely on README descriptions because their implementation was not sampled; those edges are cited to the README rather than inferred from names.

Main entry points: [`src/articraft/sdk/assembly.py`](https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/assembly.py) (Assembly and joints), [`src/articraft/agent/harness.py`](https://github.com/articraftresearch/articraft/blob/main/src/articraft/agent/harness.py) (Agent harness), [`src/articraft/sdk/export.py`](https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/export.py) (USDZ export), [`src/articraft/app.py`](https://github.com/articraftresearch/articraft/blob/main/src/articraft/app.py) (CLI and API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry"]
  node_cli["CLI and API<br/>[app.py]"]
  node_settings["Settings<br/>[settings.py]"]
end

subgraph group_generation["Generation"]
  node_harness["Agent harness<br/>[harness.py]"]
  node_providers["Model providers"]
  node_agent_tools["Agent tools"]
  node_workspace["Local workspace<br/>[local.py]"]
  node_run_record["Run records<br/>[record.py]"]
  node_compiler["Compile and feedback<br/>[worker.py]"]
  node_compile_feedback["Validation feedback<br/>[feedback.py]"]
  node_compile_result["Compile results<br/>[result.py]"]
end

subgraph group_authoring["Authoring SDK"]
  node_mesh["Mesh geometry<br/>[core.py]"]
  node_bodies["Bodies and materials<br/>[bodies.py]"]
  node_assembly["Assembly and joints<br/>[assembly.py]"]
  node_frames["Frames<br/>[frames.py]"]
  node_mass["Mass properties<br/>[mass.py]"]
  node_sdk_testing["Model checks<br/>[testing.py]"]
  node_visual["Visual tools<br/>[visual.py]"]
  node_physics["Physics definitions<br/>[physics.py]"]
end

subgraph group_artifacts["Artifacts and inspection"]
  node_export["USDZ export<br/>[export.py]"]
  node_viewer["Run viewer<br/>[viewer.py]"]
  node_usd["USD utilities<br/>[_usd.py]"]
end

subgraph group_simulation["Simulation"]
  node_simulator["Simulation<br/>[simulate.py]"]
end

node_user(("User"))
node_model_service(("Model service"))

node_user -->|"starts generation"| node_cli
node_cli -->|"starts agent"| node_harness
node_cli -->|"loads settings"| node_settings
node_harness -->|"requests completion"| node_providers
node_providers -.->|"sends requests"| node_model_service
node_harness -->|"dispatches tools"| node_agent_tools
node_harness -.->|"uses workspace"| node_workspace
node_harness -->|"records run"| node_run_record
node_workspace -->|"records run"| node_run_record
node_workspace -->|"uses feedback"| node_compile_feedback
node_cli -->|"starts compilation"| node_compiler
node_compiler -->|"checks model"| node_compile_feedback
node_compiler -->|"creates result"| node_compile_result
node_compiler -->|"exports model"| node_export
node_compile_feedback -->|"validates model"| node_sdk_testing
node_bodies -->|"holds geometry"| node_mesh
node_bodies -->|"binds frames"| node_frames
node_assembly -->|"assembles bodies"| node_bodies
node_assembly -->|"uses frames"| node_frames
node_assembly -->|"resolves mass"| node_mass
node_assembly -->|"uses physics"| node_physics
node_export -->|"exports assembly"| node_assembly
node_export -->|"exports bodies"| node_bodies
node_export -->|"exports mass"| node_mass
node_export -->|"exports physics"| node_physics
node_user -->|"opens run"| node_viewer
node_viewer -->|"reads USDZ"| node_usd
node_viewer -->|"reconstructs assembly"| node_assembly
node_user -->|"simulates run"| node_simulator
node_simulator -->|"uses USD utilities"| node_usd
node_user -->|"uses visual tools"| node_visual
node_user -->|"checks authored model"| node_sdk_testing

click node_cli "https://github.com/articraftresearch/articraft/blob/main/src/articraft/app.py"
click node_settings "https://github.com/articraftresearch/articraft/blob/main/src/articraft/settings.py"
click node_harness "https://github.com/articraftresearch/articraft/blob/main/src/articraft/agent/harness.py"
click node_providers "https://github.com/articraftresearch/articraft/tree/main/src/articraft/agent/provider"
click node_agent_tools "https://github.com/articraftresearch/articraft/tree/main/src/articraft/agent/tools"
click node_workspace "https://github.com/articraftresearch/articraft/blob/main/src/articraft/agent/workspace/local.py"
click node_run_record "https://github.com/articraftresearch/articraft/blob/main/src/articraft/agent/record.py"
click node_compiler "https://github.com/articraftresearch/articraft/blob/main/src/articraft/compiler/worker.py"
click node_compile_feedback "https://github.com/articraftresearch/articraft/blob/main/src/articraft/compiler/feedback.py"
click node_compile_result "https://github.com/articraftresearch/articraft/blob/main/src/articraft/compiler/result.py"
click node_mesh "https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/_mesh/core.py"
click node_bodies "https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/bodies.py"
click node_assembly "https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/assembly.py"
click node_frames "https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/frames.py"
click node_mass "https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/mass.py"
click node_sdk_testing "https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/testing.py"
click node_visual "https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/visual.py"
click node_export "https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/export.py"
click node_viewer "https://github.com/articraftresearch/articraft/blob/main/src/articraft/viewer.py"
click node_usd "https://github.com/articraftresearch/articraft/blob/main/src/articraft/_usd.py"
click node_simulator "https://github.com/articraftresearch/articraft/blob/main/src/articraft/simulate.py"
click node_physics "https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/physics.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_settings,node_user toneBlue
class node_harness,node_providers,node_agent_tools,node_workspace,node_run_record,node_compiler,node_compile_feedback,node_compile_result toneAmber
class node_mesh,node_bodies,node_assembly,node_frames,node_mass,node_sdk_testing,node_visual,node_physics toneMint
class node_export,node_viewer,node_usd toneRose
class node_simulator,node_model_service toneIndigo
```

## Components

### User entry

- [CLI and API](https://github.com/articraftresearch/articraft/blob/main/src/articraft/app.py): `src/articraft/app.py`
- [Settings](https://github.com/articraftresearch/articraft/blob/main/src/articraft/settings.py): `src/articraft/settings.py`

### Generation

- [Agent harness](https://github.com/articraftresearch/articraft/blob/main/src/articraft/agent/harness.py): `src/articraft/agent/harness.py`
- [Model providers](https://github.com/articraftresearch/articraft/tree/main/src/articraft/agent/provider): `src/articraft/agent/provider`
- [Agent tools](https://github.com/articraftresearch/articraft/tree/main/src/articraft/agent/tools): `src/articraft/agent/tools`
- [Local workspace](https://github.com/articraftresearch/articraft/blob/main/src/articraft/agent/workspace/local.py): `src/articraft/agent/workspace/local.py`
- [Run records](https://github.com/articraftresearch/articraft/blob/main/src/articraft/agent/record.py): `src/articraft/agent/record.py`
- [Compile and feedback](https://github.com/articraftresearch/articraft/blob/main/src/articraft/compiler/worker.py): `src/articraft/compiler/worker.py`
- [Validation feedback](https://github.com/articraftresearch/articraft/blob/main/src/articraft/compiler/feedback.py): `src/articraft/compiler/feedback.py`
- [Compile results](https://github.com/articraftresearch/articraft/blob/main/src/articraft/compiler/result.py): `src/articraft/compiler/result.py`

### Authoring SDK

- [Mesh geometry](https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/_mesh/core.py): `src/articraft/sdk/_mesh/core.py`
- [Bodies and materials](https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/bodies.py): `src/articraft/sdk/bodies.py`
- [Assembly and joints](https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/assembly.py): `src/articraft/sdk/assembly.py`
- [Frames](https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/frames.py): `src/articraft/sdk/frames.py`
- [Mass properties](https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/mass.py): `src/articraft/sdk/mass.py`
- [Model checks](https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/testing.py): `src/articraft/sdk/testing.py`
- [Visual tools](https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/visual.py): `src/articraft/sdk/visual.py`
- [Physics definitions](https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/physics.py): `src/articraft/sdk/physics.py`

### Artifacts and inspection

- [USDZ export](https://github.com/articraftresearch/articraft/blob/main/src/articraft/sdk/export.py): `src/articraft/sdk/export.py`
- [Run viewer](https://github.com/articraftresearch/articraft/blob/main/src/articraft/viewer.py): `src/articraft/viewer.py`
- [USD utilities](https://github.com/articraftresearch/articraft/blob/main/src/articraft/_usd.py): `src/articraft/_usd.py`

### Simulation

- [Simulation](https://github.com/articraftresearch/articraft/blob/main/src/articraft/simulate.py): `src/articraft/simulate.py`

### Other components

- **User**
- **Model service**

## Connections

- User → CLI and API: starts generation (evidence: `README.md`)
- CLI and API → Agent harness: starts agent (evidence: `src/articraft/app.py`)
- CLI and API → Settings: loads settings (evidence: `src/articraft/app.py`)
- Agent harness → Model providers: requests completion (evidence: `src/articraft/agent/harness.py`)
- Model providers → Model service: sends requests
- Agent harness → Agent tools: dispatches tools (evidence: `src/articraft/agent/harness.py`)
- Agent harness → Local workspace: uses workspace
- Agent harness → Run records: records run (evidence: `src/articraft/agent/harness.py`)
- Local workspace → Run records: records run (evidence: `src/articraft/agent/workspace/local.py`)
- Local workspace → Validation feedback: uses feedback (evidence: `src/articraft/agent/workspace/local.py`)
- CLI and API → Compile and feedback: starts compilation (evidence: `src/articraft/app.py`)
- Compile and feedback → Validation feedback: checks model (evidence: `src/articraft/compiler/worker.py`)
- Compile and feedback → Compile results: creates result (evidence: `src/articraft/compiler/worker.py`)
- Compile and feedback → USDZ export: exports model (evidence: `src/articraft/compiler/worker.py`)
- Validation feedback → Model checks: validates model (evidence: `src/articraft/compiler/feedback.py`)
- Bodies and materials → Mesh geometry: holds geometry (evidence: `src/articraft/sdk/bodies.py`)
- Bodies and materials → Frames: binds frames (evidence: `src/articraft/sdk/bodies.py`)
- Assembly and joints → Bodies and materials: assembles bodies (evidence: `src/articraft/sdk/assembly.py`)
- Assembly and joints → Frames: uses frames (evidence: `src/articraft/sdk/assembly.py`)
- Assembly and joints → Mass properties: resolves mass (evidence: `src/articraft/sdk/assembly.py`)
- Assembly and joints → Physics definitions: uses physics (evidence: `src/articraft/sdk/assembly.py`)
- USDZ export → Assembly and joints: exports assembly (evidence: `src/articraft/sdk/export.py`)
- USDZ export → Bodies and materials: exports bodies (evidence: `src/articraft/sdk/export.py`)
- USDZ export → Mass properties: exports mass (evidence: `src/articraft/sdk/export.py`)
- USDZ export → Physics definitions: exports physics (evidence: `src/articraft/sdk/export.py`)
- User → Run viewer: opens run (evidence: `README.md`)
- Run viewer → USD utilities: reads USDZ (evidence: `src/articraft/viewer.py`)
- Run viewer → Assembly and joints: reconstructs assembly (evidence: `src/articraft/viewer.py`)
- User → Simulation: simulates run (evidence: `README.md`)
- Simulation → USD utilities: uses USD utilities (evidence: `src/articraft/simulate.py`)
- User → Visual tools: uses visual tools (evidence: `README.md`)
- User → Model checks: checks authored model (evidence: `README.md`)
