Lay out a factory.
Prove it works.
This demo shows Claude designing a production line from a request, such as 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.
Compare the proposed layout with the solver’s repair
The recorded chalkboard example shows the agent proposing a layout and a solver checking explicit rules.
Try this experiment · expected results
1Inspect the recorded design
Read the proposed layout and the solver’s named violations.
Expected: Red outlines identify broken rules; the report explains which constraints failed.
2Compare the repaired layout
Look at the dashed repair outlines and the follow-up solver verdict.
Expected: You can distinguish the agent’s proposal from the solver’s suggested fix before starting a live design.
Follow the recorded layout attempt and the solver’s corrections. Success means a layout the constraint solver accepts; Chalk hosts the agent application.
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.
Built on Chalk
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.
Deploy your own in four commands
Clone the example, log in, create a Chalk 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.pyImplementation details
How the example works
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.
More capabilities
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.