Skip to content

KaiserGrid/DataQuery_AI

Repository files navigation

DataQuery AI

A privacy-first, cross-platform desktop application for analyzing local CSV/XLSX files using natural language queries.

Features

  • Privacy-First: All data processing happens locally on your machine
  • Natural Language Queries: Ask questions about your data in plain English
  • AI-Powered Schema Inference: Automatically understands your data structure
  • Cross-Platform: Works on Windows, macOS, and Linux
  • Local Processing: No data ever leaves your computer

Architecture

  • Backend: Python with FastAPI, DuckDB, and local AI models
  • Frontend: Electron + React for cross-platform desktop experience
  • AI Engine: Local DistilBERT and NL2SQL models via ONNX Runtime

Quick Start

Prerequisites

  • Python 3.10 or higher
  • Node.js 18 or higher
  • npm or yarn package manager

Development Setup

  1. Clone and setup backend:
cd backend
pip install -e .
python main.py
  1. Setup frontend (in a new terminal):
cd frontend
npm install
npm run electron:dev

The application will start with the backend running on port 8000 and the Electron app launching automatically.

Building for Distribution

Step 1: Build Backend Executable

cd backend
pip install pyinstaller
python build.py

This creates a standalone executable in backend/dist/.

Step 2: Build Electron Application

cd frontend
npm install
npm run build
npm run electron:build

This creates platform-specific installers in frontend/dist/.

Complete Build Process

For a complete build of both components:

# Build backend
cd backend
python build.py

# Build frontend with backend included
cd ../frontend
npm run dist

Project Structure

dataquery-ai/
├── backend/                 # Python FastAPI backend
│   ├── main.py             # FastAPI application
│   ├── data_manager.py     # Data processing with DuckDB
│   ├── ai_engine.py        # AI-powered NL2SQL engine
│   ├── build.py            # Build automation
│   └── pyproject.toml      # Python dependencies
├── frontend/               # Electron + React frontend
│   ├── src/                # React application source
│   ├── electron/           # Electron main process
│   ├── package.json        # Node.js dependencies
│   └── vite.config.js      # Vite configuration
└── README.md              # This file

Usage

  1. Launch the application
  2. Complete the onboarding flow - system checks and privacy settings
  3. Upload your data - drag & drop CSV or Excel files
  4. Review the schema - AI-inferred data types and structure
  5. Query your data - ask questions in natural language

Example Queries

  • "Show all data"
  • "What is the average sales amount?"
  • "Count the number of customers by region"
  • "Show the top 10 products by revenue"

Development

Backend Development

cd backend
pip install -e .
python main.py

API documentation available at http://127.0.0.1:8000/docs

Frontend Development

cd frontend
npm run dev          # Start Vite dev server
npm run electron     # Start Electron (in another terminal)

Testing

# Backend tests
cd backend
pytest

# Frontend tests
cd frontend
npm test

Deployment

Windows

  • Creates NSIS installer (.exe)
  • Includes auto-updater support

macOS

  • Creates DMG package (.dmg)
  • Code signing supported

Linux

  • Creates AppImage (.AppImage)
  • Portable, no installation required

Privacy & Security

  • Local Processing: All data analysis happens on your machine
  • No External Calls: AI models run locally, no cloud dependencies
  • Session Isolation: Each analysis session is completely isolated
  • Automatic Cleanup: Temporary files are automatically removed
  • No Telemetry: Optional anonymous usage statistics only

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Troubleshooting

Common Issues

Backend won't start:

  • Check Python version (3.10+ required)
  • Install dependencies: pip install -e .
  • Check port 8000 is available

Frontend build fails:

  • Update Node.js to version 18+
  • Clear node_modules: rm -rf node_modules && npm install
  • Check Electron version compatibility

Large executable size:

  • This is normal for bundled Python applications
  • Backend executable includes Python runtime and all dependencies
  • Typical size: 150-300MB depending on platform

Getting Help

  • Check the Issues page
  • Review the backend and frontend README files
  • Enable debug logging in development mode

License

MIT License - see LICENSE file for details.

Acknowledgments

  • Built with FastAPI, DuckDB, React, and Electron
  • AI capabilities powered by Hugging Face Transformers
  • UI components inspired by modern design systems

About

a cross-platform system enabling users to upload spreadsheet files, which are parsed and converted into DuckDB tables. A distilled SLM (DistilBERT/Gemma2) automates schema inference, multi-table relation mapping, and NL2SQL conversation for dynamic, user-driven analysis—all performed offline/locally on the device for maximum privacy.

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors