Recipe: what to order this week from your stock list¶
Give Hermes your stock list and one simple rule. It tells you what to order, how much, grouped by supplier, and saves the order as a spreadsheet file.
| Time needed | 5 minutes |
| You need | A Hermes agent connected to an AI model and your stock list (a small spreadsheet saved as CSV) |
| Result | The order for each supplier, with the maths for every item, saved in order-this-week.csv |
1. Prepare your stock list¶
One line per item. For each item write how much you have now, how much you use in a week, the supplier, how many days the supplier takes to deliver (lead time) and the pack size you must buy. Save it as CSV from your spreadsheet and upload it in FILES → workspace (see Hermes reads a contract for you).
Our test file, stock-list.csv, for a bakery:
item,unit,in_stock,weekly_use,supplier,lead_time_days,pack_size
Flour T65,kg,60,75,Moagem Silva,3,25
Wholemeal flour,kg,30,12,Moagem Silva,3,25
Butter,kg,8,14,Lacticinios Norte,2,5
Milk,litre,30,40,Lacticinios Norte,2,12
Cream,litre,9,6,Lacticinios Norte,2,6
Eggs,dozen,10,25,Quinta das Galinhas,1,10
Sugar,kg,40,18,Distribuidora Costa,4,10
Coffee beans,kg,6,5,Cafe Atlantico,10,1
Takeaway cups,pack of 50,4,6,Distribuidora Costa,4,5
Paper bags,pack of 100,-3,3,Distribuidora Costa,4,10
We put one mistake in on purpose: the paper bags show -3 in stock, which is impossible. A good assistant should notice it instead of ordering blindly.
2. Give your rule and ask for the order¶
Hermes needs a clear rule for when to order and how much. Ours, in plain words: order an item when the stock will not last until the delivery arrives plus half a week of safety; then order enough for 2 weeks plus the days until delivery, in whole packs. In CHAT we wrote:
Open workspace/stock-list.csv (the stock list of my bakery) and tell me what to order this week and how much. Rules: daily use = weekly_use / 7. Reorder an item if in_stock is less than the use during the lead time (daily use x lead_time_days) plus a safety stock of half a week of use. Order quantity = 2 weeks of use + use during the lead time - in_stock, rounded UP to whole packs (pack_size). Group the order by supplier and show the maths for each item. If a line looks wrong, do not order it: list it separately. Save the order as workspace/order-this-week.csv with the columns supplier,item,quantity,unit,packs.

- Hermes opens a skill it had written for itself in an earlier recipe (bakery-back-office), reads the file and does the sums with a small program.
- One line per item to order, sorted by supplier, with the maths: use until delivery + safety stock, compared with the stock, then the quantity in whole packs.
- The items that do not need an order yet, with their stock and the limit.
- The paper bags line: Hermes did not order it and asks you to check the real count.
The file order-this-week.csv in FILES → workspace had exactly the 6 lines of the table:
supplier,item,quantity,unit,packs
Cafe Atlantico,Coffee beans,12,kg,12
Distribuidora Costa,Takeaway cups,15,pack of 50,3
Lacticinios Norte,Butter,25,kg,5
Lacticinios Norte,Milk,72,litre,6
Moagem Silva,Flour T65,125,kg,5
Quinta das Galinhas,Eggs,50,dozen,5
Check that it worked¶
We worked out the order ourselves with the same rule before asking Hermes. Every quantity matched:
| Supplier | Item | Our order |
|---|---|---|
| Moagem Silva | Flour T65 | 125 kg (5 bags of 25) |
| Lacticinios Norte | Butter | 25 kg (5 packs of 5) |
| Lacticinios Norte | Milk | 72 litres (6 packs of 12) |
| Quinta das Galinhas | Eggs | 50 dozen (5 packs of 10) |
| Cafe Atlantico | Coffee beans | 12 kg |
| Distribuidora Costa | Takeaway cups | 3 packs of 5 (15 packs of 50 cups) |
Wholemeal flour, cream and sugar did not need an order, and the paper bags line was flagged. To check your own result, redo one line with a calculator. For example the butter: 14 kg a week is 2 kg a day; 2 days of delivery = 4 kg, plus 7 kg of safety = 11 kg, and we only have 8, so we order. 2 weeks (28) + 4 − 8 = 24 kg, rounded up to whole packs of 5 = 25 kg.
Make it yours¶
- Every week: schedule it for Friday morning, after you update the stock file.
- A message per supplier: "Write a short order email for each supplier, with the quantities."
- Your own rule: "Keep at least 3 days of stock of milk, because deliveries are sometimes late."
- Add prices: put a
price_per_packcolumn in the file and ask for the cost per supplier.
Common problems¶
Hermes ordered something we have plenty of
Check the numbers in your file first: a weekly use typed in the wrong unit (grams instead of kilos) changes everything. Then check that your rule is written in the message, with numbers. "Order when stock is low" is not a rule Hermes can check.
The quantities are not in whole packs
Say it in the message, as we did: "rounded UP to whole packs (pack_size)", and keep a pack size column in the file.
A line in my file is wrong
Ask Hermes to list doubtful lines separately instead of ordering them, as we did. Fix the number in your file and ask again.