# agibotgeneral/mansion architecture

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

- Interactive diagram: https://gitdiagram.com/agibotgeneral/mansion
- Repository: https://github.com/agibotgeneral/mansion

## Overview

MANSION turns a natural-language building brief into a multi-floor 3D scene, including room layouts, architectural elements, furnishings, lighting, and rendered images. The repository contains both a LangGraph pipeline and portable layout-generation components, alongside scene-generation modules for geometry and object placement. The README establishes the overall product workflow; source excerpts show graph assembly, state, LLM configuration, and selected portable-node behavior. Several downstream implementations are listed but unsampled, so their internal calls are not inferred.

Main entry points: [`pipeline/graph.py`](https://github.com/agibotgeneral/mansion/blob/main/pipeline/graph.py) (Pipeline graph), [`pipeline/nodes/portable_llm_growth.py`](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/portable_llm_growth.py) (LLM-seeded growth), [`llm/openai_wrapper.py`](https://github.com/agibotgeneral/mansion/blob/main/llm/openai_wrapper.py) (LLM client), [`pipeline/nodes/__init__.py`](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/__init__.py) (Node registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Pipeline orchestration"]
  node_graph["Pipeline graph<br/>[graph.py]"]
  node_registry["Node registry<br/>[__init__.py]"]
  node_state["Pipeline state<br/>[state.py]"]
end

subgraph group_planning["Building planning"]
  node_p_setup["Portable setup<br/>[portable_setup.py]"]
  node_topology["Floor topology"]
  node_floorplan["Floorplan topology"]
  node_cutting["Room cut planning"]
  node_growth["LLM-seeded growth"]
  node_helpers["Portable helpers"]
end

subgraph group_scene["Scene generation"]
  node_conversion["Scene conversion"]
  node_core_rooms["Vertical core rooms"]
  node_toilet_suite["Toilet suite prep"]
  node_doors["Door generation<br/>[generate_doors.py]"]
  node_windows["Window generation"]
  node_objects["Furniture selection<br/>[select_objects.py]"]
  node_placement["Object placement<br/>[floor_objects.py]"]
  node_lighting["Lighting"]
  node_render["Scene rendering<br/>[render.py]"]
  node_outputs["Scene outputs"]
end

subgraph group_services["LLM and assets"]
  node_llm["LLM client<br/>[openai_wrapper.py]"]
  node_config["LLM configuration<br/>[constants.py]"]
  node_assets["3D asset retrieval"]
end

node_user(("Building brief"))

node_user -->|"starts generation"| node_graph
node_graph -->|"uses registry"| node_registry
node_graph -->|"wraps state"| node_state
node_graph -->|"configures per-node LLM"| node_llm
node_llm -->|"loads profiles"| node_config
node_graph -.-> node_p_setup
node_graph -.-> node_topology
node_graph -.-> node_floorplan
node_graph -.-> node_cutting
node_graph -.-> node_growth
node_growth -->|"uses helpers"| node_helpers
node_graph -.-> node_conversion
node_graph -.-> node_core_rooms
node_graph -.-> node_toilet_suite
node_graph -.-> node_doors
node_graph -.-> node_windows
node_graph -.-> node_objects
node_graph -.-> node_placement
node_graph -.-> node_lighting
node_graph -.-> node_render
node_graph -.-> node_outputs
node_user -.->|"uses 3D assets"| node_assets

click node_graph "https://github.com/agibotgeneral/mansion/blob/main/pipeline/graph.py"
click node_registry "https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/__init__.py"
click node_state "https://github.com/agibotgeneral/mansion/blob/main/pipeline/state.py"
click node_p_setup "https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/portable_setup.py"
click node_topology "https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/portable_topology.py"
click node_floorplan "https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/portable_floorplan_topology.py"
click node_cutting "https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/portable_cutting.py"
click node_growth "https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/portable_llm_growth.py"
click node_helpers "https://github.com/agibotgeneral/mansion/blob/main/pipeline/utils/portable_helpers.py"
click node_conversion "https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/portable_convert.py"
click node_core_rooms "https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/prepare_vertical_core_rooms.py"
click node_toilet_suite "https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/prepare_toilet_suite.py"
click node_doors "https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/generate_doors.py"
click node_windows "https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/generate_windows.py"
click node_objects "https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/select_objects.py"
click node_placement "https://github.com/agibotgeneral/mansion/blob/main/generation/floor_objects.py"
click node_lighting "https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/generate_lighting.py"
click node_render "https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/render.py"
click node_outputs "https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/save_final_outputs.py"
click node_llm "https://github.com/agibotgeneral/mansion/blob/main/llm/openai_wrapper.py"
click node_config "https://github.com/agibotgeneral/mansion/blob/main/config/constants.py"
click node_assets "https://github.com/agibotgeneral/mansion/blob/main/generation/objaverse_retriever.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_graph,node_registry,node_state toneBlue
class node_p_setup,node_topology,node_floorplan,node_cutting,node_growth,node_helpers toneAmber
class node_conversion,node_core_rooms,node_toilet_suite,node_doors,node_windows,node_objects,node_placement,node_lighting,node_render,node_outputs toneMint
class node_llm,node_config,node_assets toneRose
class node_user toneIndigo
```

## Components

### Pipeline orchestration

- [Pipeline graph](https://github.com/agibotgeneral/mansion/blob/main/pipeline/graph.py): `pipeline/graph.py`
- [Node registry](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/__init__.py): `pipeline/nodes/__init__.py`
- [Pipeline state](https://github.com/agibotgeneral/mansion/blob/main/pipeline/state.py): `pipeline/state.py`

### Building planning

- [Portable setup](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/portable_setup.py): `pipeline/nodes/portable_setup.py`
- [Floor topology](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/portable_topology.py): `pipeline/nodes/portable_topology.py`
- [Floorplan topology](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/portable_floorplan_topology.py): `pipeline/nodes/portable_floorplan_topology.py`
- [Room cut planning](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/portable_cutting.py): `pipeline/nodes/portable_cutting.py`
- [LLM-seeded growth](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/portable_llm_growth.py): `pipeline/nodes/portable_llm_growth.py`
- [Portable helpers](https://github.com/agibotgeneral/mansion/blob/main/pipeline/utils/portable_helpers.py): `pipeline/utils/portable_helpers.py`

### Scene generation

- [Scene conversion](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/portable_convert.py): `pipeline/nodes/portable_convert.py`
- [Vertical core rooms](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/prepare_vertical_core_rooms.py): `pipeline/nodes/prepare_vertical_core_rooms.py`
- [Toilet suite prep](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/prepare_toilet_suite.py): `pipeline/nodes/prepare_toilet_suite.py`
- [Door generation](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/generate_doors.py): `pipeline/nodes/generate_doors.py`
- [Window generation](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/generate_windows.py): `pipeline/nodes/generate_windows.py`
- [Furniture selection](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/select_objects.py): `pipeline/nodes/select_objects.py`
- [Object placement](https://github.com/agibotgeneral/mansion/blob/main/generation/floor_objects.py): `generation/floor_objects.py`
- [Lighting](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/generate_lighting.py): `pipeline/nodes/generate_lighting.py`
- [Scene rendering](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/render.py): `pipeline/nodes/render.py`
- [Scene outputs](https://github.com/agibotgeneral/mansion/blob/main/pipeline/nodes/save_final_outputs.py): `pipeline/nodes/save_final_outputs.py`

### LLM and assets

- [LLM client](https://github.com/agibotgeneral/mansion/blob/main/llm/openai_wrapper.py): `llm/openai_wrapper.py`
- [LLM configuration](https://github.com/agibotgeneral/mansion/blob/main/config/constants.py): `config/constants.py`
- [3D asset retrieval](https://github.com/agibotgeneral/mansion/blob/main/generation/objaverse_retriever.py): `generation/objaverse_retriever.py`

### Other components

- **Building brief**

## Connections

- Building brief → Pipeline graph: starts generation
- Pipeline graph → Node registry: uses registry (evidence: `pipeline/graph.py`)
- Pipeline graph → Pipeline state: wraps state (evidence: `pipeline/graph.py`)
- Pipeline graph → LLM client: configures per-node LLM (evidence: `pipeline/graph.py`)
- LLM client → LLM configuration: loads profiles (evidence: `llm/openai_wrapper.py`)
- Pipeline graph → Portable setup
- Pipeline graph → Floor topology
- Pipeline graph → Floorplan topology
- Pipeline graph → Room cut planning
- Pipeline graph → LLM-seeded growth
- LLM-seeded growth → Portable helpers: uses helpers (evidence: `pipeline/nodes/portable_llm_growth.py`)
- Pipeline graph → Scene conversion
- Pipeline graph → Vertical core rooms
- Pipeline graph → Toilet suite prep
- Pipeline graph → Door generation
- Pipeline graph → Window generation
- Pipeline graph → Furniture selection
- Pipeline graph → Object placement
- Pipeline graph → Lighting
- Pipeline graph → Scene rendering
- Pipeline graph → Scene outputs
- Building brief → 3D asset retrieval: uses 3D assets
