QueryCraft is a powerful Streamlit-based data exploration and visualization tool that leverages LLMs (Large Language Models) including Azure OpenAI and Google Gemini to help users generate, validate, and analyze SQL queries on SQLite and PostgreSQL databases. It provides interactive charts, advanced statistics, and data quality assessments, all in a modern, user-friendly interface.
- LLM-powered SQL generation: Generate and validate SQL queries using AI (Azure OpenAI & Gemini integration).
- Supports SQLite and PostgreSQL: Connect, explore, and query your databases.
- Interactive data visualization: Create bar charts, line charts, scatter plots, histograms, pie charts, and more.
- Advanced analysis: Perform statistical analysis, outlier detection, time series decomposition, and feature relationships.
- Data quality assessment: Check for missing values, duplicates, consistency issues, and anomalies.
- Query history: Save, search, and re-run previous queries.
- Export results: Download query results as CSV, Excel, or JSON.
- Clone the repository:
git clone https://github.com/zvoicu000/QueryCraft.git cd QueryCraft - (Recommended) Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate - Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile in the project root and add your API keys and model deployment names for Azure OpenAI and Gemini. Example:# Azure OpenAI Configuration LLM_PROVIDER=AZURE OPENAI_ENDPOINT="https://<your-endpoint>.openai.azure.com" OPENAI_API_VERSION="2024-08-01-preview" OPENAI_API_KEY="<your-azure-openai-api-key>" MODEL_NAME="<your-azure-openai-deployment-name>" # Gemini Configuration LLM_PROVIDER=GEMINI GEMINI_API_KEY="<your-gemini-api-key>"
-
Launch the app:
streamlit run app/QueryCraft.py
- Upload a SQLite database or connect to a PostgreSQL database.
- Select tables and enter your query or let the LLM generate one for you.
- Explore results, visualize data, and export findings.
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
For questions or support, open an issue or contact zvoicu000.