An intelligent automated re-ordering system that analyzes usage patterns and predicts when products need to be reordered. Built with AI-powered insights and inventory management capabilities.
- Overview
- Features
- Quick Start
- Architecture
- Installation
- Usage
- Data Processing
- AI Predictions
- Configuration
- API Reference
- Project Structure
- Contributing
- License
Automated Re-Order Concierge is an intelligent inventory management system that uses AI to predict when products need to be reordered based on historical usage data, seasonal trends, and business patterns. It helps businesses optimize inventory levels, reduce stockouts, and minimize carrying costs.
- 🤖 AI-Powered Predictions: Uses machine learning to forecast re-order needs
- 📊 Inventory Analytics: Comprehensive dashboard with key metrics and insights
- 🔔 Smart Notifications: Automated alerts for low stock and re-order points
- 📈 Trend Analysis: Identify seasonal patterns and usage trends
- 🔄 Supplier Management: Track supplier information and lead times
- 📋 Order Generation: Automatically generate purchase orders
- 📱 Mobile Responsive: Access from any device with a web browser
- 🔒 Data Security: Secure handling of inventory and business data
- 📤 Export Capabilities: Export reports in CSV, Excel, and PDF formats
- 🔧 Customizable Rules: Set custom re-order thresholds and rules
- Python 3.9 or higher
- OpenAI API key (for AI features)
- Modern web browser
- Clone the repository
git clone https://github.com/znblrean/Automated-Re-Order-Concierge.git
cd Automated-Re-Order-Concierge- Set up virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Configure environment
cp .env.example .env
# Edit .env file with your OpenAI API key- Run the application
streamlit run app.py- Access the app at
http://localhost:8501
graph TB
A[Data Input] --> B[Data Processing]
B --> C[AI Analysis]
C --> D[Prediction Engine]
D --> E[Recommendations]
E --> F[Order Generation]
F --> G[Notifications]
G --> H[Dashboard]
I[User Interface] --> H
H --> J[Reports & Exports]
style A fill:#e1f5fe
style C fill:#f3e5f5
style F fill:#e8f5e8
style H fill:#fff3e0
- System Requirements
# Verify Python version
python --version # Should be 3.9 or higher
# Verify pip is installed
pip --version- Install with Docker (Alternative)
# Build Docker image
docker build -t reorder-concierge .
# Run container
docker run -p 8501:8501 reorder-concierge- Development Installation
# Install development dependencies
pip install -r requirements-dev.txt
# Install pre-commit hooks
pre-commit install-
Initial Setup
- Upload your inventory data (CSV, Excel)
- Configure suppliers and lead times
- Set re-order thresholds and rules
-
Dashboard Overview
- View inventory status at a glance
- Monitor critical alerts
- Access quick actions
-
Data Import
# Example data format import pandas as pd data = pd.DataFrame({ 'product_id': ['P001', 'P002'], 'product_name': ['Product A', 'Product B'], 'current_stock': [50, 100], 'min_stock': [20, 30], 'lead_time_days': [7, 14], 'supplier': ['Supplier X', 'Supplier Y'] })
- Real-time stock level tracking
- Automatic low-stock detection
- Historical usage analysis
- Demand forecasting
- Seasonal trend analysis
- Lead time optimization
- Automatic PO generation
- Supplier communication templates
- Order tracking
- Inventory health reports
- Cost analysis
- Performance metrics
- CSV: Comma-separated values
- Excel: .xlsx and .xls files
- JSON: JavaScript Object Notation
- Database: SQLite, PostgreSQL (via connectors)
# Required fields for inventory data
required_fields = [
'product_id', # Unique product identifier
'product_name', # Product description
'category', # Product category
'current_stock', # Current inventory level
'min_stock', # Minimum stock threshold
'max_stock', # Maximum stock capacity
'unit_cost', # Cost per unit
'lead_time_days', # Supplier lead time
'supplier_id', # Supplier identifier
'last_order_date', # Date of last order
'average_daily_usage' # Historical usage rate
]- Type checking and conversion
- Range validation
- Consistency checks
- Duplicate detection
-
Time Series Forecasting
- ARIMA models for seasonal patterns
- Exponential smoothing
- Prophet for trend detection
-
Demand Prediction
- Regression models
- Neural networks for complex patterns
- Ensemble methods for accuracy
-
Anomaly Detection
- Identify unusual usage patterns
- Detect data quality issues
- Flag potential problems
prediction_features = {
'historical_sales': 'Past sales data',
'seasonal_factors': 'Seasonal adjustments',
'promotional_impact': 'Marketing effects',
'economic_indicators': 'Market conditions',
'competitor_activity': 'Market dynamics',
'weather_patterns': 'Environmental factors'
}Create a .env file with:
# API Keys
OPENAI_API_KEY=your_openai_api_key_here
DATABASE_URL=sqlite:///inventory.db
# Application Settings
APP_NAME="Automated Re-Order Concierge"
DEBUG=False
PORT=8501
HOST=0.0.0.0
# Email Settings (for notifications)
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
EMAIL_USER=your_email@gmail.com
EMAIL_PASSWORD=your_app_password
# Business Rules
REORDER_THRESHOLD=0.2 # Reorder at 20% above min stock
SAFETY_STOCK_DAYS=7 # Additional safety stock in days
NOTIFICATION_DAYS=3 # Days before stockout to notify# config/settings.py
class Settings:
# Inventory rules
REORDER_POINT_MULTIPLIER = 1.2
SAFETY_STOCK_RATIO = 0.1
MAX_ORDER_QUANTITY = 1000
# AI Settings
PREDICTION_HORIZON_DAYS = 30
CONFIDENCE_THRESHOLD = 0.8
MODEL_RETRAIN_DAYS = 7
# UI Settings
ITEMS_PER_PAGE = 50
AUTO_REFRESH_MINUTES = 5
DEFAULT_CURRENCY = "USD"class InventoryManager:
def __init__(self, config):
"""Initialize inventory manager with configuration"""
def check_stock_levels(self) -> List[Alert]:
"""Check all products against reorder thresholds"""
def generate_recommendations(self) -> List[Recommendation]:
"""Generate AI-powered reorder recommendations"""
def create_purchase_order(self, items: List[Dict]) -> PurchaseOrder:
"""Generate purchase order for recommended items"""class PredictionEngine:
def predict_demand(self, product_id: str, days: int) -> Prediction:
"""Predict demand for specific product"""
def calculate_reorder_point(self, product_data: Dict) -> float:
"""Calculate optimal reorder point"""
def analyze_trends(self) -> TrendAnalysis:
"""Analyze inventory and usage trends"""class NotificationService:
def send_alert(self, alert: Alert, recipients: List[str]):
"""Send alert notification"""
def schedule_daily_report(self):
"""Schedule and send daily inventory report"""
def notify_supplier(self, purchase_order: PurchaseOrder):
"""Notify supplier about new order"""# app.py - Streamlit app with API endpoints
@app.route('/api/inventory', methods=['GET'])
def get_inventory():
"""Get current inventory status"""
@app.route('/api/recommendations', methods=['POST'])
def get_recommendations():
"""Get AI-generated reorder recommendations"""
@app.route('/api/orders', methods=['POST'])
def create_order():
"""Create purchase order from recommendations"""Automated-Re-Order-Concierge/
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── Dockerfile # Docker configuration
├── docker-compose.yml # Docker Compose setup
├── .env.example # Environment variables template
├── README.md # Project documentation
├── config/ # Configuration files
│ ├── __init__.py
│ ├── settings.py # Application settings
│ ├── constants.py # Business constants
│ └── rules.py # Business rules configuration
├── core/ # Core business logic
│ ├── __init__.py
│ ├── inventory.py # Inventory management
│ ├── predictions.py # AI prediction engine
│ ├── orders.py # Order management
│ └── notifications.py # Notification system
├── data/ # Data handling
│ ├── __init__.py
│ ├── models.py # Data models
│ ├── processors.py # Data processors
│ ├── validators.py # Data validation
│ └── database.py # Database operations
├── ui/ # User interface components
│ ├── __init__.py
│ ├── dashboard.py # Main dashboard
│ ├── inventory_view.py # Inventory display
│ ├── reports.py # Reporting components
│ └── forms.py # Input forms
├── utils/ # Utility functions
│ ├── __init__.py
│ ├── helpers.py # Helper functions
│ ├── exporters.py # Data export utilities
│ └── analytics.py # Analytics utilities
├── tests/ # Test suite
│ ├── __init__.py
│ ├── test_inventory.py # Inventory tests
│ ├── test_predictions.py # Prediction tests
│ ├── test_orders.py # Order tests
│ └── test_integration.py # Integration tests
├── docs/ # Documentation
│ ├── api.md # API documentation
│ ├── user_guide.md # User guide
│ ├── deployment.md # Deployment guide
│ └── screenshots/ # Application screenshots
└── assets/ # Static assets
├── images/ # Image assets
├── styles/ # CSS styles
└── templates/ # Email/notification templates
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch
git checkout -b feature/your-feature-name- Make your changes
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
pytest tests/
# Check code style
black . --check
flake8 .- Commit your changes
git add .
git commit -m "Add: Description of your feature"- Push and create pull request
git push origin feature/your-feature-name- Follow PEP 8 style guide
- Write comprehensive docstrings
- Include type hints
- Add tests for new features
- Update documentation
# Run all tests
pytest
# Run with coverage
pytest --cov=core --cov=utils tests/
# Run specific test file
pytest tests/test_inventory.py -vThis project is licensed under the MIT License - see the LICENSE file for details.
- 📧 Email: Zenoomalik@gmail.com
- 🐛 Issues: (https://github.com/znblrean/Automated-Re-Order-Concierge/issues)
- 💬 Discussions: (https://github.com/znblrean/Automated-Re-Order-Concierge/discussions)
- 📚 Documentation: Wiki
- Streamlit for the amazing web framework
- OpenAI for AI capabilities
- Pandas for data manipulation
- Contributors and users of this project
- Multi-warehouse support
- Integration with popular e-commerce platforms
- Mobile app version
- Advanced predictive analytics
- Supplier portal integration
- API for third-party integrations
- Check GitHub Issues for current issues and planned fixes.
⭐ If you find this project useful, please consider giving it a star on GitHub!