LulzBot Mini 2 3D printer
Not used- Rich open-source assembly docs; the bill of materials ran to 502 lines including subassemblies
- Sources disagreed in 11 places
- No operation times
Researched by me
Production planning & exception management
NUS-ISS Show Me Your Agents (SMYA) Agentic AI Hackathon 2026
My teammates and I built a production-planning agent that works out the cost and delivery of each response when an order grows, material runs short or a machine stops. Once the manager approves one, it handles the resupply, reschedules production and tracks the factory’s confirmation.
The full code is public on GitHub, with local setup steps in the README. The demo video and technical document open directly.
NUS-ISS Show Me Your Agents (SMYA)
Agentic AI Hackathon 2026
Overall approach and task split; scheduling, checking and the execution flow; the manager interface; the BYOF logo and intro film.
Setting up the AWS Lightsail server and the live deployment (byof.site); the early database environment.
SKF research and the domain specification; the reference factory’s database schema, baseline data and validation scripts; the rush-order scenario and solve checks across five disruption scenarios.
The first agent skeleton and runtime fixes; option comparison for demand and supply changes; factory data editing in the simulator; the DeepSeek adapter layer.
A production plan rarely survives the day. A customer adds to an order, a supplier is late, a machine stops, someone calls in sick. Small assembly plants usually have no planning department, so all of this lands on the production manager: check stock, reshuffle the sequence in a spreadsheet, then phone purchasing and the supervisors to find out what expediting would cost and how fast it could happen. When several things go wrong at once, they wait in line.
The hackathon problem statement was Production Planning. BYOF Agent takes this legwork off the manager. It reads the factory’s orders, stock, machines and staff to see which orders a change affects, then builds response options from resupply, expediting, overtime or a new due date. Each option is scheduled, checked and priced so the options can be compared side by side. Once the manager approves one, the system places the resupply, reschedules production and waits for the factory to confirm the new plan.
We held one line throughout: the language model understands the request, decides the next step and explains the result; quantities, times and money are computed by code, and only the manager can approve, on an option card. BYOF stands for Bring Your Own Factory: plug in your own factory’s data and it works. For the hackathon we built one reference factory, the bearing assembly shop described below.
On the left are two browser windows: the manager workbench, where the manager talks to the agent and approves options, and the simulator, which plays the shop floor and creates order changes, stoppages and absences. In the middle is BYOF itself: the business worker runs the agent and the execution flow, the solver worker schedules, checks and prices, and every record lives in PostgreSQL. On the right, the simulated factory keeps its own database, and BYOF can only read data and send commands through its interface. The orange line is the approval path: nothing executes until the manager approves an option card.

Scheduling needs a concrete product and a concrete shop floor, and no public source gives you a real plant’s orders, stock and operation times. So we built a reference factory: product structure and assembly follow real documentation, while orders, stock, times and prices were set by the team.
Our first plan assumed a made-up plant assembling data-acquisition modules, but with a made-up product we couldn’t say where any number came from. So we looked for real products and compared two candidates:
Researched by me
Researched by Zhang Lingyue
The LulzBot bill of materials couldn’t be settled in time, while the SKF data was ready to use, so we chose the SKF bearing assembly scenario. Below is how it went from documents to data.

We used four SKF sealed deep groove ball bearings, 6202, 6203, 6204 and 6205-2RS1, with dimensions from SKF product pages. Each bearing needs an inner ring, an outer ring, a ball set, a cage, two seals, a grease fill and a box: 25 materials across the four sizes.
All four share the same assembly equipment but use their own rings, balls and cages, so a busy order book creates real competition for machines and material. When an order grows or a delivery slips, the system uses this list to work out what is short and by how much.
View the BOM data ↗
Page 41 of the same publication charts the process from ring heat treatment to packaging. We treated ring machining as bought in and kept only final assembly, as eight operations. A batch is 50 pieces; each operation takes 6 to 10 minutes and needs one machine type and one worker skill.
The shop has 8 machines and 8 workers. Two assembly cells can stand in for each other, while inspection, greasing and sealing have one machine each. The workers cover five skills, and one qualified worker runs an operation from start to finish.
Shifts run 8:30 to 12:00 and 13:00 to 17:30, with up to two hours of overtime after 17:30 if the manager agrees. Anything due to start within 60 minutes is frozen. These operating figures are ours, not SKF’s. The baseline has validation scripts and pinned hashes, and the system refuses to start if it changes, so development, tests and the demo all ran on the same factory.

