Welcome to SQL Chat! This is an interactive chat application that allows you to connect to your MySQL database and ask questions in natural language. It leverages the power of LangChain, ChatGroq, and Streamlit to provide a seamless conversational experience.
- Connect to a MySQL database using user-provided connection details.
- Chat with your MySQL database using natural language queries.
- Leverage LangChain's capabilities to generate SQL queries based on user questions.
- Convert SQL responses into natural language for easy understanding.
- Persistent conversation history throughout the chat session.
-
Clone the repository:
git clone https://github.com/bhanmrinal/AI-SQL-ChatBot.git
-
Navigate to the project directory:
cd SQL-Chat -
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate # For macOS/Linux # OR venv\Scripts\activate.bat # For Windows
-
Install the required dependencies:
pip install -r requirements.txt
-
Create a
.envfile in the root directory with your Groq Free API:GROQ_API_KEY = "groq api key"
The project requires configuration for MySQL connection, by manually entering the connection details in the sidebar within the app.
-
Launch the application:
streamlit run app.py
-
Connect to your MySQL database using the sidebar in the app.
-
Start asking questions about your database in natural language using the chat input box.
-
The application will provide SQL queries and natural language responses to your questions.
-
Develope a query optimization system using machine learning to suggest more efficient SQL queries.
-
Incorporate an AI-driven data visualization component to automatically generate relevant charts based on query results.
-
Fine-Tune Mistral 7b for Text-to-SQL