Skip to content

omkarjavali/Chat_with_Database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Chat with Your MySQL Database Like a Pro! πŸ—‚οΈπŸ’¬

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!

Overview

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.

✨ Features

πŸ”₯ 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.

πŸ“₯ Installation & Setup

πŸš€ Prerequisites

βœ” Python 3.8+ installed
βœ” MySQL Database with connection credentials
βœ” Mistral API Key for AI-powered magic

βš™οΈ Setup Instructions

1️⃣ Clone this repo

git clone https://github.com/omkarjavali/Chat_with_Database.git
cd Chat_with_Database

2️⃣ Install dependencies

pip install -r requirements.txt

3️⃣ Run the app! πŸš€

python -m streamlit run app.py

πŸ› οΈ How It Works

1️⃣ Connect to your MySQL database πŸ”—

2️⃣ Enter your Mistral API key πŸ”‘

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! πŸ“Š

πŸ§ͺ Live Demo

πŸ‘‰ https://chatwithdatabase-1.streamlit.app/

πŸ’‘ Why Use This?

βœ… 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.

πŸ† Tech Stack

  • 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

πŸ“œ License

This project is licensed under the MIT License.

πŸš€ Ready to supercharge your database queries? Give it a try now! πŸ”₯

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages