Shelf Gate
Built at Meta Global AI Developer Hackathon · Oct 26, 2026 · Remote

Shelf Gate is a pharmacy stock-operations agent with a human approval gate. I'm a licensed pharmacist: I graduated in 2021 and have worked in pharmacies since 2013. In that time I've seen how much time is lost to manual counts, missed expiry dates and slow delivery checks. The pharmacist gives the agent a goal, for example "Morning check: audit the shelf, receive the delivery and draft the reorder", plus photos of a shelf or an opened delivery carton. Muse Spark plans the run through tool calling. It picks one of five tools at a time (shelf audit, delivery intake, expiry flags, restock draft, hand to pharmacist), reads the result and picks the next, within a step limit. None of the tools can approve anything. Inside the photo tools: 1. SAM 3.1 finds every pack. 2. Muse Spark reads each pack region into a strict JSON schema: name, strength, pack size, lot and expiry. 3. The agent matches each read to the catalog and checks expiry dates (expired, or near expiry within 90 days). 4. Anything doubtful goes to a human review queue instead of being guessed. 5. The tool proposes change sets: quarantine expired lots, or receive a delivery while refusing short-dated lots. A restock draft is built per supplier from par levels. Nothing changes stock until a named pharmacist approves the change set, and every decision is written to an audit log. It is deliberately not a medical tool. There is no clinical, dosing or substitution advice, and a deterministic guard (English and Arabic) refuses those questions. Clinical goals are refused before the model is called. It is also not a one-shot image analyzer: the photo is only the input to an approval-gated agent that chooses its own stock steps. Built during the event: a Node.js CLI and a web UI with no dependencies, 53 automated tests, a keyboard-accessible UI and synthetic data only. The pharmacy, makers, suppliers, lots and barcodes are all fictional. It runs offline for the demo, where a deterministic mock planner simulates the tool choices on synthetic fixtures, or live on the Meta Model API (built for it; access still pending). As a backup it can also run the reads and the planner on Muse Spark Open, Meta's open-weights model, through Baseten. The Baseten path was tested live on Muse Spark Open on 2026-10-29 (transcripts in docs/live-runs); the Meta Model API path is still pending.