- Notifications
You must be signed in to change notification settings - Fork5
Transform natural language into SQL queries using Azure OpenAI. Visualize database results with interactive charts and explore data effortlessly.
License
NotificationsYou must be signed in to change notification settings
lohitkolluri/NLP2SQL
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Turn your words into SQL magic
Visualize your data dynamically
Multi-database support
🎯 Core Features
- Natural Language to SQL 🗣️ → 📝
- Convert text queries into SQL commands usingAzure OpenAI orGemini models
- Intelligent query interpretation with detailed decision logs
- Step-by-step reasoning for query generation
- Multimodal Interaction 🎥
- Process both textual and visual inputs for richer query context
- Combine image data with text to enhance query generation
- Multi-Database Support 🗄️
- SQLite compatibility with file upload
- PostgreSQL integration with secure connection
- Dynamic schema exploration
- Interactive Data Explorer 🔍
- Real-time data filtering and exploration
- Comprehensive query results with summary statistics
- Advanced table views with sorting and filtering
📊 Visualization & Analytics
- Dynamic Visualizations 📈
- Multiple chart types (Bar, Line, Scatter, Area, Histogram)
- Interactive chart configuration
- AI-powered visualization recommendations
- Summary Statistics 📋
- Detailed numeric analysis
- Categorical data insights
- Distribution analysis
- Statistical measures (mean, median, mode, skewness, kurtosis)
🛡️ Security & Management
- Safe SQL Execution 🔒
- Strict query validation
- SQL injection prevention
- Comprehensive error handling and feedback
- Query History 📚
- Searchable query log
- Query reusability
- Multiple export formats (CSV, Excel, JSON)
graph LR A[User Input] --> B[LLM Processing] B --> C[SQL Generator] C --> D[Database] D --> E[Results] E --> F[Visualization]1️⃣Clone the Repository
git clone https://github.com/lohitkolluri/NLP2SQLL.gitcd NLP2SQL2️⃣Set Up Environment
# Create .env filecat<<EOF > .env### 2a: Azure ConfigurationLLM_PROVIDER=AZUREOPENAI_ENDPOINT="https://[ENDPOINT_NAME].openai.azure.com"OPENAI_API_VERSION="2024-08-01-preview"OPENAI_API_KEY="YOUR AZURE OPENAI API KEY"MODEL_NAME="YOUR AZURE OPENAI MODEL NAME"### 2b: Gemini ConfigurationLLM_PROVIDER=GEMINIGEMINI_API_KEY="YOUR GEMINI API KEY"EOF
3️⃣Install Dependencies
pip install -r requirements.txt
4️⃣Launch the App
streamlit run app/NLP2SQL.py
mindmap root((NLP2SQL)) Query Processing Natural Language Input Decision Logging Detailed Reasoning Visualization Interactive Charts Summary Statistics Data Distribution Database PostgreSQL SQLite Schema Analysis Security Query Validation Error Handling Safe Execution- Query Input ➡️ User enters natural language query
- Processing ➡️ Azure OpenAI analyzes and generates SQL with reasoning
- Validation ➡️ Query is validated for safety and correctness
- Execution ➡️ Query runs against selected database
- Analysis ➡️ Results are processed with summary statistics
- Visualization ➡️ Data is presented with AI-recommended charts
- Export ➡️ Results can be downloaded in multiple formats
- Bar Chart: Comparing categorical data
- Line Chart: Time-series and trend analysis
- Scatter Plot: Relationship between variables
- Area Chart: Cumulative totals and trends
- Histogram: Distribution analysis
- Strict SQL query validation
- Prevention of harmful SQL operations
- Secure database connections
- Protected sensitive information
- Input sanitization
- Comprehensive summary statistics
- Distribution analysis
- Correlation detection
- Trend identification
- Outlier detection
License ©Lohit Kolluri
About
Transform natural language into SQL queries using Azure OpenAI. Visualize database results with interactive charts and explore data effortlessly.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.