MQL (My Query Language) Project Overview
MQL, or My Query Language, is a remarkable tool designed to convert natural language queries directly into SQL queries. This capability is impressive because it allows individuals without any coding skills to interact with databases. Users connect their databases by either linking or uploading their schemas to MQL, then simply enter queries in their preferred language to receive the translated SQL queries.
🚀 Getting Started
For those eager to experience MQL, starting is quite straightforward. The tool can be set up locally using Docker with the following steps:
- Install Docker: Ensure Docker is installed on your machine.
- Clone the Repository: Use the command below to clone the MQL GitHub repository:
git clone https://github.com/shurutech/mql
- Configure Environment:
- Set your
OPENAI_API_KEY
in theserver/Dockerfile
:ENV OPENAI_API_KEY YOUR_TOKEN_HERE
- Update the
DATABASE_URL
in theserver/.env
file, using 'postgres' as the hostname if you are running MQL with Docker, and 'localhost' if not.
- Set your
- Install MQL:
- Navigate to the repository folder and execute:
make install
- Navigate to the repository folder and execute:
Upon completion, the MQL dashboard is accessible at http://localhost:3000.
- To apply any local changes, restart using:
make restart
- To shut down the local setup, use:
make down
- To start all containers, run:
make up
Testing and User Access
For testing purposes, a default user is available with the following credentials:
- Email: [email protected]
- Password: admin
Note: To transition MQL into a live environment, the default user should be removed and a new user created. Detailed steps for these actions are provided to ensure a secure deployment.
Supported Databases
Currently, MQL is specifically tailored to work with PostgreSQL databases.
Non-Docker Setup
If Docker is not preferred, MQL can also be set up manually. Ensure the installation of necessary packages such as Python, psycopg2, Node, PostgreSQL 15, and pgvector extension. Follow the detailed setup process including the creation of roles, databases, vector extensions, and environment configuration.
Accuracy and Future Enhancements
MQL demonstrates a commendable approximate 85% success rate when tested with 50 natural language queries, effectively translating 43 out of 50 queries.
Future improvements and features include:
- Enhanced execution of queries.
- Improved database connectivity and query results.
- Support for MySQL databases.
- Increased query accuracy.
- Natural language response displays and data visualization.
- Integration with applications like Slack for query results.
Contributing to MQL
MQL thrives on community engagement and contributions. Developers are encouraged to report bugs, suggest enhancements, and contribute code. Clear guidelines are in place to facilitate smooth collaboration, ensuring that all contributions align with the project's goals and standards.
Code of Conduct
The MQL project is committed to maintaining a respectful and collaborative environment for all participants. Adherence to the project's Code of Conduct is expected, promoting a positive and supportive community.
By joining the MQL project, contributors have the opportunity to enhance this innovative tool, enabling even more users to seamlessly query their databases using natural language.