Back

Some Assembly Required

BrickedSeptember 2026Hack the North 2026 · Winner

Bricked on a laptop: a Lego model generated from a typed idea, in a light-blue instruction-manual interface.

Team

  • Eason
  • James
  • Moiz

Overview

Bricked turns anything you type into a Lego model you can actually build. An image model imagines the finished set, a team of AI agents plans it, a geometry kernel places every brick, and a critique loop keeps fixing the build until it matches the picture.

Type “space shuttle” into Bricked. Four minutes and fourteen seconds later you have a model made of 141 real Lego parts that hold together and stand up on their own, a step-by-step manual, and a button that orders the pieces.

We built Bricked over one weekend at Hack the North 2026, and it won. This writeup takes the system apart, piece by piece, from the code in our repository: what each step does, why it is there, and what we measured along the way.

The imagined space shuttle, drawn by an image model Imagined
The space shuttle as built by the geometry kernel, brick by brick Built
One run, start to finishLeft: the picture the image model imagined. Right: the model the kernel built from the agents' plan.

What Bricked does

Bricked is a web app with one text box. You describe anything (a frog, a Mars rover, a sumo wrestler) and it designs a Lego model of it from parts that really exist. When the design is done, you can turn it around in 3D, follow the instructions one step at a time, change it in plain words, and buy the bricks.

Type an idea“space shuttle”
Imagine ita picture of the set
Plan itagents write the design
Build itreal parts, checked
Follow the stepsa manual, page by page
Order the partsa BrickLink list
From a sentence to a box of bricksWhat a person sees. Everything between the first card and the last is automatic.
A red Lego car with a black roof in Bricked's 3D viewer, with a step slider underneath.
The finished modelThe 3D view. The slider at the bottom walks through the build steps; the button beside it saves the model.

Why the first version built blobs

The first version asked language models to place the bricks themselves. The repository keeps it as pipeline A: a planner splits the object into bands of layers, a builder agent places each band’s bricks on a 20 × 20 × 20 grid, a code inspector checks them, and a vision critic scores a render of the result.

Plannersplits it into bands of layers
Builderplaces one band's bricks
Overlaps or gaps?one retry if so
Vision criticscores a render, 0 to 10
Pipeline A: agents place the bricksA sound loop with one weak link: the builder had to hold the whole model in its head.

Every part of that loop worked except the one that mattered. A language model is good at deciding that a flower needs a pot, a stem and petals. It is poor at remembering that a brick it wrote forty lines ago already fills the spot it is about to use. The bricks overlapped, floated, or bunched together, and the models came out as blobs.

So the rule was turned around, and the rest of the system follows from it.

Models decide what to build. Code places every brick.

Pipeline B put that rule into practice: the model writes a short design brief, and code turns it into real parts. Pipeline C, which the app runs today, keeps B’s kernel and adds the parts of A that worked: a stability check, a fast model for small steps and a strong one for design, live streaming to the screen, and a firm ban on silent fallbacks. (For a while, every failed run quietly returned a cube.)

Pipeline Aagents place bricks, layer by layer
Pipeline Bagents write a brief, code places parts
Pipeline Cwhat the app runs today
Three pipelinesA and B were built side by side and compared on the same ideas. C merges the best of both.

How the pieces fit

Bricked has three layers. In the browser, a Next.js app takes the idea and draws the model. In the middle, a small Python server starts runs and streams their progress. Underneath, the pipeline calls the models and the kernel and writes everything it makes to disk.

Web appNext.js and a 3D viewer
Serverstarts runs, streams events
Pipelinethe harness
ModelsClaude and an image model
Kernelplaces and checks parts
Runsart, briefs, models, tape
How the pieces fitClick any box for what it does. The arrow back to the app is the live stream.

The harness

The harness is the loop that turns an idea into a checked model. It divides the work by what each part is good at.

Image models imagine

They have seen more Lego than anyone alive, so they draw the finished set.

