๐ง Kirana Supply Optimizer โ AI-Powered Inventory Intelligence for Kirana Stores
๐ก Inspiration
Indiaโs kirana stores are the backbone of local commerce, yet most of them operate on intuition rather than data. Store owners often struggle with two critical problems:
- Overstocking โ leading to wastage (especially perishables)
- Understocking โ leading to missed sales opportunities
We were inspired by this gap between traditional retail practices and modern data-driven decision making. While large retailers use sophisticated supply chain systems, small stores lack access to such tools.
Kirana Supply Optimizer was built to bridge this gap using AI.
๐ What It Does
Kirana Supply Optimizer is an AI-powered agent that helps kirana store owners:
- ๐ Predict product demand based on historical patterns
- ๐ฆ Recommend optimal restocking quantities
- โ ๏ธ Prevent stockouts and reduce wastage
- ๐ง Provide simple, explainable insights for decisions
Example Output:
- Predicted Demand: 70 units
- Recommendation: Restock 30 units
- Insight: High evening demand pattern observed
๐๏ธ How We Built It
๐น Data Layer (Databricks + Delta Lake)
We simulated real-world retail data including:
- product
- time slot (morning/afternoon/evening)
- day type (weekday/weekend)
- sales and inventory
All data was stored using Delta Lake, ensuring structured and scalable storage.
๐น Data Processing (PySpark)
We used PySpark for:
- data cleaning (removing nulls, duplicates, outliers)
- feature engineering:
- day type
- time-based features
- rolling averages
- lag variables
๐น Machine Learning Model
We trained a regression model to predict demand:
[ \text{Demand} = f(\text{product}, \text{time}, \text{day}, \text{inventory}, \text{historical trends}) ]
Using Spark ML, we implemented:
- feature vectorization
- demand prediction model
๐น Decision Logic
We implemented a simple but effective rule:
[ \text{Restock Quantity} = \begin{cases} \text{Predicted Demand} - \text{Current Inventory}, & \text{if demand > inventory} \ 0, & \text{otherwise} \end{cases} ]
๐น AI Explanation Layer
To make outputs understandable, we added an explanation layer:
- Converts predictions into human-readable insights
- Example: > "Demand is high due to evening peak consumption patterns."
๐น Backend + Interface
- Backend: FastAPI
- Interface: Lightweight input form for demo
- Output: Structured JSON โ clean UI display
๐ง What We Learned
- How to build end-to-end ML pipelines using Databricks
- Importance of feature engineering over model complexity
- How to balance speed vs correctness in a hackathon
- Designing systems where AI adds real decision value, not just predictions
โ ๏ธ Challenges We Faced
1. Time Constraints (6 hours)
We had to:
- prioritize core functionality
- cut down advanced features like ensemble models and full MLflow pipelines
2. Data Availability
Real kirana data isnโt easily accessible, so we:
- simulated realistic datasets
- ensured variability for meaningful predictions
3. System Scope
Initially, we aimed for a full supply chain optimizer, but we refined the scope to:
Demand prediction + restocking intelligence
4. Databricks Integration
Ensuring proper usage of:
- Delta tables
- Spark transformations
while keeping the system lightweight was challenging.
๐ What Makes Kirana Supply Optimizer Unique
- Focuses on small retailers, not large enterprises
- Combines:
- Data engineering (Delta Lake)
- ML prediction (Spark ML)
- AI reasoning (explainability layer)
- Provides actionable decisions, not just analytics
๐ฎ Future Improvements
- Real-time sales data integration
- Supplier recommendation system
- Mobile app for store owners
- Multi-store intelligence and benchmarking
๐ฏ Conclusion
Kirana Supply Optimizer transforms inventory management from guesswork to intelligence.
By combining AI with accessible tools, we aim to empower millions of small retailers to make smarter, data-driven decisions.
Smarter Stocking, Powered by AI
Log in or sign up for Devpost to join the conversation.