anteloc/ldraw-nova

Agent tooling for generative LEGO models building, built with Astra and Opus 5.5, powered by Jev

ldraw-nova

ldraw-nova is a web application that lets you give an AI agent a description of a LEGO® model idea, and the agent will design and build it for you. The final output is a set of files that describe the model in the LDraw language — a text-based format used by the LEGO community to represent 3D models. You also get multiple ways to view the result: a 3D viewer, a 3D player, a VR experience (for Meta Quest 3), images, and a Blender-editable .glb file. The app also records the chat history and the agent's thinking process.

How it works

The agent follows a structured process:

  1. It receives your prompt (the model idea).
  2. It reads instructions and reference documents about LDraw and LEGO building.
  3. It plans the model: which parts to use, submodels, aesthetics, etc.
  4. It iteratively renders images of the model, inspects them, adjusts positioning and details, and repeats until it considers the model finished.

The agent doesn't directly place parts. Instead, it:

  • Gathers information from experiments, docs, and planning.
  • Creates a detailed plan (a JSON file) that fully describes the model and its submodels, including geometry.
  • Writes a generator script (Python) that, when executed, produces the LDraw source file (.mpd).

In short, the agent acts like a compiler: it turns your idea into a plan, then into a script, and finally into a 3D model.

Installation

You run ldraw-nova as a Docker web app. You need Git and Docker. Two sibling repositories must be cloned side by side at the same version tag:

  • ldraw-nova (this repo)
  • ldraw-nova-docker (provides Docker configuration and the web app)

Steps:

  1. Clone both repos at the same tag (e.g., v0.6.0).
  2. Build the Docker image (first build takes a while and needs ~5 GB disk space).
  3. Start the app with docker compose up -d.
  4. Open it in your browser:
    • https://localhost:8443 – needed for VR on Meta Quest 3 (self-signed certificate, accept the warning).
    • http://localhost:8765 – plain HTTP, no certificate warnings, but VR won't work.

Other devices on your network can access the app via your computer's IP. The app has no login, so only run it on trusted networks.

Important note about search

The agent uses a semantic search tool called jev-rerank to find suitable parts and example models. This tool requires a TypeSafe API key (TYPESAFE_API_KEY). If you don't provide one, the agent falls back to a simpler full-text search, which may produce worse models.

Why was it built?

The author wanted to see if AI agents could design physically buildable LEGO models. They experimented with ChatGPT and Claude, giving them tools to generate LDraw code. They found that agents do better at writing Python code that generates geometry than at doing the geometry math themselves. So they built a Python-based toolset that agents can learn from and use. The project is a result of that research.

Current limitations (from the README)

  • VR on Meta Quest 3 has many performance issues.
  • Low-end AI models (like Luna, Haiku) struggle; only expensive, high-end models currently generate large, correct models.
  • The generation process is slow and expensive.
  • Some model families (humans, animals, Technic machines, spaceships) are not yet well supported.
  • Building models from manuals only partially works.

Acknowledgements

The project credits the LDraw community and several open-source tools like LDView, LeoCAD, LDCad, and others.

Trademark notice

LEGO® is a trademark of the LEGO Group, which does not sponsor or endorse this software.

Related

  • Dispatch
  • Dispatch
  • Project
  • Project
  • Dispatch