This project is a Streamlit application that allows users to interact with a SQL database using natural language queries. It leverages the power of the Langchain library and the Groq API to process and respond to user queries.
- Connect to either a local SQLite database or a MySQL database.
- Use natural language to query the database.
- Interactive chat interface powered by Streamlit.
- Supports both local and remote database configurations.
- Python 3.7 or higher
- Streamlit
- Langchain
- SQLAlchemy
- PyMySQL (for MySQL support)
-
Clone the repository:
git clone https://github.com/yourusername/your-repo-name.git cd your-repo-name -
Install the required packages:
pip install -r requirements.txt
-
Set up your database:
- For a local SQLite database, ensure
my_database.dbis in the project directory. - For a MySQL database, ensure you have the necessary credentials and access.
- For a local SQLite database, ensure
- Update the
LOCAL_DB_PATHandMYSQL_DB_PATHinapp.pywith your database paths. - Enter your Groq API key in the sidebar when running the application.
-
Run the Streamlit application:
streamlit run chat_Sql/app.py
-
Select the database type from the sidebar.
-
Enter the necessary credentials for MySQL if selected.
-
Start chatting with the database using the chat interface.
Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.
