The BrickWright framework addresses a persistent challenge in AI-driven 3D modeling: the generation of physically impractical designs with floating, colliding, or disconnected components. By providing AI agents with a specialized toolkit for assembly and verification, BrickWright enables them to produce LEGO builds that adhere to real-world physical constraints.

The core of BrickWright is BrickLayer, a Python toolkit that offers an ergonomic API for brick assembly and a validator for physical feasibility. This toolkit allows agents to write code that constructs LEGO models, then receive feedback on potential issues such as part collisions, unsupported elements, or structural disconnections.

In testing, baseline AI agents, such as GPT-6 Luna and GPT-6 Astra, achieved physical validity rates ranging from 9% to 69%. In contrast, BrickWright-guided agents achieved 100% validity across a sample of 512 prompts. This improvement was observed even with lightweight agents like GPT-6 Luna, which saw its validity rate increase from 8.6% to 100% with BrickWright.

The researchers, including Ava Pun, Kevin Dai, and Sally Chen from Carnegie Mellon University, and Maneesh Agrawala from Stanford University, argue that providing agents with such domain-specific tools is sufficient for them to create physically valid assemblies while still adhering to input prompts. The BrickLayer API also reportedly halves the inference cost compared to working with raw LDraw, a standard text format for brick builds. This efficiency allows lightweight agents to achieve full validity at a fraction of the cost of more powerful frontier models.

The framework operates in a plan-execute-validate loop. An agent receives a text or image prompt along with BrickLayer documentation, then writes a Python file containing a build function. The system then runs validation checks and renders the build for visual inspection. If any checks fail, the agent revises its code until all physical feasibility tests pass and the rendered model is satisfactory.

This approach extends beyond simple static models, allowing for the generation of large-scale scenes and articulated objects. The development of BrickWright builds on previous efforts in AI-powered LEGO design, such as LegoGPT from Carnegie Mellon University, which in 2025 enabled AI models to create physically stable LEGO designs with a 98% success rate. However, BrickWright's focus on providing explicit tools and a robust validation loop pushes the reliability of AI-generated physical models to a new level.

The code for BrickWright is available on a project page hosted on GitHub, allowing other researchers and developers to explore and build upon the framework.