Return to prototype · Download source and model
A browser prototype for store-to-warehouse purchase-order recommendations. The supplied Kalyani data is preloaded; stock, sales, SKU master and On Demand lists can be replaced using XLSB, XLSX or CSV files.
Open the hosted prototype. A static HTTP preview of dist supports guided calculations; hosted AI analysis uses the Worker. Files selected in the browser are processed locally and disappear on reload. The supplied demonstration dataset and the trained model are included with the site. No ERP purchase order is sent.
Ask your data now has two modes. AI analysis uses OpenAI GPT-5 Mini to interpret questions in the user's own words. It creates a validated query over store SKUs, observed sales or stock batches; the browser computes filters, groupings, counts, sums, averages and rankings over all matching uploaded records. A second AI call explains computed evidence. Numeric totals are never taken from an invented model answer. Guided analysis retains the existing supported questions and runs without the API.
Questions can combine ABC/Core/chronic/status filters, product names/codes, manufacturer/category, sales months, stock thresholds, expiry and PO quantities/cost. Month comparisons include calculated changes and growth; zero-baseline growth is unavailable. Policy questions route to the existing client-rule, AI-impact or scenario calculators. Up to four comparisons are supported in one question. Follow-up questions retain the previous interpretation during the current browser session; data/control changes clear it. Results show their scope and query, plus supporting rows and a complete CSV export. Empty matches, unavailable source fields, clarification requests, billing/authentication/rate-limit problems and timeouts are visible results rather than blank panels. Cancellation and context changes prevent stale responses from replacing current data.
Examples: “Which 10 manufacturers contributed the most sales in August 2026?”, “Find Class A medicines with no stock”, “Which non-core medicines have zero sales in the selected months?”, “Explain why the system wants to order P44578”, “Compare July and August sales for SUN PHARMA”, and “What if demand increases by 10%?”. Warehouse availability, margins/profit, customer/bill analytics, actual stockout history and future observations remain unavailable because those source fields were not supplied. No generated code or dynamic SQL is executed.
The current store/category controls bound all questions. The API receives the question, scope, available month/product-group labels and the field catalogue for interpretation, then up to 30 computed evidence rows per comparison for explanation. The source uploads are not sent wholesale or persisted by the app; OpenAI calls set store: false (provider retention policies still apply). The AI explanation can be mistaken: review the deterministic evidence before acting. API usage is billed to the configured project separately from ChatGPT subscriptions.
The API key is stored as a Sites runtime secret, never in browser JavaScript, source archives, manifests or Git. Local .env.local is ignored. Build with node build_worker.cjs: this emits dist/server/index.js and an explicit allowlist of public assets. It exports a Worker-compatible fetch handler. The API requires the private Site's authenticated visitor header, checks browser origin, bounds payload sizes and limits concurrent requests. The hosted project remains owner-private.
The impact view compares client weighted-average demand and the actual Croston/MLP hybrid while holding stock, ABC, course floors, holds, rounding and expiry controls constant. It reports estimated PO values, changed order SKUs, new/removed order lines and item-level quantity/value differences. These are proposed-order changes, not proven inventory savings, avoided stockouts or service improvements.
Client scenarios can change demand by −100% to +300%, method and ABC coverage days. Previews preserve the active PO settings. Changing demand is an explicit scenario assumption and does not retrain or modify the MLP weights.
Clients can separately enter observed baseline/pilot average inventory value, stockout SKU-days, expiry write-off value and PO preparation minutes per order. They must confirm equal-length periods and the same store/SKU scope. Differences are shown as unverified client-reported observations, not causal AI benefits. Missing pairs are unavailable, never treated as zero; percent change from a zero baseline is unavailable. Entries are transient in the current browser session; download the comparison to retain them. Changes to source/control context clear comparison confirmation.
AI checks: node test_ai_query.cjs, node test_ai_worker.mjs and node test_ai_ui.cjs verify grounded query arithmetic, server routing/authentication/error handling and asynchronous result states. node check_ai_live.mjs is an explicit live provider check and incurs API usage. Real provider checks passed for manufacturer ranking, explanation, SKU policy and missing profit data. Interface checks use DOM simulation; visual browser QA remains unavailable.
Existing checks: node test_analytics.cjs tests question grounding, impact reconciliation, scenario isolation, missing data, expiry and client observation arithmetic. node test_analytics_ui.cjs tests the interface with a DOM simulation; this does not replace browser visual QA. Browser WebMCP runtime validation remains unavailable in the static preview environment.
Pack Qty contribute zero quantity and zero sales value. Other negative sales values remain signed in average sales; negative SKU average values are excluded from ABC scoring and flagged.Chronic Monthly Full Course *2). It uses the supplied floor even where the Chronic flag is missing or Acute.n_pack_cls_qty across batches. Loose units are not added. Optional expiry exclusion subtracts positive quantities with expiry date at or before the cutoff. Unknown expiry stays in stock and is disclosed in item detail.The historical final workbook limits and sun pharma values are not automatically copied into future orders. They contain manual decisions without a generalized rule. Use a validated policy/master change once those decisions are confirmed.
Classic Croston separately smooths positive demand size and inter-arrival periods. Initial interval is the position of the first positive observation (1-based); subsequent updates occur only on positive months. Monthly forecast is smoothed size divided by smoothed interval; all-zero series forecast zero. Alpha defaults to 0.1; classic Croston does not decay during trailing zero months.
Synth-AI is a working label for an actual pooled MLP implemented with scikit-learn, not a proprietary system supplied by the client. Architecture: 12 inputs → 16 ReLU → 8 ReLU → 1 linear log-quantity output. Features are three quantity lags, six-month mean, zero frequency, classic Croston, six-month standard deviation, target calendar sine/cosine, Core, Chronic and course floor. Quantity features and target use log1p. Features are standardized on training data only. All-zero histories are assigned zero statistical demand, retaining policy floors.
Training pools SKUs from this one branch; it does not invent synthetic observations. Training targets Dec 2025–Jun 2026, July validates hybrid weights, August is held out. August evaluation refits on targets through July; final September scoring refits on targets through August. Two hidden layers have 16 and 8 neurons, L2 regularization 0.01, Adam, seed 42 and up to 80 epochs. Train script: train_model.py; serialized browser weights and scalers: dist/model.json.
Hybrid baseline is Croston if ≥1/3 of historical months are zero; otherwise latest-three-month quantity weights 20/30/50. This is a transparent pilot heuristic, not a claimed universal threshold. Candidate MLP shares 0%,25%,50%,75% are scored on July WAPE, retaining a baseline contribution. July selected 75% MLP + 25% baseline. Croston is also an MLP input. User-selected month weights affect client demand and ABC; the hybrid baseline uses its fixed 20/30/50 convention. Croston alpha controls the baseline forecast; the learned MLP's Croston feature remains 0.1 to match training.
Scoring target is the month after the latest uploaded sales month. New sales uploads are evaluated with frozen Kalyani weights; they do not retrain the neural network. Other branches, date ranges or portfolios require offline retraining and validation before production. Stock upload alone cannot establish demand for another branch.
The full results are in dist/validation.json. August pooled WAPE: client 71.90%; Croston 91.62%; MLP 66.14%; hybrid 70.05%; last-month naive 84.93%. August hybrid bias −13.91%; MLP bias −24.56%. WAPE = sum absolute forecast errors / sum observed quantity ×100. Bias = sum(forecast − observed) / sum observed ×100. MAE is mean absolute error across SKU targets. Metrics pool all 6,159 SKUs seen anywhere in the annual source, including cold-start SKUs first appearing in holdout months.
These errors are high. No confidence interval, service-level guarantee, lost-sales correction, warehouse allocation or 400-store generalization is demonstrated. Master flags are assumed stable over time because historical master changes were not supplied; this limits the temporal validation. Month seasonality has only one observed annual cycle.
dist/reconciliation.json reports 3,086/3,089 workbook weighted quantities matching under May20%/June30%/July50%. Final Word-rule limits match 1,674/3,089 rows when comparison is restricted to the workbook SKU universe; mismatches include manual overrides, inconsistent maximum-day formulas and cleaning/ABC differences. The comparison is evidence of differences, not exact workbook replication.
Maintain daily sales and availability by store/SKU, SKU-course master, category flags, batch expiry/cost, warehouse stock, confirmed inbound/open POs, reservations, pack multiples, lead-time distribution, promotion and price changes. Pool across all stores and hold out future dates; validate by store and demand segment. Add stockout/expiry/holding-cost inventory simulation and rollouts in shadow mode.
Use inventory position = usable stock + confirmed inbound − reservations. Reorder points and order-up-to targets should account for lead time, review cadence, service targets and expiry limits. Existing ABC day rules remain business constraints unless the client changes them. Add warehouse allocation and ERP approval/submission after this recommendation stage. Do not add safety stock on top of coverage already intended as safety stock without defining the policy.
Run node test_engine.cjs from the project root ; the workbook comparison fixture is included, and calculation boundary tests do not require a browser. Parser tests cover original XLSB/XLSX files and upload templates. JavaScript syntax and static local links were checked. This environment did not provide a compatible browser preview for the static site, so visual browser QA and WebMCP runtime validation remain unavailable.