← All projects

2026 · Demand-forecasting + inventory copilot

KiranaIQ

A demand-forecasting and inventory copilot for kirana stores: snap a bill, get per-SKU LightGBM forecasts, SHAP explanations, reorder quantities, and price experiments, over a Telegram bot.

Built 2026

Why I built this

Small kirana stores run on memory and gut feel, with no analytics layer between a paper bill and a reorder decision. I wanted to see how far disciplined classical ML could go on that problem honestly: forecast demand per SKU, explain every number in language a shopkeeper would trust, and prove it against real baselines on synthetic data before ever claiming it works in a real shop.

35.8% Forecast WAPE (vs 62.1% naive, synthetic data)
64 Tests passing
5-in-1 Forecast, SHAP, OCR, recsys, A/B

Current status

Primary interface is a Telegram bot (built, token-gated, 17 handler tests). As of June 2026, Telegram is blocked in India under a Government of India order, so the live bot is not reachable from India without a VPN; it is deployable to a cloud host, with a webhook/alternative channel as the fallback.

Architecture

Five capabilities in one copilot

  • OCR ingestion · reads a photo of a bill or GST invoice into SKU-level line items with reconciliation checks
  • Forecasting · global LightGBM (Tweedie) per-SKU demand vs seasonal-naive and AutoETS
  • Explainability · SHAP turns each forecast into plain language (festivals, paydays, day-of-week)
  • Reorder + cross-sell · newsvendor quantities and market-basket recommendations
  • Experiments · A/B harness with Bayesian and sequential tests

Tech stack

Technologies used

core

PythonLightGBM (Tweedie)StatsForecast (AutoETS)pandas

infra

FastAPIpython-telegram-bot

tools

SHAP (explainability)OCR (bill/invoice ingestion)Newsvendor + market-basketA/B harness (Bayesian + sequential)

Key highlights

Proof points

  1. 01

    Per-SKU demand forecasting with a global LightGBM model (Tweedie) against seasonal-naive and AutoETS baselines: measured WAPE 35.8 percent versus 62.1 percent for seasonal-naive on synthetic retail data.

  2. 02

    SHAP turns every forecast into plain language a shopkeeper understands (festivals, paydays, day-of-week effects).

  3. 03

    OCR ingestion reads a photo of a bill or GST invoice into structured SKU-level line items, with reconciliation checks.

  4. 04

    Newsvendor reorder quantities plus market-basket cross-sell, and an A/B harness (Bayesian and sequential tests) for price and promo experiments.

  5. 05

    Telegram-bot interface (built, token-gated, 17 handler tests); 64 tests passing overall.

Focus areas

LightGBMSHAPForecastingA/B testingOCRRecommender systemsFastAPITelegram Bot API