This project is an AI-powered Retrieval-Augmented Generation (RAG) application that enables users to generate SQL queries from natural language input. The application simplifies database interaction by eliminating the need for writing manual SQL queries. Users can provide the necessary database credentials, and the AI handles the rest.
- Natural Language to SQL: Generate SQL queries using natural language, no SQL knowledge required.
- Seamless Database Connection: Simply input your database credentials to connect and start querying.
- Real-time Query Generation: Get SQL queries in real-time for efficient data retrieval and manipulation.
- User-Friendly Interface: Built with React.js for an intuitive, responsive frontend.
- Secure and Reliable: Only the necessary credentials are required to securely connect to the database.
- Backend: Flask
- Frontend: React.js
- Natural Language Processing: Langchain
- AI Models: Gemini Pro
- Database: SQLite
-
Clone the repository:
git clone https://github.com/IkkiOcesn/SQL-AI.git
-
Navigate to the project directory:
cd SQL-AI
-
Backend Setup:
- Navigate to the backend directory:
cd backend
- Create a virtual environment:
python3 -m venv venv source venv/bin/activate # for Linux/macOS venv\Scripts\activate # for Windows
- Install the required Python dependencies:
pip install -r requirements.txt
- Navigate to the backend directory:
-
Frontend Setup:
- Navigate to the frontend directory:
cd frontend
- Install the necessary dependencies:
npm install
- Navigate to the frontend directory:
-
Start the Backend:
cd backend python run.py
-
Start the Frontend:
cd frontend npm start
-
Access the Application:
- Once both backend and frontend are running, open your browser and navigate to:
http://localhost:3000
- Once both backend and frontend are running, open your browser and navigate to:
-
Provide Database Credentials:
- Input the necessary credentials for your database (e.g., SQLite connection) and start generating SQL queries using natural language.
- Input: "Show me all the orders from customers in California"
Feel free to submit issues or pull requests. All contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.