Pan-Chera/Multi-Agent-CAD
Multi-Agent CAD (MAC) is a LangGraph-orchestrated multi-agent system that turns natural-language design briefs into editable engineering geometry (STEP/STL/GLB), decomposing mechanisms into separately generated, mated, and QA-validated parts and exporting URDF for robotics/physics simulation. It extends an earlier single-part Text-to-CAD workflow (~1,000 GitHub stars) with visual verification, an independent Judge agent, and an experimental assembly pipeline, reporting on a 10-prompt/141-feature benchmark that it matches a reproduced "CAD Skills" baseline's pass rate (140/141) while using tens-of-times fewer tokens and lower cost under Qwen-based configurations.
What it claims
MAC generates editable CAD (STEP, STL, GLB) from a plain-language brief. It runs in two modes: a single-part workflow, and an assembly workflow that decomposes a mechanism, generates parts separately, mates them, runs QA and exports URDF. The only quantitative claims cover the single-part workflow on a 10-prompt, 141-feature benchmark borrowed from earthtojake/text-to-cad ("CAD Skills"). The assembly pipeline is explicitly a technology preview. Its gallery is curated output, not a measured success rate, and the authors do not claim it outperforms CAD-agent skills.
How it works
- Orchestration and geometry: LangGraph handles orchestration, build123d is the B-rep kernel, and Aider does LLM-driven code repair.
- Execution and repair: generated Python is executed and checked, with bounded repair loops for recoverable failures.
- Inspectable intermediates: you can inspect the structured brief, geometry plan, generated code, measurements, QA reports and repair history.
- Per-stage models: planning, geometry, coding and repair can each use a different OpenAI-compatible model.
- Part reuse in assemblies: repeated and mirrored parts are derived from one source geometry instead of being regenerated.
- v2 additions to the single-part path: visual verification and an independent Judge. The page does not describe how either works internally.
Evidence
All figures are single-part only:
| Setup | Feature pass rate | Tokens vs. reproduced Skill baseline | Estimated cost vs. baseline |
|---|---|---|---|
| MAC v1, Qwen 3.7 | 140/141 | 116× fewer recorded tokens | 13× lower |
| MAC v2, Qwen 3.8 with visual verification | 140/141 | 62.7× fewer recorded tokens | 6.1× lower |
The baseline runs are the authors' reproductions, not numbers published by CAD Skills. Raw breakdowns live in the single-part README and the English and Chinese evaluation docs.
How to use it
Install with conda:
git clone https://github.com/Pan-Chera/Multi-Agent-CAD.git
cd Multi-Agent-CAD
conda env create -f environment.yml
conda activate multi_agent_cad
pip install --no-deps "aider-chat==0.82.3"
export DASHSCOPE_API_KEY="your-key"The separate --no-deps install is there because aider-chat pins NumPy 1.x while build123d needs NumPy 2.x. A pure-pip workaround is documented and verified on macOS arm64 with Python 3.11. Do not use it on Windows; use the conda flow there. The default endpoint is DashScope (Qwen). Other providers are covered in the configuration guide.
Single part: set USER_REQUEST in multi_agent_cad/config.py, then run:
python -m multi_agent_cad.graphWeb UI:
pip install -e ".[web]"
python -m multi_agent_cad.webPOST, PUT, PATCH and DELETE requests from non-browser clients must send the X-MAC-CSRF: 1 header, otherwise the server returns 403.
Assembly:
MAC_ASSEMBLY_REQUEST="Create a two-part hinged clamp with a fixed base and one rotating jaw." \
python -m mac_assemblyOutputs go to assembly_jobs/job_<timestamp>/. Each job contains per-part geometry, the assembled STEP/STL/GLB, URDF, manifests and QA artifacts.
Licence: MIT. The vendored packages/cadpy is derived from CAD Skills and keeps its own MIT licence.
Limits
- Assembly is unbenchmarked. Validate geometry and joints before manufacturing or simulation use.
- Generated code is not sandboxed. The web UI runs generated Python with your user's permissions, so do not expose it to untrusted networks. Stripping environment variables reduces secret leakage but does not sandbox the subprocess (see SECURITY.md). Never add API keys to
MAC_CHILD_ENV_ALLOW. - LAN deployment weakens CSRF protection. Binding to a non-loopback address drops the loopback Host-allowlist layer.
- Endpoints are restricted by default. Custom or non-loopback endpoints (vLLM, Ollama, corporate gateways) need
MAC_WEB_ALLOW_CUSTOM_ENDPOINT=1. - Windows is not covered by CI.
- Benchmark scope is narrow. All reported numbers come from Qwen configurations and one 10-prompt benchmark.
Organisations named here
- Tsinghua University
- IEI Lab
- Qwen Model Studio
- earthtojake/text-to-cad
- Qwen
Technologies named here
- Python
- Qwen3.7
- build123d
- Qwen3.8
- LangGraph
- Aider
- Qwen Model Studio
- cadpy
- DashScope
- Qwen
- FastAPI
Techniques named here
- Natural-language decomposition
- Automatic execution and repair
- Reuse instead of regeneration
- Auditable generation
- Visual verification with independent Judge
- Model-flexible stages
Related in agents



