Generate LEGO CAD models in LDraw with AI agents
Build LEGO models with an AI agent, ordinary JSON plans and LDraw parts. Task: Build LEGO models with an AI agent, ordinary JSON plans and LDraw parts. The tools find parts and reference constructions, generate editable MPDs, check geometry, render previews and compare parts lists. Python generators support larger procedural designs. Watch the demonstration · Project background Start locally You need Python 3.12+, an installed LDraw parts library, Poppler (pdftotext) and LeoCAD on PATH. The repository includes the reference data and connector metadata used by the tools. Open the PNGs in output/bridge-review/previews/. The same folder contains the model, validation report, Python BOM, LeoCAD BOM comparison and a manifest tying artifacts to the model revision. review --no-render runs intermediate Python checks when previews are not needed. ./ldraw-agent doctor reports local dependencies. Build your own model Give an agent your model idea and instructions.md. The working loop is: Choose a design and inspect the parts or example constructions it needs. Write a JSON plan; use Python when calculations or loops help. Run review, open the previews, repair the source and repeat. Deliver the editable MPD, source, checks and reviewed images. build infers output/my-model.mpd and writes only after source/geometry checks pass. You can also run review output/my-model.plan.json to build and review in one command. Use --force for a deliberate rebuild or replacement of a generated review. Keep editable source and visual-review notes outside the generated review directory. Existing JSON plans, build --output, individual check/render commands and shell wrappers remain supported. Successful checks provide evidence, not proof of physical buildability; warnings, skipped checks and required visual inspection stay explicit. Semantic reference search uses jev-rerank and a TypeSafe API key. It is optional: offline catalogs, examples and discover search ... --engine fts remain available. Follow the availability check before using the service. Run the web app The web app and Docker configuration live in the sibling ldraw-nova-docker repository. Install Git and Docker, then clone matching release tags side by side: The first build needs about 5 GB of disk space. Open http://localhost:8765, or https://localhost:8443 for VR on Meta Quest 3 (accept the self-signed certificate). Devices on your network can use the host computer's IP address. The app has no login; run it on a trusted network. Set TYPESAFE_API_KEY in the app's Settings for semantic search. Stop it with docker compose down. The web app provides interactive 3D/VR views and conversation history. The local CLI also supports semantic GLB export for Blender through ./prepare-glb.sh --file MODEL.mpd MODEL.glb, using the installed mpd2glb.sh converter. The editable MPD remains the authoritative model. Development Tests use a miniature library plus the configured official library for integration cases. Integration tests skip explicitly when the official library is unavailable. Current checks do not certify material collision freedom, strength, motion or real part/colour availability. See the verification records for tested coverage and historical results. Further work includes model quality across more families, generation cost and speed, instruction-manual reconstruction, and VR handling/performance. Acknowledgements I'd like to thank the following: The LDraw Community LDView's Travis Cobbs (@tcobbs), and contributors. LeoCAD's Leonardo Zide (@leozide), and contributors. LDCad and Shadow Library, Roland Melkert. ldraw.rs's Park Joon-Kyu (@segfault87), and contributors. pyldraw3's Harold Martin (@hbmartin), and contributors. ... and thanks to all of the many other LDraw creators! NOTE: For this work, I've used many LDraw models, libraries, tools, docs... from many sources. There is a lot amazing people that generously contributed to this, even for decades, by generously donating their finest work to the public domain and open source community. If you think you should be included on this section, please drop me an email! Trademarks LEGO(R) is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this software.; tools: ChatGPT, Claude. Human role: The original post does not say how a person stayed involved.; limitations: Prerequisites include Python 3.12+, LDraw library, Poppler, and LeoCAD. Semantic search requires a TypeSafe API key; otherwise, it falls back to Full Text Search which may yield worse models. Current checks do not certify material collision freedom, strength, or real part availability. VR performance on Meta Quest 3 has known issues..
Tools
Published on Agent Work Atlas:
Overview
Build LEGO models with an AI agent, ordinary JSON plans and LDraw parts.
Workflow
Build LEGO models with an AI agent, ordinary JSON plans and LDraw parts. The tools find parts and reference constructions, generate editable MPDs, check geometry, render previews and compare parts lists. Python generators support larger procedural designs. Watch the demonstration · Project background Start locally You need Python 3.12+, an installed LDraw parts library, Poppler (pdftotext) and LeoCAD on PATH. The repository includes the reference data and connector metadata used by the tools. Open the PNGs in output/bridge-review/previews/. The same folder contains the model, validation report, Python BOM, LeoCAD BOM comparison and a manifest tying artifacts to the model revision. review --no-render runs intermediate Python checks when previews are not needed. ./ldraw-agent doctor reports local dependencies. Build your own model Give an agent your model idea and instructions.md. The working loop is: Choose a design and inspect the parts or example constructions it needs. Write a JSON plan; use Python when calculations or loops help. Run review, open the previews, repair the source and repeat. Deliver the editable MPD, source, checks and reviewed images. build infers output/my-model.mpd and writes only after source/geometry checks pass. You can also run review output/my-model.plan.json to build and review in one command. Use --force for a deliberate rebuild or replacement of a generated review. Keep editable source and visual-review notes outside the generated review directory. Existing JSON plans, build --output, individual check/render commands and shell wrappers remain supported. Successful checks provide evidence, not proof of physical buildability; warnings, skipped checks and required visual inspection stay explicit. Semantic reference search uses jev-rerank and a TypeSafe API key. It is optional: offline catalogs, examples and discover search ... --engine fts remain available. Follow the availability check before using the service. Run the web app The web app and Docker configuration live in the sibling ldraw-nova-docker repository. Install Git and Docker, then clone matching release tags side by side: The first build needs about 5 GB of disk space. Open http://localhost:8765, or https://localhost:8443 for VR on Meta Quest 3 (accept the self-signed certificate). Devices on your network can use the host computer's IP address. The app has no login; run it on a trusted network. Set TYPESAFE_API_KEY in the app's Settings for semantic search. Stop it with docker compose down. The web app provides interactive 3D/VR views and conversation history. The local CLI also supports semantic GLB export for Blender through ./prepare-glb.sh --file MODEL.mpd MODEL.glb, using the installed mpd2glb.sh converter. The editable MPD remains the authoritative model. Development Tests use a miniature library plus the configured official library for integration cases. Integration tests skip explicitly when the official library is unavailable. Current checks do not certify material collision freedom, strength, motion or real part/colour availability. See the verification records for tested coverage and historical results. Further work includes model quality across more families, generation cost and speed, instruction-manual reconstruction, and VR handling/performance. Acknowledgements I'd like to thank the following: The LDraw Community LDView's Travis Cobbs (@tcobbs), and contributors. LeoCAD's Leonardo Zide (@leozide), and contributors. LDCad and Shadow Library, Roland Melkert. ldraw.rs's Park Joon-Kyu (@segfault87), and contributors. pyldraw3's Harold Martin (@hbmartin), and contributors. ... and thanks to all of the many other LDraw creators! NOTE: For this work, I've used many LDraw models, libraries, tools, docs... from many sources. There is a lot amazing people that generously contributed to this, even for decades, by generously donating their finest work to the public domain and open source community. If you think you should be included on this section, please drop me an email! Trademarks LEGO(R) is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this software.
Reported result
The source states that agents performed well in initial tests and subsequent projects yielded good results, but never enough to consider generated models correct. No specific metrics or success rates are provided, only qualitative observations of partial success requiring further refinement.
Human role
The original post does not say how a person stayed involved.
Limitations
Prerequisites include Python 3.12+, LDraw library, Poppler, and LeoCAD. Semantic search requires a TypeSafe API key; otherwise, it falls back to Full Text Search which may yield worse models. Current checks do not certify material collision freedom, strength, or real part availability. VR performance on Meta Quest 3 has known issues.
Try it
Act as an LDraw model builder agent. I will provide a model idea and a path to instructions.md. First, read the instructions and plan the required parts and submodels. Generate a JSON plan and a Python script to create the LDraw MPD file. Run the review command to check geometry and render previews. Inspect the previews and adjust the source if necessary. Repeat until the model is visually correct. Do not finalize the output without my confirmation. If the TypeSafe API key is missing, use the FTS engine for part discovery. Ensure all generated files are saved in the specified output directory.
Source reports are not independently verified. Publication date is the catalog publication date, not the original article date.