What happenedWhen we stopped machine KIT-01 for 20 minutes, the solver failed seven times in a row. The 60-minute freeze window stacked with the review buffer and left the affected operations nowhere to go. The agent also treated “the solve job finished” as “there is a feasible plan” and kept retrying until it had used all 40 model requests for the session.
What we changedWe unfreeze only the operations the stoppage touches, never re-solve the same infeasible scenario, extended the checker, and taught the agent to tell a finished job from a feasible plan.
What happenedWith production running, comparing options after an order increase took 131 seconds and only one of five options was feasible. A late delivery was worse: 122 seconds and none.
What we changedThe solver now starts from the current plan, stops after 4 seconds without improvement, and options run in parallel processes. Afterwards the order increase took 23 to 30 seconds with all five options feasible, and the late delivery 26 seconds with five of seven.
What happenedDue dates started out as hard constraints, so when one couldn’t be met the only answer was “one day later”.
What we changedOptions now propose a concrete new date, the first full hour at least 30 minutes after the checked completion, and leave every other order’s date alone. The manager has to confirm the customer agreed before approving.
What happenedWhile the model was being asked to fix a malformed action, the factory clock and data kept moving. A correction made on the old data would schedule against a stale factory snapshot.
What we changedEvery correction first refreshes the factory data and hands the model the new snapshot. Corrections count against the turn’s model request budget, and once it runs out the turn stops without asking again.
The demo starts from a day plan already in progress. A customer raises order SO-003 for 6204 bearings from 1,200 to 1,500 pieces, with the same due date: 17:30 the next day.
The extra 300 pieces need 300 inner rings, outer rings, ball sets and cages, plus 600 seals. The shop keeps only a small stock of 6204 parts, so it is short 250 of each of the first four and 500 seals. The problem is material, so resequencing or overtime alone can’t fix it.
Watch the 15-second introOpens on Google DriveAfter the order is changed in the simulator, the manager’s header shows a new field change. When it is opened, the agent re-reads the factory data to confirm what is short, by how much, and whether other orders are affected.
The solver service schedules, checks and prices each feasible combination of measures on its own copy of the factory, several in parallel. Options that only resequence or add overtime drop out because of the shortage.
The manager can ask follow-up questions or approve straight away. After approval the system places five resupply orders, reschedules, releases the plan and waits for the factory to confirm.

| Option | New cash (SGD) | Projected net contribution (SGD) | Delivery |
|---|---|---|---|
| Standard resupply (recommended) | 1,200.00 | 28,450.00 | All 1,500 on time |
| Expedited resupply | 1,587.50 | 28,062.50 | All 1,500 on time |
| Immediate transfer | 2,700.00 | 26,950.00 | All 1,500 on time |
| Reduce the order to 1,200 | 0 | 26,700.00 | 300 pieces short |
Net contribution covers all six orders: revenue minus variable cost, added cost and lateness penalties. For standard resupply that is 87,000 revenue, 58,500 variable cost and 50 in freight for five deliveries, with no lateness: 28,450. Prices come from our own catalog, not supplier quotes.
Standard resupply delivers everything on time for the least money, so it comes first. Expedited resupply and the immediate transfer deliver the same but cost more, and the card folds them away as not adopted. Reducing the order costs nothing new but needs a conversation with the customer. The recommended plan finishes at 14:58 the next day, two and a half hours before the due time, with no overtime.
Running locally, options appeared about 45 seconds after the manager opened the change. After approval, resupply, rescheduling, release and the factory’s confirmation took about 30 seconds.
The other demo scenario is a date that can’t be met: an order grows and is pulled forward to noon the same day. Every option then proposes a specific new due date, and the manager can approve only after confirming the customer agreed.


BYOF has one agent; everything else is deterministic services. Each turn the model returns a single JSON action chosen from 13 registered ones, such as querying data, comparing options or replying to the manager. The server validates the action before running it; if the format is wrong, the model is told only where the error is and gets one chance to correct it. Text coming back from the model is always treated as untrusted data and can’t change any record directly.
The agent runs on LangGraph with session state in PostgreSQL. While a solve is running the session is suspended, and it resumes when the result is written back. Model requests, time and solves per turn are all capped so the agent can’t loop forever.

When the manager opens a change, the business worker refreshes the factory data, takes a snapshot and asks the model for the next step. Option comparison goes onto the solver queue and the session saves a checkpoint and waits. When results are written back, the session wakes up and the model writes the recommendation.
An approval must pass role, CSRF and freshness checks; options older than 15 minutes have to be recomputed. Then the measures, spend and delivery scope are frozen and a queued entry is added to the execution ledger.
Execution moves in stages: re-read the shop floor and confirm nothing changed; send the resupply with a stable request ID; re-solve and require a passing check within the approved scope; release the plan and wait for the factory’s receipt. Any failure stops and goes back to the manager.
Scheduling uses OR-Tools CP-SAT with constraints for operation order, full-batch material availability, no overlap on machines or workers, skills, shifts and the freeze window. The checker is a separate thousand-plus lines that never imports the solver and re-derives every constraint from the raw snapshot. Only a plan that passes can be approved or released.
Read the checker ↗Chat and approval are separate paths. Approval on an option card freezes the measures, spend and delivery scope. If the shop floor changes during execution, or the new schedule falls outside what was approved, the system stops instead of widening the scope.
Read the execution flow ↗Every execution stage is persisted. Commands to the factory carry a stable request ID, retries reuse it and the factory deduplicates on it. If a receipt is lost, the system looks up the original request instead of buying material twice.
Read the recovery test ↗The backend has about 1,870 test cases, with 45 test files running against a real PostgreSQL; the frontend has about 300. Every push runs lint, type checks and the full test suite on GitHub Actions, then starts the whole container stack for a smoke test.
As team lead I split the work and reviewed and merged code. On the development side I mainly looked after the following.
The CP-SAT scheduling model, covering operation order, full-batch material availability, machine and worker occupancy, shifts and the freeze window; and the checker that never imports the solver and re-checks every constraint from raw data.
The minute-by-minute factory simulator and its interface, where teammates could change orders, stop machines or mark workers absent to see how the agent reacted.
Added action validation and call budgets on top of the first agent skeleton; later the option pricing, approve-and-execute flow and execution ledger, and tracking down issues such as infeasible solves after a stoppage and slow option comparison.
Designed the manager interface through several rounds of changes; designed the BYOF logo and made the 15-second intro film.
The full demo video walks through the reference factory’s products, materials and operations, then the rush order and its resupply, and how the agent proposes a new due date when the original can’t be met.
Watch the full demoOpens on YouTubeThe live demo needs both windows open: create a change in the simulator, then handle it as the manager. The demo environment may not stay online.