Claude agents design

They decide which pieces make a wing, which colours to use, and what attaches to what.

The kernel places

Putting a brick in exactly the right place is arithmetic, not judgement, so code does it.

It works the way a person builds. Asked for a Lego flamingo, you would picture a flamingo first, then place a few bricks, compare them with the picture in your head, and fix what looks wrong. The harness runs that same loop, with the picture made real.

Distillmake it buildable
Imaginethe finished set
More anglesside and back
Planagents write the brief
Assemblebrief to real parts
Checkoverlaps, stability
Renderfour angles
Critiquescore against the picture
The harness, step by stepEight steps and one loop, replaying the space shuttle run. Click a step to stop there.

Distill: make the idea buildable

Many ideas can’t be built as stated. A dog holding an umbrella needs a paw that grips a thin pole at an angle, and no part in the kit does that. So the first call rewrites the idea before anything is drawn. Its instruction fits in five words: keep the joke, drop the physics.

  1. Youa dog holding an umbrella
  2. DistillerA sitting dog wearing a small red umbrella hat.
  3. same joke, and every part of it can be built
Keep the joke, drop the physicsThe distiller's own example. A calm pose, chunky shapes, and props worn rather than held.

The distiller returns a small structured record: the subject, a one-line concept, three to five signature features, the simplifications it made, and the exact prompt for the image model. For the shuttle it chose “chunky delta wings”, “a rounded white nose” and “three round engine nozzles at the rear”, and it simplified away the fuel tank and boosters by putting the orbiter on a tilted display stand.

This is a rewrite, not a design problem, so it runs on the fast model with thinking switched off. It is the cheapest step in the run.

“space shuttle”
Distillfast model, no thinking
Concepta chunky orbiter on a stand
Five featuresnose, delta wings, nozzles
Simplificationsno fuel tank, no boosters
Image promptan official Lego set photo
What the distiller hands onFour outputs. The features become the checklist the designer and the critic both work from.

Imagine: a picture to build against

Next, an image model draws the distilled concept as “a studio product photo of an official LEGO set”. This picture is the reference for the rest of the run. The designer builds from it, and the critic judges against it.

It changes the task completely. A language model asked to build a hummingbird from words alone has to invent every proportion: how long the beak is, how high the wings sit, which greens to use. Given a photo, it only has to read them off.

The image model's concept of a Lego space shuttle on a clear stand.Concept · 0:44
The same shuttle seen from the side.Side · 1:15
The same shuttle seen from the back.Back · 1:15
Three views of one shuttleThe concept, then the side and the back, drawn with the first picture attached so the design stays the same.

One photo hides the back and the far side, so the harness asks for two more views. They are drawn on a background thread while the designer is already writing the brief from the front view. The critic, which runs later, gets all three. If a view fails, the run loses some depth, not the whole run. And if you draw a sketch in the app, your sketch takes the concept’s place, and the harness designs toward your drawing instead.

Distill
Concept art
Side and back
Brief
Render and critique
Revise
Rebuild and critique
The shuttle run, on a clockReal timings from the run's tape. The views are drawn in the shadow of the brief, so they cost no time.

Plan: a brief, not coordinates

With the pictures in hand, the designer agent (Claude Opus, thinking at medium effort) writes a build brief. The brief is the agents’ entire vocabulary, and it is small on purpose. It never contains a position in space, and it never names the bricks in a wall.

A brief describes the model as a tree of bodies. Each body has its own small grid, one stud wide and one plate tall per cell, and says which cells are filled and in which colour. Bodies attach to each other only through real Lego connectors.

A simplified piece of the shuttle’s brief: the stand, two of its layers, and the hinge that carries the fuselage. Each row is a line of cells, one letter per colour.

brief-r1.jsonJSON
{
  "palette": { "w": 15, "k": 0, "c": 47 },
  "root": "stand",
  "bodies": [
    { "name": "stand",
      "layers": [
        ["cccc", "cccc", "cccc", "cccc"],
        ["....", ".cc.", ".cc.", "...."]
      ],
      "connectors": [
        { "part": "3937", "kind": "hinge", "at": [1, 8, 1],
          "attach": [{ "body": "fuselage", "angle": -10 }] }
      ] },
    { "name": "fuselage", "layers": [ ... ] }
  ]
}
The palette maps letters to Lego colours (47 is clear). The hinge sits on one cell of the column and tilts the fuselage by 10°.

Hinge brick

Turns the body above it by a set angle. Used for wings, tails and tilted display stands.

Side stud

A brick with a stud on its side, so a body can face outward. Used for faces, windows and anything that sticks out sideways.

Small details (round tiles for eyes, a bar for a beak, wheels on a pin plate) sit on those connectors. A whole model uses two to five colours and 60 to 250 parts.

Standclear, a 4×4 base and a column
Fuselagewhite and black, ten layers
Three engines
Four windows
Windshieldand a red mark
The shuttle's briefNine sub-assemblies. The stand is the root; everything else hangs off it through a connector.

Here is what one body looks like once the kernel has it. Cut the shuttle’s fuselage down its middle and you see the brief’s cells, layer by layer: a black belly, a white body, the nose on the left and the tail fin on the right.

The brief fills cells, one colour each. On its own, every cell would be a single 1×1 plate.

From cells to platesThe fuselage, cut down its centre line. Simplified: the real merge also turns every other layer's plates the other way, so the joins cross in both directions.

The designer can be asked for several briefs at once, each with a different instruction: “closest to the art”, “chunkier and simpler”, or “bolder features”. They are written in parallel, so three take as long as one. While the first is still being written, the harness reads it as it streams in, and every time a new body is complete it builds the bodies so far and shows them on screen.

Build: the geometry kernel

The kernel turns a brief into a list of real parts in LDraw and checks that list the way a careful builder would. It takes milliseconds; almost all of a run’s time is spent waiting on models.

Assemblecells to real parts
Trim sliversstructure beats decoration
Checkcollisions, does it stand
Any problems?
Already repaired?
Repairthe fast model patches
Throw the round awaykeep the last good model
Publish it.ldr, brief, report
Inside the geometry kernelBuild, check, and one chance to repair. A round that still won't build is thrown away, and the run keeps its last good model.

Assemble. Inside each body, connectors claim their cells first. The remaining cells start as 1 × 1 pieces and are merged into bigger real parts, following a method from research on brick sculptures (Testuz, Schwartzburg and Pauly, 2013). The first pass only takes merges that join two separate groups, which is what removes loose pieces. The second pass merges for size, alternating direction from layer to layer so the seams cross. If anything is still loose, that region is broken back into single plates and merged again. Finally, a surfacing pass rounds off exposed top edges with curved slopes, and each child body is placed by the geometry of its connector: along the side stud, or rotated about the hinge.

Trim slivers. When a wing on a hinge reaches a few pieces into the body it hangs from, a builder would just leave those pieces out. The kernel does the same. Decorative slopes always give way to structure, and a child body loses the few pieces that overlap its parent. If the trim would take more than a third of a body, it stops and reports the problem instead. In the code’s words: trimming a sliver is a fix; trimming a third of a body is a cover-up.

Collisions. Each part’s solid body is sampled on a fine lattice, every 4 LDraw units, and the samples are dropped into buckets. A bucket claimed by parts from two different bodies is a collision. Designed interlocks, such as a hinge top sitting inside its base or a wheel on its pin, are allowed.

Stands. The centre of mass, with every part weighted by its volume, has to fall inside the footprint of the parts touching the ground. Studs grip, so a quarter of a stud past the edge still counts as standing.

Each body arrives as cells: the fuselage, a hinge brick, and the clear stand.

Does it stand?The shuttle from the side, on its stand, drawn level. The dot is the centre of mass of the brief's cells.

Same fuselage, with the stand moved under the nose.

And if it didn't?The same model with the stand moved under the nose: an illustration of what the check rejects.

Any problem (a collision, a model that tips, fewer than twelve parts) goes to a repair step. The fast model gets the brief and the kernel’s report and answers with a patch: only the bodies it changes. The kernel rebuilds once. If the result still won’t build, that round is thrown away; a legal build always beats a prettier broken one.

A simplified version of that rule, as the harness runs it after every brief it writes:

pipeline.pyPython
def build_checked(brief, fixes=1):
    parts, report, problems = build(brief)
    for _ in range(fixes):
        if not problems:
            break
        brief = repair(brief, problems)
        parts, report, problems = build(brief)
    return brief, parts, report, problems
One repair at most. The caller drops the round if the second build still has problems.

Judge: render, critique, choose

A model that passes the kernel is rendered from four angles: front, left, back and right. A headless browser opens the app’s own 3D viewer once and turns the model for each view, so the renders show exactly what you will see.

The critic agent (Claude Opus again) gets the concept pictures, the four renders and anything the kernel flagged. It replies with a score out of ten and a list of issues, worst first. It is a harsh judge, and that is the point: its notes are instructions for the next round, not a grade.

  1. Critic2/10. Doesn't read as a space shuttle at a glance. No vertical tail fin. No engine nozzles.
  2. DesignerReworked the fuselage and two of the engines.
  3. KernelRound 1. 141 parts, 0 collisions, and it stands.
  4. Critic3/10. Reads as a generic jet. The tail fin is a thin plate, not the tall fin in the picture.
  5. done at 4:14, and round 1 is kept
The critique loop, on the shuttleThe real exchange from the run's tape, lightly shortened.

The designer’s answer is a patch, not a new brief. Patches are about five times less to write, and the parts that already work can’t drift while something else is being fixed. A loop that rewrote the whole brief each round scored 5, then 5, then 3 on the same model.

A simplified version of the rounds that follow the first build:

pipeline.pyPython
for rnd in range(1, rounds + 1):
    if score >= target:
        break
    brief = revise(brief, issues, shots)
    brief, parts, report, problems = build_checked(brief)
    if parts is None:
        break
    shots = render(f"r{rnd}")
    score, issues = judge(shots, problems)
    built.append(brief)

review(built)
The app runs one round by default and stops early at a score of 8. Every version built is kept for the choice at the end.

Measuring also turned up a surprise. Over four test runs, the revision round made the model worse every time, even once the designer could see the renders it was fixing.

First build5/10the same in all four runs
Run 1, revised3/10
Run 2, revised3/10
Run 3, revised2/10
Run 4, revised2/10
Revising made it worseCritic scores before and after one round of revision, across four runs.

The lesson was that choice beats polish. Part of the problem was the scores themselves: comparing several designs side by side and scoring one design alone produce numbers that don’t line up. So the harness stopped trusting the score to decide. The app now builds a first version, revises it once, and then shows you every version it built, with the critic’s favourite marked. You can keep one, or keep one and say what to change. If nobody answers within three minutes, the critic decides.

Every version builtfirst build, then revised
You choosethree minutes to answer
Add a note?
The critic picksif nobody answers
Change it“make the wings bigger”
Keep it
The last word is yoursEvery built version is offered. A note costs one more model call and one more build. If nobody answers within three minutes, the critic picks.

Watching it work

Nothing in a run happens behind a spinner. Every step writes a line to a tape (who did it, what happened, and whether it worked), and the tape is saved with the run and streamed to the browser as it happens. A small translation layer in the app rewrites each line into plain words, so you read “Sketched the design” rather than an engineer’s log message.

Bricked's create screen: a grey and white Lego rover being built on the left, and a stack of coloured tape entries on the right.
The create screenA run in progress: the model so far on the left, the tape on the right, newest line on top.

Pictures ride the tape as small thumbnails, and every built round is sent to the 3D view the moment it exists. While the designer is still writing, the half-finished brief is parsed every 400 characters; once two bodies are complete, they are assembled and drawn as a draft. The bricks are real. They are simply not all there yet.

0:00running
  1. 0:07Concept distilled
  2. 0:44Concept art ready
  3. 1:15Side and back views
  4. 2:04Brief: 9 sub-assemblies
  5. 2:05Round 0: 128 parts, stands
  6. 2:25Critic: 2/10
  7. 3:40Round 1: 141 parts, stands
  8. 3:56Critic: 3/10
  9. 4:14Done
The shuttle run, as it streamedFour minutes and fourteen seconds, played back fast. Each line lit up on the create screen as it happened.

Fourteen minutes to four

At the hackathon, the first hummingbird took fourteen minutes. The repository’s notes put a typical run at about 1,000 seconds before tuning and about 290 after. Most of that came from one setting.

~14 minFirst hummingbird, at the hackathon
4m 14sSpace shuttle, after tuning
One run, before and after tuningThe first hummingbird at the hackathon, and the space shuttle run in this writeup.

By default, the models think before they answer, about 15,000 tokens of thinking to write a brief of about 1,500. Turning the thinking down on one brief, with the same concept image, gave this:

Default219sthe model's own choice
Medium73s136 parts, 0 collisions
Low37s114 parts, 8 collisions
Off21s197 parts, 13 collisions
How hard should the designer think?One brief, written at four effort levels. Medium is the setting: much faster, and still clean.

So every model call now names its effort: none for the distiller, low for repairs, medium for writing, revising and judging designs. The rest of the speed came from removing work rather than doing it faster.

one run14:00was 14:00 the shuttle run
  1. Name the effortthinking set per step
  2. Patch, don't rewritefive times less to write
  3. Let code trim sliversno model call for an overlap
  4. Draw while writingviews drawn during the brief
  5. One page, four anglesrenders went from 16s to 6s
  6. Clean callsthe API, or the CLI from an empty folder
Fourteen minutes to fourSix changes, flipped one at a time.

Trimming slivers in code was worth more than it sounds: on one penguin run, it removed every repair round. The concept art has a dial too. A high-quality picture takes 31 seconds and a low-quality one 8. Low art is blockier, which is actually closer to what the kit can build, but the picture stays on screen for the whole run, so the default is high.

Low8sblockier, closer to the kit
Medium13s
High31sthe default
The concept art's dialSeconds to draw one concept at each quality setting.

Runs are the cache

A run is a folder: the concept art, the briefs, every built round, the renders and the tape. That folder is also the cache. When you ask for something Bricked has already made, it doesn’t call a single model. It replays the run.

You ask“bus”
Seen it?match the words
Replay the runabout 20 seconds
Design itthe full harness
Save every roundthe run is the record
Seen it before?Asking twice replays the first run. A record is saved after every built round, so even a run abandoned halfway can be replayed.

Matching works the way a person asks. When it matches something other than exactly what you typed, the tape says so.

Filler is ignored

Words such as “a”, “the” and “build me” don’t count.

Every word must appear

Each word you typed has to be somewhere in the saved idea.

The last word is the thing

“Bus” and “school bus” are the same thing. “Dog” and “dog holding an umbrella” are not.

“bus”
yellow school busthe same thing
“dog”
dog holding an umbrellathe thing is the umbrella
“red”
a red tractorthe thing is a tractor
How the cache matchesThe last word is the thing. Everything before it has to fit too.

A simplified version of the rule:

pipeline.pyPython
FILLER = {"a", "an", "the", "of", "with", "build", "me"}

def words(idea):
    found = re.findall(r"[a-z0-9]+", idea.lower())
    return [w for w in found if w not in FILLER]

def matches(asked, saved):
    want, have = words(asked), words(saved)
    return have[-1] == want[-1] and set(want) <= set(have)
Among the matches, an exact one wins, then the one with the fewest extra words, then the newest.

A replay is not a mock-up. It plays the real tape, shows the real concept art, and puts the real model together on screen in a few pieces, as the first run did. It just doesn’t wait on models that have already answered, so the whole thing takes about twenty seconds. Favourite runs can be exported into the repository, slimmed to about 400 KB each, so a model made on one laptop opens on another.

4m 14sDesigning it, every model call for real
~20sReplaying it: the same tape, art and model
Design once, replay in secondsThe shuttle, designed from scratch and then replayed from its folder.

From a model to real bricks

Because the kernel only ever places parts that exist, the model doubles as a shopping list. The LDraw file already marks the build steps, which the app turns into a manual: one page per step, with that step’s parts laid out beside it.

Bricked's instruction view: step 10 of 18 of a Lego street racer, with the step's parts listed on the left.
The manualStep 10 of 18 of a street racer, with the parts that step needs.

The same parts, counted by part and colour, become the order. Bricked estimates a price for each one, then writes a BrickLink Wanted List, translating every LDraw colour into BrickLink’s. One button copies the list and opens BrickLink’s upload page, where you paste it and buy the lot. Anything BrickLink doesn’t sell is counted and left out, not silently dropped.

The modelevery part and colour
Parts listcounted by part and colour
Sold on BrickLink?
Counted, left outnever dropped silently
Wanted ListBrickLink colours, a price each
Buy the lot
From a model to an orderEvery step here is plain code. No model is involved.
Bricked on a phone: a small Lego model with a green button reading 'Buy the bricks · ~$6.77'.
Buy the bricksOn a phone, the button sits under every build, with an estimate of what the parts cost.

Finished models can also be changed in plain words. “Make the wings bigger” goes to the designer with the current brief and the concept picture, the kernel rebuilds the result, and if the change won’t build, you keep the model you had.

What it can't build yet

The harness builds a wide range of things well: animals, vehicles, buildings, people and at least one meme.

A cat, imaginedA cat, built from bricks
“A cat”
A penguin, imaginedA penguin, built from bricks
“A penguin”
A red lighthouse with blue windows, imaginedA red lighthouse with blue windows, built from bricks
“A red lighthouse with blue windows”
A yellow school bus, imaginedA yellow school bus, built from bricks
“A yellow school bus”
A Canadian goose, imaginedA Canadian goose, built from bricks
“A Canadian goose”
A red tractor, imaginedA red tractor, built from bricks
“A red tractor”
A frog, imaginedA frog, built from bricks
“A frog”
A chess knight, imaginedA chess knight, built from bricks
“A chess knight”
A Mars rover, imaginedA Mars rover, built from bricks
“A Mars rover”
A sumo wrestler, imaginedA sumo wrestler, built from bricks
“A sumo wrestler”
Tung Tung Tung Sahur, imaginedTung Tung Tung Sahur, built from bricks
“Tung Tung Tung Sahur”
A small truck, imaginedA small truck, built from bricks
“A small truck”
Imagined, then builtTwelve runs from the gallery. Hover or tap a card to see the picture the image model drew.

The critic still asks for things the kit can’t make yet, and the repository keeps that list. Every item on it is a new connector or a new part, never a return to letting models place bricks:

  • a second rotation axis, for swept-back wings and turned heads;
  • clips and bars at any angle, for beaks, shafts and handles;
  • wedge plates for feathers and tapered tails (already measured, not yet in the brief);
  • straight roof slopes, so a pitched roof stops looking curled (a house scored 5/10 on exactly this);
  • round bricks and cones, for bushes, trees and paws;
  • rejecting weak joints in the kernel, instead of waiting for the critic to notice them.
Hummingbird
A hummingbird, in bricksThe idea that started the harness, built by it. Tap a side to stop it there.

The idea underneath is simple. We imagine before we build, and the first version of Bricked couldn’t. Giving the agents a picture to work from, and giving the geometry to code, is what turned the blobs into models you can buy.