{"id":25536111,"url":"https://github.com/abhi227070/data-extraction-from-database-using-ai","last_synced_at":"2026-04-11T01:04:58.547Z","repository":{"id":229675234,"uuid":"775281524","full_name":"abhi227070/Data-Extraction-from-Database-using-AI","owner":"abhi227070","description":"QueryGenie.AI is a Generative AI tool to extract data from a database by using simple Natural Language. This tool takes question in the form of natural language and convert that into SQL query then it shows both SQL query and exact answer as output to the user.","archived":false,"fork":false,"pushed_at":"2024-04-27T03:28:24.000Z","size":461,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-27T04:25:36.129Z","etag":null,"topics":["css","database","deep-learning","deep-neural-networks","flask","flask-application","html","javascript","langchain","langchain-python","large-language-models","mysql","natural-language-processing"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abhi227070.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-21T04:57:44.000Z","updated_at":"2024-04-27T04:25:37.152Z","dependencies_parsed_at":null,"dependency_job_id":"b314eff7-b9d3-4edd-b1dd-ced10de62180","html_url":"https://github.com/abhi227070/Data-Extraction-from-Database-using-AI","commit_stats":null,"previous_names":["abhi227070/data-extraction-from-database-using-ai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhi227070%2FData-Extraction-from-Database-using-AI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhi227070%2FData-Extraction-from-Database-using-AI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhi227070%2FData-Extraction-from-Database-using-AI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhi227070%2FData-Extraction-from-Database-using-AI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhi227070","download_url":"https://codeload.github.com/abhi227070/Data-Extraction-from-Database-using-AI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239778879,"owners_count":19695629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","database","deep-learning","deep-neural-networks","flask","flask-application","html","javascript","langchain","langchain-python","large-language-models","mysql","natural-language-processing"],"created_at":"2025-02-20T04:30:11.674Z","updated_at":"2025-10-30T11:55:32.491Z","avatar_url":"https://github.com/abhi227070.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n---\n\n# QueryGenie.AI: Data Extraction from Database using AI\n\nQueryGenie.AI is an AI-powered tool designed to facilitate data extraction from databases using natural language queries. Leveraging state-of-the-art language models and innovative technologies, QueryGenie.AI enables users to effortlessly retrieve desired data from databases without the need for expertise in SQL queries.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Tools Used](#tools-used)\n- [Project Overview](#project-overview)\n- [Use Case](#use-case)\n- [Code](#code)\n- [Screenshots](#screenshots)\n\n## Introduction\n\nIn this project, a large language model (LLM), specifically Google Gemini LLM, is integrated with a database using Langchain, a technology that bridges natural language processing with database querying. The user interface (UI) allows users to input their queries in natural language. The LLM then converts these queries into SQL queries, which are executed to retrieve the relevant data from the database. Both the generated SQL query and the corresponding answer are displayed to the user.\n\n## Tools Used\n\n- Jupyter Notebook\n- Visual Studio Code (VS Code)\n- MySQL\n- Python\n- Langchain\n- Google Gemini LLM\n- Chroma DB vector database\n- Few Shot Learning\n- Prompt Engineering\n- Flask\n- HTML\n- CSS\n- JavaScript\n\n## Project Overview\n\nQueryGenie.AI provides a user-friendly web-based interface for predicting diseases, including diabetes, heart disease, and breast cancer, using machine learning algorithms. The project aims to leverage the power of data-driven insights to assist healthcare professionals in diagnosing and prognosticating various medical conditions.\n\n## Use Case\n\nThe primary use case of QueryGenie.AI is to assist individuals or organizations that rely on databases for storing their data but lack expertise in writing SQL queries. This tool serves as a cost-effective alternative to hiring data analysts, as it empowers users to extract data using simple natural language queries. Whether it's a small retail store, a large online retailer, or any organization managing data, QueryGenie.AI streamlines the process of data retrieval, saving time and resources.\n\n## Code\n\n```python\n# Importing the dependencies \nfrom flask import Flask, render_template, request, jsonify\nfrom backend.langchain_helper import get_langchain_output\n\n# Creating the langchain object \nlangchain_object = get_langchain_output()\n \n# Creating the flask app   \napp = Flask(__name__, template_folder=\"frontend/html\", static_folder=\"frontend/css and js\")\n\n# Rendering the HTML web page on the route '\\'\n@app.route('/')\ndef index():\n    return render_template('index.html')\n\n# Creating route for processing and sending results to javascript\n@app.route('/result', methods=['GET', 'POST'])\ndef predict():\n    \n    data = request.json\n    question = data.get('question')\n    answer = langchain_object.run(question)\n    \n    try:\n        sql_query = answer['intermediate_steps'][1]\n        final_answer = answer['intermediate_steps'][5]\n    except:\n        sql_query = \"Some error occour.\"\n        final_answer = \"Some error occur.\"\n\n    output_data = jsonify({'sql_query': sql_query, 'answer': final_answer})\n    \n    return output_data\n\n# This is the basic syntax to call python code\nif __name__ == '__main__':\n    app.run(debug=True)\n```\n\n## Screenshots\n\n![Screenshot 1](screenshots/screenshot1.png)\n![Screenshot 2](screenshots/screenshot2.png)\n![Screenshot 3](screenshots/screenshot3.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhi227070%2Fdata-extraction-from-database-using-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhi227070%2Fdata-extraction-from-database-using-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhi227070%2Fdata-extraction-from-database-using-ai/lists"}