Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available: 6.26.0
metadata
title: AI Database Query Assistant
emoji: π€
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 4.0.0
app_file: server.py
pinned: false
Warning: This project may not work due to Hugging Face restrictions. Please check out the GitHub repo for the latest updates.
π€ AI Database Query Assistant
A powerful AI-powered database query assistant that allows you to interact with your MySQL database using natural language.
π·οΈ Tags
- agent-demo-track
β¨ Features
Database Connection
- Secure MySQL database connection with support for:
- Custom host and port configuration
- Username and password authentication
- Special character support in passwords
- Default port (3306) handling
- Connection status monitoring
AI-Powered Query Processing
- Natural language to SQL conversion using Google's Gemini model
- Intelligent query validation and error handling
- Automatic query correction and optimization
- Support for complex SQL operations including:
- Joins
- Aggregations
- Subqueries
- Complex functions
Database Analysis
- Comprehensive database structure analysis
- Table schema visualization
- Column information display
- Primary and foreign key relationship mapping
- Row count statistics
Query Features
- Natural language question processing
- SQL query generation and execution
- Query performance metrics:
- Execution time tracking
- Row count statistics
- Query complexity analysis
- Performance insights
Query History
- Track and store query history
- View past queries with:
- Timestamp
- Original question
- Generated SQL
- Execution metrics
- Complexity level
- Reuse previous queries
- Clear history functionality
Security Features
- Secure password handling
- SQL injection prevention
- Query validation
- API key management:
- Environment variable support
- User-provided key option
- Secure key storage
User Interface
- Modern Gradio-based interface
- Tabbed navigation
- Real-time status updates
- Interactive query input
- Formatted result display
- Example questions for guidance
Performance Monitoring
- Query execution time tracking
- Complexity analysis
- Performance insights
- Resource usage optimization
Error Handling
- Comprehensive error detection
- User-friendly error messages
- Automatic query correction
- Detailed error reporting
π Getting Started
- Install the required dependencies
- Set up your Google API key (for Gemini model)
- Configure your MySQL database connection
- Launch the application
- Start querying your database using natural language!
π§ Requirements
- Python 3.x
- MySQL database
- Google API key for Gemini model
- Required Python packages (see requirements.txt)
π License
This project is licensed under the MIT License - see the LICENSE file for details.