TL;DR
Pair a classic mixed‑integer inventory redistribution model with an LLM-driven context layer and you get explainable optimization: the math still finds near‑optimal transfers, while the LLM translates them into role‑aware narratives, KPIs, and visuals. The result is faster buy‑in, fewer “why this plan?” debates, and tighter execution.
Why this paper matters for operators
Most planners don’t read constraint matrices. They read stockout risks, truck rolls, and WOS. The study demonstrates a working system where:
- A SCIP-based MIP chooses inter‑DC transfers across weeks and SKUs.
- A context‑engineered LLM layer turns solver outputs into summaries, tables, and charts tailored to analysts, managers, and execs.
- The loop runs through a React UI + FastAPI + AI agents, so users can ask questions in natural language and receive decision‑ready explanations.
Business upshot: planners get the optimality of OR without the cognitive tax of decoding variables.
The core idea in plain English
The optimization engine decides how much to move from which DC to which DC and when, to minimize stockouts and logistics frictions while respecting:
- frozen periods (no last‑minute shuffling),
- minimum shipment thresholds (to avoid tiny, costly moves),
- safety stock limits and lead‑time realities,
- “no ping‑pong” transshipments within the same period.
The LLM layer sits before and after the solver:
- Before: parses free‑form requests (“show projected stockouts in the Southeast next 6 weeks; keep DC3 safety stock intact”), updates JSON configs, and triggers a solve.
- After: rewrites raw solver outputs into role‑appropriate stories (e.g., “DC1 avoids a –1,100 unit stockout by pooling 294 units from DC2–DC5; total savings ~$395k vs stockout penalties; source DCs remain above threshold WOS”).
What’s genuinely new
- Explainable Optimization as a product surface. Not dashboards first, math second—but math first, LLM‑mediated narratives second.
- Role‑aware context engineering: a two‑LLM reflection pipeline adjusts prompts, KPIs, and aggregation levels by user role, then validates completeness before rendering.
- Hybrid speed path: full MIP via SCIP when time allows; Bayesian NN to approximate or pre‑screen when operators need an answer in seconds.
Concrete example: who sees what
Role | Primary view | Typical questions | Output shape |
---|---|---|---|
Analyst | SKU / week detail | Where will we break WOS<2? Which lane is bottlenecked? | Row‑level tables, exception lists, lane charts |
Regional Manager | DC‑family aggregates | Can we stabilize DC1 without hurting DC2/3? | Transfer flow diagram + WOS before/after |
Executive | Region KPIs | Cost avoided? Service risk next 4–6 weeks? | Savings vs stockout penalties, risk heatmap |
This mapping isn’t a dashboard filter; it’s LLM‑authored narrative plus visuals keyed to each audience.
The math, demystified
- Objective: maximize benefits of meeting demand from safety stock minus penalties for unmet demand and costs of triggering minimum transfers.
- Key levers: binary flags for eligibility and minimum‑quantity triggers, inventory split into positive (excess/safety) and negative (shortage) components, and a guard against reciprocal transfers.
- Practical constraints: frozen windows, MOQ realism, and safety stock caps.
Translation for non‑OR readers: the model pays a cost to move units but saves much larger costs by dodging stockouts—subject to rules that make logistics executables, not just mathematically pretty.
Where the LLM earns its keep (beyond pretty words)
- Intent capture: turns messy asks into a safe, consistent schema (SKUs, DCs, weeks, risk tolerances) and edits configs reliably.
- Narrative gap‑filling: connects transfer moves to demand spikes, lead‑time shocks, and WOS changes—what dashboards rarely do.
- Counterfactuals on tap: “What if we cap pulls from DC4 at 150/wk?” → regenerates a constrained run or a fast BNN proxy.
- Decision alignment: stakeholders argue policies, not cells; the LLM keeps everyone on the same storyline.
Risks & how to harden the system
- Prompt injection / data leaks → Isolate the LLM with a strict schema, whitelist tool calls, and log every config change.
- Over‑trusting summaries → Keep linked evidence panes (tables, traces) one click away. Never ship narrative without the numbers.
- Latency vs fidelity → Use BNN for triage, escalate to SCIP for final plans; make the switch explicit in the UI.
- Governance → Track who approved deviations from MOQ/frozen‑period rules; require sign‑off flows for policy overrides.
What to measure (operational scorecard)
- Service: avoided stockout hours, WOS lift at destinations, WOS hits at sources.
- Cost: modeled stockout penalty avoided vs added holding + transport; % of lanes above MOQ.
- Plan quality: number of reciprocal‑transfer violations (target: zero), share of moves executed on time.
- Human loop: time from alert → accepted plan; % of edits driven by natural‑language asks.
Build notes for your stack
- Frontend: React with a split view: narrative left, evidence right (tables, charts, lane graph).
- Backend: FastAPI agents for (1) parser, (2) config manipulator, (3) optimizer orchestrator.
- Solver: SCIP binding; queue runs (short/long) and cache partials.
- Learning path: BNN fed by historical solves and execution outcomes to pre‑rank candidate transfers.
- Context engineering: two‑model reflection; store CE templates versioned; auto‑red‑flag missing KPIs.
When heuristics beat heroics
If your network is small, lead times short, and MOQs negligible, a priority‑rule heuristic with a thin LLM wrapper may hit 90% of the value at 10% of the cost. Reach for full MIP when you see:
- multi‑week horizons with frozen windows,
- frequent demand shocks, long lead times,
- MOQs that make “tiny fixes” uneconomic,
- visible trade‑offs across many DCs/SKUs.
Takeaways
- Math plans; LLMs explain. That combo shifts meetings from “What does X_i,t mean?” to “Do we accept this WOS dip at DC4 to de‑risk DC1?”
- Role‑aware narratives beat one‑size‑fits‑all dashboards.
- Hybrid speed (BNN triage → SCIP finalize) balances responsiveness with rigor.
Cognaptus: Automate the Present, Incubate the Future