Supply chain state machines for LLMs

Should a company's operational logic live in a maintained model that an AI queries, or should the AI rebuild it from raw tables every time someone asks? I built a persistent model of a manufacturer from real production, delivery and order data (SupplyGraph, an FMCG manufacturer, 2023). It holds stock positions, inferred capacity with the reasoning behind each assumption, day-by-day projections, and a shared decision log. I then gave Claude 38 questions people at the company would ask, through the model, through raw SQL, or through both.

Results

accesscorrectcost / questiontime / questiontool calls
twin (model)32 / 32 in-model, 0 / 6 outside it$0.0329 s3.2
raw (SQL)38 / 38$0.11131 s8.0
hybrid (both)14 / 14 (decisions + outside-model)$0.05317 s4.9
cost per question by type for each access method; the model-backed agent is cheapest on every type and the gap is largest on rankings, capacity, decisions and consistency checks
  • Same answers, about a quarter of the cost and a third of the time. On questions the model was built for, Claude was right every time either way, including order decisions, consistency across reworded questions, and decisions recorded by one person and picked up by another.
  • The gap grows with difficulty. Raw SQL costs 2.8× more on simple lookups and 4–6× more on rankings, capacity and order decisions, where it has to rebuild the company's logic in 10+ queries.
  • The model fails safely. Asked things it has no tool for, it said so and explained where the data lives, instead of guessing.
  • Giving the AI both loses nothing. It used the model for every decision (no SQL at all) and fell back to SQL only for questions outside it.

Caveats: raw SQL was given exact written definitions of every metric, a best case most companies don't have; each question ran once; one model (Claude Opus 5.5) at one effort level.

Next steps

  • Rerunning raw SQL without written definitions, the realistic case.
  • Interviewing manufacturing and supply chain leaders to identify which decisions are most costly or difficult, and where current tools fall short.
  • Automating how the model is built and kept current from a company's existing systems.