Skip to content

abhinavyy/QueryX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QueryX: AI-Powered Text-to-SQL Conversion

QueryX is an AI-based tool that allows users to interact with CSV datasets using natural language queries. Built with Gemini 1.5 Pro, Streamlit, and SQLite, it translates plain English into executable SQL queries and displays accurate results—perfect for non-technical users or data analysts.


🚀 Features

  • 🧠 Natural Language to SQL Translate user input into SQL using Gemini 1.5 Pro's LLM capabilities.

  • 📊 CSV Dataset Support Upload and query your own CSV files directly from the UI.

  • 🛠️ Regex-Based Query Cleaning Preprocess natural language queries for improved SQL accuracy.

  • 🔄 Error Handling Robust handling of SQL errors and malformed queries.

  • 🧾 Lightweight Backend SQLite database engine for seamless integration and quick data operations.


📸 Demo

Screenshot 2025-07-29 212058 Screenshot 2025-07-29 212125

🧰 Tech Stack

  • Frontend: Streamlit
  • AI Model: Gemini 1.5 Pro (via API)
  • Database: SQLite
  • Backend: Python
  • Others: Pandas, Regex, Prompt Engineering

🔧 How to Run

# 1. Clone the repository
git clone https://github.com/abhinavyy/QueryX.git


# 2. Install dependencies
pip install -r requirements.txt

# 3. Run the app
streamlit run app.py

🔑 Ensure you have API access to Gemini 1.5 Pro and set the key in a .env file.


📁 Folder Structure

queryx-ai/
│
├── app.py               # Streamlit app
├── data/                # Uploaded CSVs
├── .env                 # API key (not tracked)
└── README.md

✨ Future Scope

  • Voice-to-query support
  • Integration with PostgreSQL and MySQL
  • Result visualizations (bar chart, pie chart, etc.)
  • Multi-table joins

About

QueryX is a Text-to-SQL Streamlit app that converts natural language questions into SQL queries using Google Gemini and instantly runs them on your uploaded CSV data. It allows users to analyze data without writing SQL, featuring secure API key handling and a clean interface for quick insights.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages