NL2SQL-Converter is a versatile tool that converts natural language sentences from any language into SQL queries, allowing users to query their databases effortlessly. Simply enter your question in your preferred language, and NL2SQL-Converter will generate the corresponding SQL query to fetch the data you need. This tool simplifies database interactions, making data retrieval accessible to everyone, regardless of SQL proficiency or language preference.
Currently, NL2SQL-Converter supports PostgreSQL as the database and utilizes Anthropic's Large Language Model for natural language processing. This combination ensures robust and accurate query generation for diverse and complex database interactions.
- Multi-Language Support: Convert natural language sentences from any language into SQL queries.
- Effortless Query Generation: Simply enter your question in plain language, and get the corresponding SQL query.
- PostgreSQL Integration: Seamlessly interact with PostgreSQL databases for data retrieval and management.
- Powered by Anthropic: Utilizes Anthropic's advanced Large Language Model for precise natural language processing.
- Robust Performance: Handles diverse and complex queries efficiently, ensuring reliable database operations.
To run the project, follow these steps:
- Clone the repository:
git clone https://github.com/samitugal/NL2SQL-Converter.git
- Navigate to the project directory::
cd NL2SQL-Converter
- Start the application and build the necessary components using Docker Compose::
docker-compose up --build
In the configs/DatabaseConfigs directory, you can choose from various database types and enter your database information according to your preferences. Ensure that the following environment variables are set in the .env file:
- DATABASE_CONNECTION_PATH
- LLM_CONFIG_PATH
The application runs on port 8000. To send a request, make a POST request to the /generate_response API endpoint. The request should include a parameter called request where users can write their desired query.
curl -X POST http://localhost:8000/generate_response -d '{"request": "Show me all records from the users table"}' -H "Content-Type: application/json"
A sample Northwind database is available within the PostgreSQL container. You can use this for testing your queries.
The UI is still under development. If you would like to contribute, your support is welcome.