An intelligent inventory and stock management system built with Flask and SQL, featuring an integrated Gemini-powered chatbot to query and interact with the database using natural language.
StockBot shifts away from traditional, rigid inventory systems by combining a robust relational database backend with Generative AI. Users can perform standard CRUD operations through the system or simply ask the AI chatbot to query stock levels, check product availability, or retrieve inventory summaries using plain text.
- Automated Stock Tracking: Full CRUD functionalities to add, update, view, and delete inventory items efficiently.
- Relational Database: Structured SQL database handling data integrity, stock constraints, and real-time updates.
- Gemini AI Integration: A functional LLM chatbot contextually aware of the current stock status, enabling intelligent natural language processing (NLP) queries over the inventory.
- Lightweight Backend: Built on top of Flask for quick routing, clean API endpoints, and seamless frontend-backend communication.
- Backend: Python, Flask
- Database: SQL
- AI/LLM: Google Gemini API
- Frontend: HTML5, CSS3, JavaScript
- Clone the repository:
git clone [https://github.com/sauriopqno/StockBot.git](https://github.com/sauriopqno/StockBot.git)
cd StockBot
- Create and activate a virtual environment:
python -m venv venv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
- Install the dependencies:
pip install -r requirements.txt
- Set up your environment variables: Create a .env file in the root directory and add your credentials:
FLASK_APP=app.py
FLASK_ENV=development
GEMINI_API_KEY=your_gemini_api_key_here
DATABASE_URL=your_sql_database_connection_string
- Initialize the database and run the server:
flask run
Open http://127.0.0.1:5000 in your browser.
The system works by parsing the user's natural language input through the chat interface. The backend fetches the current relevant context from the SQL database, formats it dynamically, and passes it securely to the Gemini model. This ensures the chatbot's responses are accurate, current, and grounded in the actual state of the inventory.
Distributed under the MIT License. See LICENSE for more information.


