
S4AI startup, CTO role
Purchasing agent for restaurants
The purchasing agent of a restaurant group, in production since October 2026. The chefs write their orders in free text; for each line, the agent picks the item, the supplier and the price, and the purchasing team corrects. Each correction becomes a rule the agent then applies.
In production since October 2026 (as of 17 November 2026).
At a glance
- What it is
- The agent that turns the messages of a restaurant group's chefs into priced orders: for each line, a product, a supplier and a price.
- For whom
- A restaurant group with several restaurants, and its purchasing team.
- What it changes
- The purchasing team corrects, and its correction becomes a rule: from week 45 to week 46 of 2026, the lines to correct per order went from 2.67 to 0.92.
- My role
- I designed the operating rule (the agent decides, the person corrects) and built the system, with coding agents as tools. Every production release goes through me.
Problem and stakes
Chefs write freely, mixing items, quantities and delivery instructions. Several suppliers send a price list every week, and its labels change.
Without the agent, the buyer re-keys every line, compares the lists and picks the supplier. What is at stake: fewer lines to correct, the right supplier, no line lost, and never a human decision overwritten.
Context and constraints
- Status
- In production since October 2026 (as of 17 November 2026). Order pricing in production since October 2026; order module delivered at the end of July 2026.
- Setting
- AI startup, CTO role
- Layers
- Interfaces, The model proposes, The code decides, Client systems
Constraints
- Portuguese everywhere: chefs' messages, screen, e-mails to suppliers.
- A line touched by a person is never changed by the agent again, and every price shown carries its source.
- Any write to the group's management software requires explicit approval.
Architecture

FigureThe crates
The team's correction becomes a rule
The five steps
- The chef writes the order freely.
- For each line, the code picks the item, the supplier and the price.
- The purchasing team corrects.
- Its correction becomes a rule.
- On the next order, the rule applies.
Principle figure: it shows the role of each part, not the client's rules.
DiagramWho does what in an order
Interfaces
The chefs' messages; price lists received by e-mail; the purchasing team's screen.
The model proposes
A language model steps in as support; it is the smallest model that is enough.
The code decides
The code picks the item, the supplier and the price, keeps the source of each price, and never changes a line a person has touched.
Client systems
The catalogue of the group's management software, read-only.
Where a person decides
The purchasing team corrects and approves; its corrections become rules.
How to read From top to bottom, the four layers of the machine. The chef's message comes in, the agent prices each line, the purchasing team corrects; the bottom line says where the person prevails.
Legend
- Interfaces
- The model proposes
- The code decides
- Client systems
- human decision
- layer not touched
Diagram of principle: the layers and their responsibilities. The real rules, thresholds, instructions and sequences stay with the client.
Technologies
Python, PostgreSQL, web interface, language model, automated tests and screen checks in a browser
My role
The doctrine "the agent decides, the person corrects" is mine, set down in writing in October 2026. I designed the architecture and built the system under that rule, with coding agents as tools. Production releases go through a tool I control, and the rule's red lines require my approval.
What I contributed
- I gave the decision to the agent where it can be measured: at the replay of 17/11/2026, it reproduces 56 of the purchasing team's 60 supplier choices.
- I turned each correction by the purchasing team into a rule the agent then applies: from the following week, the lines to correct per order dropped markedly.
- A line touched by a person is never modified by the agent, and every displayed price carries its source.
- Any write to the group's management software requires explicit approval.
Decisions
ChosenThe agent decides each line; the person corrects, and their correction always wins.
RejectedHaving the purchasing team approve every price.
EvidenceMeasured in production by replay: the lines to correct per order fell in November 2026, for 1.60 on average since the start.
ChosenThe language model stays in a supporting role, and it is the smallest model that is enough.
RejectedA model call on every line, with a large model.
EvidenceIn November 2026, only the smallest model was called in production.
ChosenAll orders are regularly replayed by the production code and compared with the purchasing team's corrections.
RejectedJudging a change on a handful of test cases.
EvidenceIn the replay of 17 November 2026, the agent reproduces the large majority of the purchasing team's supplier choices.
What this shows
Give the decision to the agent where it can be measured, and keep the person in charge: every correction wins and becomes a rule.
Measurements
measurements and counts, with how they were measured
2.67 → 0.92
lines to correct per order, week 45 then week 46 of 2026
measured in production
1.60
lines to correct per order on average, since the replay began
measured in production
56 / 60
of the purchasing team's supplier choices reproduced in the replay, on 17 November 2026
measured in production
Measurement modes
- measured in production on the system in service
Limits
- The time saved by the purchasing team and the delay between the chef's message and the pricing are not measured yet.
- Scope: the system prices and prepares the orders; sending them to suppliers is still done by the purchasing team (as of 17 November 2026).
What stays private
What this case study does not show, and will not show:
- Group, restaurants, team and suppliers
- Prices, volumes and costs
- Management software and its schema
- Supplier selection rules
- Instructions given to the model