
Small and mid-sized retailers still order by gut feeling, losing margin to both stockouts and overstock. Enterprise forecasting suites are too expensive and too opaque for them. StockSense combines a numeric forecaster with an AI agent: 1. Forecasting (not LLM-only): LightGBM quantile models predict daily demand per SKU and store from sales history, weekday, holidays, price and promotions. It outputs P10/P50/P90; the median beat the best naive baseline by 5.8pp with 35.0% WAPE vs 40.8% (-14.2%). 2. Replenishment agent: Gemma-4-31B-IT on AMD GPUs via AMD Token Factory (OpenAI-compatible API, vLLM on AMD) calls get_forecast, get_inventory and calc_order_qty to draft orders and explain each quantity. All quantities come from tools using an order-up-to policy (P90 demand over lead time + review period, rounded to case packs). A number guard cross-checks every figure against tool outputs; in a measured run the agent made 12 tool calls and all 21 numbers passed the guard. aga come from tools using an order-up-to policy (P90 demand over lead time + review period, rounded to case packs). A number guard cross-checks every figure against tool outputs; in a measured run the agent made 12 tool calls and all 21 numbers passed the guard. 3. Human approval gate: nothing is ordered automatically. The store manager approves or edits each line, and edits are logged so a planner can trust the system. AMD usage: every LLM call (agent reasoning, tool calling, explanations) runs on AMD GPUs through AMD Token Factory via the openai SDK with a swapped base_url; the model is picked from GET /models (preferring Gemma), and the UI shows the model name and latency for each response.
18 Oct 2026
.png&w=828&q=75)
RAG solution for Mini-Challenge 3: retrieval-augmented question answering over a mixed-type document corpus with exact-set citations. Architecture: a persistent server holds a vision-language model (Qwen3-VL-8B-Instruct) and a BGE-small embedder resident behind a Unix socket, so each fresh query process answers in seconds without reloading. The --index pass parses PDF (with encrypted-file detection), DOCX, XLSX, CSV, logs and source code, runs VLM OCR on images, and persists chunks and embeddings. Broken or unreadable files are caught per file and recorded, never aborting the walk. Retrieval fuses BM25 and dense embeddings via reciprocal-rank fusion, then runs a second hop that re-queries identifier tokens (ticket ids, part numbers) discovered in the top chunks to pull linked files into context for multi-hop questions. The VLM answers with a strict JSON contract; a salvage parser recovers truncated output, units are normalised against evidence, and a hallucination guard refuses when the answer is unsupported, returning the required empty answer and empty citations. Citations are graded as necessity, not relevance: a NEEDED/UNNEEDED check prunes extras, a completeness check adds missing bridge files, and image-derived answers are verified against the pixels and cited automatically.
1 Dec 2026