Inspiration

Drug shortages don't make headlines the way disasters do, but they hit patients every day. Between our team's clinical experience (CNA and EMT work, including hospice) and conversations about how pharmacies actually cope, we kept hearing the same story: one site runs out of a critical drug while another site in the same network has a surplus sitting on the shelf, and nobody finds out until it's too late. The FDA publishes shortage data, and pharmacy teams know their own counts, but nothing connects the two into a plan.

We actually started this hackathon building a mass-casualty triage dashboard. Partway through, we realized the more common, quieter crisis was supply: the right drug in the wrong place. So we pivoted, kept the name, and built Argus Supply Network.

What it does

Argus is a coordination system for multi-site pharmacy networks:

  • Watches the real FDA shortage feed (openFDA) and combines it with the inventory counts each site enters.
  • Forecasts stockouts as probabilities, not just alerts, flagging which sites are likely to run out before their next resupply.
  • Drafts transfers between sites. A planning agent proposes moving surplus stock, including swaps between therapeutically equivalent products.
  • Keeps humans in charge. The agent can't move anything on its own. A person approves every transfer, and each one is tracked through a ledger: requested → reserved → shipped → received.

How we built it

  • Forecasting: We model each site's daily demand with a Gamma–Poisson model. The demand rate is uncertain, so we treat it as a random variable:

$$\lambda \sim \text{Gamma}(\alpha, \beta), \qquad D_t \mid \lambda \sim \text{Poisson}(\lambda)$$

The stockout risk is the chance that demand over the resupply lead time $L$ exceeds current stock $S$:

$$P(\text{stockout}) = P\left(\sum_{t=1}^{L} D_t > S\right)$$

When a drug is under an active FDA shortage, we extend the lead time ($L' = L + \Delta$) to reflect slower resupply, and we backtest the model against historical data to check its accuracy.

  • Ledger & backend: A SpacetimeDB module holds the source of truth, with private tables exposed to members only through views, role-based access, password hashing, and a scheduled cleanup job.
  • Agent workers: Node processes (two by default) split work using time-limited leases, so a stale worker can never overwrite a newer one. If a worker dies, its jobs fail over to a survivor in about 10 seconds. The planner uses Claude when an API key is set and falls back to a deterministic planner otherwise.
  • Dashboard: A React app with Home, Inventory, Transfers, Agent, FDA Watch, Network, and System pages, plus drug search, CSV import, bulk usage entry, and an offline queue that safely replays writes when the connection returns.
  • Auth: SpacetimeAuth (OIDC) with email invitations.
  • Two modes: sandbox (synthetic sites + real FDA notices) for demos, and demo for running a real network from scratch.
  • Testing: 50 tests across the agent, web app, and integration layers.

Challenges we ran into

  • Pivoting mid-hackathon. Throwing out a working mass-casualty dashboard was painful, but the supply problem was more grounded and more useful. We kept our SpacetimeDB foundation and rebuilt almost everything on top of it.
  • Making the AI safe to trust. An agent that can move medication is a liability. We had to design the system so the agent only ever proposes, and every action goes through human approval and an auditable ledger.
  • Distributed correctness. Getting multiple workers to share jobs without double-processing or overwriting each other took real work on leases and failover.
  • Honest forecasting. A single "you'll run out on Tuesday" number is misleading. Expressing risk as a probability, and adjusting it for FDA shortages, took a lot of iteration.

Accomplishments that we're proud of

  • Working end-to-end on real FDA shortage data, not just mock data.
  • A forecasting model that reports uncertainty and checks itself against history.
  • Fault-tolerant workers: kill one mid-demo and the system keeps going.
  • A human-in-the-loop design where every transfer is approved and traceable.
  • Offline support, so a pharmacy with spotty connectivity doesn't lose data.

What we learned

  • In healthcare tools, trust and auditability matter as much as intelligence. The approval flow and ledger are as important as the forecast.
  • Probabilistic models communicate risk better than hard predictions.
  • Distributed systems are hard, and leases and idempotent writes are worth the effort.
  • Sometimes the best idea is the one you find halfway through. Being willing to pivot made the project better.

What's next for Argus

  • Piloting with a real multi-site pharmacy network or hospital system.
  • Pulling inventory automatically from pharmacy management systems instead of manual entry.
  • Smarter substitution logic grounded in clinical equivalence guidelines, reviewed by pharmacists.
  • Regional coordination beyond a single network, so neighboring systems can help each other during shortages.
  • Richer demand modeling (seasonality, local outbreaks) and shipping-cost-aware transfer planning.

Built With

Share this project:

Updates

Submission history