Skip to content

QueryGenie : An advanced tool which converts Natural Language Prompts to SQL queries and manages the usage based on token counts and cost incurred along with detailed analytics.

License

Notifications You must be signed in to change notification settings

arunpranav-at/QueryGenie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QueryGenie

Talk it, query it, done!

QueryGenie is an advanced tool that converts natural language prompts (both text and voice inputs) to SQL queries. It manages the usage based on token counts and cost incurred, along with detailed analytics for each user profile.

YouTube Link - Click here to watch the YouTube video

Executive Challenge - "Chat with your data" token utilization and cost monitoring challenge

Slide 2

Table of Contents

Team

  • RS Kierthana
  • Aruthra S
  • Arun Pranav A T

Slide 1

Features

  • Converts natural language prompts to SQL queries.
  • Supports both text and voice inputs.
  • Tracks token counts and cost incurred.
  • Provides detailed analytics for each user profile.
  • Notifies users when token limit is nearing based on set limits.
  • Allows any form of databases to be linked.
  • Considers history of the chat when required.
  • Click on the title to view this project presentation saved in the format of pdf.

Innovation

  • Provides detailed analytics for each user profile while existing projects concentrates only on natural language prompts to SQL queries.
  • Follows separate notification system while existing projects lack them.
  • History can be deleted supporting responsible AI while existing projects could have missed them.
  • SQL Queries generated are read out loud which supports visually impaired users.
  • Prompts can be given in form of voice too for those who find it difficult to type.

Slide 3 Slide 4

Tools

  • Azure Database for PostgreSQL (Database)
  • Azure OpenAI (AI)
  • Azure App Service (Hosting)
  • Azure Authentication (Authentication)
  • Python (Backend)
  • Next.js (JavaScript - Frontend)
  • Github Copilot
  • Git and Github
  • LangChain

Slide 5

Installation

  1. Clone the repository:

    https://github.com/arunpranav-at/QueryGenie.git
    cd QueryGenie
  2. Install the required dependencies:

    pip install -r backend/requirements.txt
    npm install --prefix frontend
  3. Set up the environment variables:

    Copy the .env file in both backend and frontend directories and fill in the required values.

    cp backend/.mock.env backend/.env
    cp frontend/.mock.env frontend/.env

Configuration

Backend

The backend configuration files are located in the backend/configs directory.

  • llm_config.py: Configuration for the language model.
  • postgres_config.py: Configuration for the PostgreSQL database.

Frontend

The frontend configuration files are located in the root directory of the frontend.

  • next.config.mjs: Next.js configuration.
  • postcss.config.mjs: PostCSS configuration.
  • tailwind.config.js: Tailwind CSS configuration.

Usage

Running the Backend

  1. Navigate to the backend directory:

    cd backend
  2. Start the backend server:

    fastapi run server.py

Running the Frontend

  1. Navigate to the frontend directory:

    cd frontend
  2. Start the frontend server:

    npm run dev

Screenshots

Home Page Analytics Page Home Page Home Page

QueryGenie Project Structure

Root Directory

  • .gitignore
  • LICENSE
  • README.md

Backend Directory

  • .env
  • .gitignore
  • .mock.env
  • requirements.txt
  • server.py

Configs

  • configs/
    • __pycache__/
    • llm_config.py
    • postgres_config.py

Models

  • models/
    • __pycache__/
    • db.py
    • message_store.py
    • sessions.py
    • users.py

Routers

  • routers/
    • AuthRouter/
      • Handlers/
        • LoginHandler.py
        • SignUpHandler.py
        • __init__.py
      • __init__.py
    • BotRouter/
      • Handlers/
        • BotHandler.py
        • FetchHandler.py
        • __init__.py
      • DTconverter.py
      • prompt.py
      • router.py
    • ChartRouter/
      • __init__.py

Documents Directory

  • documents/
    • pictures/
      • QueryGenie/
        • Slide1.PNG
        • Slide2.PNG
        • Slide3.PNG
        • Slide4.PNG
        • Slide5.PNG
        • Slide6.PNG
        • Slide7.PNG
        • Slide8.PNG
        • Slide9.PNG
        • Slide10.PNG
      • analytics.png
      • database.png
      • maindashboard.png
      • userprofile.png
    • QueryGenie - Video.mp4
    • QueryGenie.pdf
    • QueryGenie.pptx

Frontend Directory

  • .env
  • .eslintrc.json
  • .gitignore
  • .mock.env
  • .next/
  • jsconfig.json
  • next.config.mjs
  • package.json
  • postcss.config.mjs
  • public/
  • README.md
  • tailwind.config.js

Frontend Source

  • src/
    • app/
      • chat/
        • [chatId]/
          • page.js
      • components/
        • DatabaseList.js
        • DatabasePopup.js
        • Profile.js
        • Sidebar.js
      • context/
        • ChatContext.js
      • dashboard/
        • page.js
      • fonts/
      • globals.css
      • layout.js
      • page.js
      • userDetails.js

Contributing

We welcome contributions! Please follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature-branch).
  6. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Presentation Slides

Slide 6 Slide 7 Slide 8 Slide 9 Slide 10

About

QueryGenie : An advanced tool which converts Natural Language Prompts to SQL queries and manages the usage based on token counts and cost incurred along with detailed analytics.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •