Lay out a factory.
Prove it works.
Ask for a production line, say one for chalkboards. Claude picks the machines, sizes every step to the target rate and places each station on a real floor plan. A constraint solver checks every proposal against the plant's rules and sends back exactly what is wrong, until the layout is valid.
Set up a manufacturing line for a chalkboard
The panel opens on a recorded run of that prompt. Press Design the line to run it live, pick another product, or describe your own. Watch Claude reason, then watch the solver grade each layout; red outlines are broken rules, dashed outlines are the solver's fix.
The building, equipment catalog and rules are fictional and simplified for the demo; they are not engineering or fire-code advice. A live run took 51 to 107 seconds in our tests, and live runs are capped per hour.
How it works
Language models are good at design and bad at geometry. A solver is the opposite. Put them in one loop and the model does the creative part while the solver makes sure nothing it produces breaks a rule.
Design
Claude reads the building and the equipment catalog, splits the product into process steps, adds machines until every step meets the target rate, and places each station on the floor.
Verify
Every proposal becomes a CP-SAT model with one assumption per rule. While the model is infeasible, the solver names rules that cannot all hold; when it is feasible, every remaining rule is proven.
Repair
When moving stations is enough, the solver also finds the valid layout that moves them least. Claude gets the violations and the moves, fixes the layout, and checks again until it passes.
Deploy your own in four commands
Clone the example, log in, create a model gateway key, and run the deploy script. Chalk builds the image, starts one small replica, and prints a URL that serves this exact demo.
The solver is plain Python with OR-Tools. Replace the building, the catalog or the rules, and the agent works against your constraints with no prompt changes.
git clone https://github.com/chalk-ai/factory-layout-agent
cd factory-layout-agent
# Or export CHALK_CLIENT_ID and CHALK_CLIENT_SECRET.
chalk login
# The agent reaches Claude through the Chalk model gateway with this key.
chalk router api-key create # store it as the secret CHALK_ROUTER_API_KEY
./deploy.pyWhat Chalk handles
The design loop is the interesting part. The model calls, the replica and the deploy are the part Chalk does for you.
A verdict, not a guess
The agent cannot declare victory. The loop only finishes on a layout the solver has accepted, and the page shows the solver's result, not the model's opinion of it.
Feedback that names names
Each violation names the stations, the rule and the numbers: which machines, how far apart, how far they need to be. The model fixes the exact problem instead of starting over.
Hundreds of rules per layout
Clearances between every pair of machines, columns, the aisle and fire exits, hazard separation, exhaust, docks, material-flow distance and capacity, checked together on every round.
One gateway for every model call
The agent calls Claude through the Chalk model gateway with a key stored as a Chalk secret. Provider credentials, usage and traces stay in your environment.
One small replica
The agent loop, the solver and this page run in one Chalk scaling group with 2 CPUs and 4 GiB of memory. The model runs behind the gateway, not on the replica.
Open source
The site, catalog, solver, agent, server and page are Apache-2.0 on GitHub. Swap in your own building, equipment and rules, or point the same pattern at a different design problem.
Put a verifier behind your agents
Layouts, schedules, configurations, plans: anything with hard rules can be checked instead of trusted. Talk to an engineer about running verified agents on Chalk.