The Merchant Agent is an intelligent, AI-powered system designed to assist merchants in optimizing their business operations through advanced demand forecasting and product management. Leveraging machine learning, this project analyzes historical sales data to predict future demand, helping businesses make informed decisions regarding inventory, pricing, and overall strategy.
It features a robust client-server architecture for scalable operations, a data simulation module for testing and scenario analysis, and an interactive web application built with Streamlit for intuitive visualization of insights and user interaction.
- AI-Powered Demand Forecasting: Utilizes machine learning models to predict future product demand based on historical sales data.
- Product Management Optimization: Assists in managing product inventory and mapping for efficient operations.
- Client-Server Architecture: Provides a scalable and modular foundation for handling data and model serving.
- Data Simulation: Generates synthetic sales data for model training, testing, and scenario analysis.
- Interactive Web UI (Streamlit): A user-friendly interface for visualizing forecasts, managing products, and interacting with the system.
- Model Training Pipeline: Includes scripts for training and persisting demand forecasting models.
- Python
- Scikit-learn (or similar ML library for demand_model.pkl)
- Streamlit
- Flask (likely for server.py)
- Pandas, NumPy (for data handling)
- Docker (for development container)
- Python 3.8+
- Docker (recommended for consistent development environment)
If you have Docker installed and the VS Code "Dev Containers" extension:
- Clone the repository:
git clone https://github.com/MohammadNoman/Merchant-Agent.git cd Merchant-Agent - Open the project in VS Code.
- When prompted, click "Reopen in Container" to launch a pre-configured development environment. All dependencies will be automatically installed.
- Clone the repository:
git clone https://github.com/MohammadNoman/Merchant-Agent.git cd Merchant-Agent - Create and activate a virtual environment:
python -m venv .venv # On Windows .venv\Scripts\activate # On macOS/Linux source .venv/bin/activate
- Install the required dependencies:
pip install -r requirements.txt
First, train the machine learning model using your historical sales data.
python train_model.pyThis will generate demand_model.pkl and product_map.pkl.
You can simulate additional data if needed for testing or extending your dataset.
python data_sim.pyStart the backend server, which might serve the model or handle client requests.
python server.pyAccess the interactive UI to visualize forecasts and interact with the system.
streamlit run streamlit_app.pyOpen your web browser and navigate to the URL provided by Streamlit (usually http://localhost:8501).
If there's a separate client application, you can run it as follows:
python client.py.
├── client.py # Client-side application logic
├── data_sim.py # Script for simulating sales data
├── demand_model.pkl # Trained demand forecasting model
├── product_map.pkl # Mapping for product information
├── requirements.txt # Python dependencies
├── sales_history.csv # Historical sales data
├── server.py # Backend server for model serving/API
├── streamlit_app.py # Interactive Streamlit web application
├── train_model.py # Script for training the ML model
├── .devcontainer/ # Development Container configuration
│ └── devcontainer.json
└── .gitignore # Specifies intentionally untracked files to ignore
Mohammad Noman
This project is open-sourced under the MIT License. (Assuming MIT, can be changed if user specifies)