Description
BrickWright is a system designed to enable pre-trained coding agents to generate high-fidelity, physically feasible LEGO® builds from various prompts, including text and images. Its core innovation lies in providing agents with a programmatic toolkit for both creating and validating brick constructions. This toolkit, named BrickLayer, is a Python package that allows agents to write code to assemble and verify LEGO® models.
Read More
The system guides agents through a plan-execute-validate loop, where they write and revise Python files to construct a build. Key components of the BrickLayer API include functionalities to discover parts by keyword, assemble geometry by composing parts and sub-builds with precise placement or automatic alignment, and check physical feasibility by identifying collisions, floating parts, and connected components. Agents are provided with tools such as `validate`, `render`, and `finalize` to facilitate this process. The `validate` tool offers feedback on physical feasibility, while `render` allows for visual inspection. Once all feasibility tests pass and the agent is satisfied, it calls `finalize` to complete the build.
BrickWright significantly improves the quality of agent-generated builds, reducing physical violations compared to agents using general tools. It also outperforms specialized text-to-brick models like BrickGPT and BrickNet in terms of overall validity, connectivity, and prompt adherence. The system is particularly effective for lightweight agents, dramatically boosting their performance. For instance, it improved GPT-6 Luna's physical validity from 9% to 100% while enhancing prompt adherence, at a fraction of the cost of frontier models. BrickWright is designed to be compatible with any agent backend, and its code is openly available on GitHub.
The motivation behind BrickWright stems from the observation that while frontier coding agents are becoming proficient at modeling 3D objects, including brick builds, they still struggle with creating physically feasible structures. A build is defined as physically feasible if it uses only real parts, has no colliding or floating components, and forms a connected structure. BrickWright addresses these challenges by integrating a structured, code-based approach that ensures generated models adhere to real-world physical constraints, resulting in more realistic and usable LEGO® creations.
- CategoryAI Game Development Tools
- Pricing ModelOpen source
- DeploymentGitHub (Code Available)
- PlatformsWeb
BrickWright's Core Features
Agentic LEGO® Build Generation: Enables coding agents to create LEGO® builds from text or image prompts.
Physically Feasible Builds: Generates models with real LEGO® parts, no collisions, no floating parts, and connected components.
Programmatic Toolkit (BrickLayer): Provides a Python package for brick build creation and validation.
Code-Based Generation: Guides agents to write Python code for building and revising LEGO® models.
Part Discovery: Allows searching the part catalog by keyword and filtering by metadata fields.
Geometry Assembly: Composes parts and sub-builds with exact pose or automatic connector alignment.
Physical Feasibility Checks: Identifies collisions, floating parts, and connected components.
Plan-Execute-Validate Loop: Agents iteratively write, validate, and render builds.
Validation Tool: Provides feedback on physical feasibility and custom tests.
Render Tool: Enables visual inspection of generated builds.
Finalize Tool: Completes the build process once all tests pass and render is satisfactory.
Improved Agent Performance: Significantly enhances build quality and physical validity for various agent backends.
Cost-Effective for Lightweight Agents: Improves performance for lightweight models at a low cost.
Outperforms Specialized Models: Achieves better overall validity, connectivity, and prompt adherence than dedicated text-to-brick models.
GitHub Availability: Code is available on GitHub for broader access and integration.
How to use BrickWright?
Provide Prompt: Input a text or image prompt describing the desired LEGO® build.
Agent Writes Code: The pre-trained agent uses the BrickLayer API to write Python code for the build.
Validate Build: The agent calls the `validate` tool to check for physical feasibility (collisions, floating parts, connectivity) and custom tests.
Inspect and Revise: The agent uses the `render` tool for visual inspection and revises the Python code based on validation feedback.
Finalize Creation: Once all feasibility tests pass and the agent is satisfied with the render, it calls `finalize` to complete the build.
BrickWright's Use Cases
- LEGO® Model Generation
- Agentic Design Exploration
- Educational Tool for Robotics/AI
- Rapid Prototyping of Brick Structures
- Creative Content Generation
- Research in Agentic AI




