A hackathon-grade full-stack Streamlit application for intelligent inventory management, demand forecasting, anomaly detection, and AI-assisted decision making.
# 1. Clone the repo
git clone "https://github.com/sudhanvapops/warehouse_intel.git"
cd warehouse_intel
# 2. Install dependencies
pip install -r requirements.txt
# 3. Run the app
streamlit run app.pyOpen http://localhost:8501 in your browser.
warehouse_intel/
├── app.py # Main entry point & routing
├── requirements.txt
├── data/
│ └── inventory_demand_forecasting_dataset.csv
├── pages/
│ ├── dashboard.py # KPIs & demand visualizations
│ ├── inventory.py # Optimization engine
│ ├── forecasting.py # ML demand forecasting
│ ├── segmentation.py # K-Means product clustering
│ ├── anomalies.py # Isolation Forest anomaly detection
│ ├── simulator.py # What-If scenario simulator
│ ├── assistant.py # AI chat assistant
│ └── report.py # Executive report generator
├── src/
│ ├── data_loader.py # Data loading + simulated columns
│ ├── inventory_optimizer.py # Safety stock & ROP calculations
│ ├── forecasting.py # Model training & evaluation
│ ├── clustering.py # Product segmentation
│ ├── anomaly_detection.py # Isolation Forest detection
│ ├── report_generator.py # Markdown report generation
│ └── ai_assistant.py # LLM-ready Q&A module
└── README.md
| Feature | Method | Description |
|---|---|---|
| Inventory Analytics | Pandas + Plotly | KPIs, trends, promotion analysis |
| Inventory Optimization | Statistical (Z-score) | Safety stock, ROP, reorder alerts |
| Demand Forecasting | LR / Random Forest / XGBoost | Multi-model comparison + 30-day forecast |
| Product Segmentation | K-Means (k=3) | Fast / Medium / Slow moving segments |
| Anomaly Detection | Isolation Forest | Demand spikes, drops, abnormal patterns |
| What-If Simulator | Parametric recalculation | Instant scenario modeling |
| AI Assistant | Rule-based + LLM API | Natural language inventory Q&A |
| Executive Report | Auto-generated Markdown | Downloadable business summary |
- Records: 4,380 rows
- Columns: date, store_id, product_id, price, promotion, demand
- Products: A, B, C, D
- Stores: 3 stores
- Period: Full year 2024
| Column | Simulation | Assumption |
|---|---|---|
current_stock |
Uniform random 20–200 per product-store | Represents snapshot stock at analysis time |
lead_time_days |
Uniform random 3–14 per product | Typical supplier lead time range |
The assistant works out-of-the-box with rule-based intelligence.
To enable real LLM responses:
- Open the AI Assistant page
- Expand Connect LLM API
- Select your provider (Claude / OpenAI)
- Paste your API key
Supports: Claude (Anthropic) · OpenAI GPT-4o
- Streamlit — UI framework
- Pandas / NumPy — Data processing
- Plotly — Interactive charts
- Scikit-learn — Linear Regression, Random Forest, K-Means, Isolation Forest
- XGBoost — Gradient boosting forecast model
Models are trained on 80% of data and evaluated on 20% hold-out.
Best model is auto-selected by lowest RMSE.
Built for hackathon. Production-ready architecture.