This project demonstrates an innovative approach to inventory management leveraging Generative AI. It integrates a Streamlit web application, a SQLite database, and Google's Gemini Pro AI model for an intuitive, AI-powered inventory management interface.
- Natural Language Queries: Ask questions about your inventory using plain English.
- AI-Powered SQL Generation: Converts natural language queries into SQL using Google's Gemini Pro.
- Interactive Dashboard: Visualizes inventory data with dynamic charts and graphs.
- Inventory Modification: Add, remove, or update products via natural language commands or Excel file uploads.
- Bulk Data Processing: Upload Excel files for batch inventory updates.
- Automated Insights: Generates insights based on sales and trends.
- Stock Prediction: Predicts product demand using AI.
- Report Generation: Creates comprehensive reports based on the database.
- Customizable Plotting: Allows users to generate plots based on their specified parameters, enabling non-technical users to perform basic data analysis.
app.py: The main Streamlit application handling user interface and AI interactions.database.py: Initializes and populates the SQLite database with sample product data.analytics.py: Contains functions for AI-powered inventory analysis (insights, predictions, categorization, reporting).excel_processing.py: Handles processing of uploaded Excel files for database updates.config.py: Loads environment variables and configures API keys.prompt.py: (Assumed file - not present in provided code) Contains functions related to prompt engineering for the AI models.utils.py: (Assumed file - not present in provided code) Contains utility functions used throughout the application.
-
Clone the repository:
git clone <repository_url> cd inventory-management-using-GenAI
-
Install dependencies:
python3.11 -m venv .venv source .venv/bin/activate pip install .
The dependency set is verified on Python 3.11 and is managed through
pyproject.toml.sqlite3is included with Python's standard library and does not need to be installed separately.Developers/contributors: use
pip install -e ".[dev]"instead to get an editable install withpytest,ruff, andpip-audit. -
Set up API keys:
- Create a
.envfile in the project root. - Add your Google Cloud API key:
GOOGLE_API_KEY=your_api_key_here - Obtain a PandasAI API key from www.pandabi.com and add it:
PANDASAI_API_KEY=your_api_key_here - If either key is missing, the app will still start and show a warning, but the related AI features will remain unavailable until configured.
- Create a
-
Initialize the database:
python database.py
-
Run the Streamlit app:
streamlit run app.py
The application provides these main functionalities:
- Ask Questions: Input natural language queries to retrieve inventory information.
- View Dashboard: Access interactive dashboards displaying key inventory metrics.
- Modify Inventory: Add, remove, or modify products using natural language or Excel file uploads.
- Generate Insights/Predictions/Reports: Utilize AI-powered functions to gain deeper insights into your inventory.
- Plot Parameters: Create custom plots to visualize your data.
- streamlit
- pandas
- python-dotenv
- google-generativeai
- pandasai
- plotly
- faker
sqlite3 is included with Python's standard library and does not need to be installed with pip.
Contributions are welcome! Follow these steps:
- Fork the repository.
- Create a new branch for your feature.
- Commit your changes.
- Push to the branch.
- Create a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.