This project implements an end-to-end Language Model (LLM) system that can interact with a MySQL database. Users can ask questions in natural language, and the system generates answers by converting these questions into SQL queries and executing them on the MySQL database.
The system is designed to handle queries related to retail inventory, sales, and discount data stored in a MySQL database. It can answer questions such as:
genai_retail_industry_project
┣ database
┃ ┗ create_db.sql
┣ exp
┃ ┗ testing.ipynb
┣ src
┃ ┣ __pycache__
┃ ┃ ┣ __init__.cpython-310.pyc
┃ ┃ ┣ langchain_sql.cpython-310.pyc
┃ ┃ ┗ utils.cpython-310.pyc
┃ ┣ __init__.py
┃ ┣ langchain_sql.py
┃ ┗ utils.py
┣ README.md
┣ app.py
┗ requirements.txt
Clone this repository to your local machine:
git clone https://github.com/yourusername/genai_retail_industry_project.git
Navigate to the project directory:
cd genai_retail_industry_project
Install the required dependencies:
pip install -r requirements.txt
Create a .env
file in the root directory and add your Google API key:
GOOGLE_API_KEY="your_api_key_here"
Run the Streamlit app:
streamlit run app.py
The web app will open in your browser where you can ask questions about the retail data.
This project is licensed under the MIT License.
This project was developed as a learning exercise in applying large language models (LLM) in the Retail industry specifically interacting with SQL databases. Special thanks to the open-source community for providing the tools and libraries that made it possible.