Welcome to the Streamlit Database Querying Tool, a powerful AI-driven application that allows you to interact with your database using natural language! Built with Python and Streamlit, this tool leverages the Mistral AI model to generate SQL queries, display results in tables, and visualize data with interactive Bar and Pie charts.
π Ask a question β Get SQL β See instant results!
This project enables users to upload SQLite databases or run the app locally with MySQL support. Ask questions in plain English (e.g., "Whatβs the total spending by customer?"), and the app will handle the restβgenerating SQL, showing tables, and creating visualizations.
π₯ AI-Powered Querying β Just type your question, and our AI will generate SQL for you!
β‘ Real-Time Data Retrieval β Connect to your MySQL database and get live insights!
π¨ Sleek & Modern UI β Enjoy a beautifully designed dark-themed interface.
π§ Context-Aware Conversations β Chat history keeps track of your queries for smarter responses.
π Interactive Visualizations - Supports Bar and Pie charts to explore your data.
π Flexible Database Support:
- Online Use: Upload SQLite files directly.
- Local MySQL: Fork and run locally for MySQL connectivity.
β Python 3.8+ installed
β MySQL Database with connection credentials
β Mistral API Key for AI-powered magic
1οΈβ£ Clone this repo
git clone https://github.com/omkarjavali/Chat_with_Database.git
cd Chat_with_Database2οΈβ£ Install dependencies
pip install -r requirements.txt3οΈβ£ Run the app! π
python -m streamlit run app.py1οΈβ£ Connect to your MySQL database π
2οΈβ£ Enter your Mistral API key π
- use the following link to generate your api key: https://console.mistral.ai/api-keys
3οΈβ£ Ask questions like:
- "What are the top 5 customers by total orders?"
- "Show me the monthly sales trends."
- "List all products with low inventory."
4οΈβ£ See the AI-generated SQL & live results! π
π https://chatwithdatabase-1.streamlit.app/
β
No SQL? No Problem! β AI converts natural language into SQL instantly.
β
Save Time & Effort β No more manual query writing.
β
Powerful Analytics β Turn raw data into actionable insights fast.
- Streamlit β Fast, interactive UI
- LangChain β AI-driven SQL generation
- Mistral API β Natural language processing
- MySQL β The powerhouse database
- Python β Because Python rocks! π
- Plotly - For Generating Visualizations
This project is licensed under the MIT License.
π Ready to supercharge your database queries? Give it a try now! π₯