GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Nipunkhattri/Text-To-SQL: This project enables users to connect to any database, input queries in natural human language, and retrieve relevant data by converting these queries into SQL. The project implements two different approaches to achieve this: one using pre-defined retrievers and query engines, and another using a Query Pipeline (DAG).

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
__pycache__
__pycache__
 
 
helpers
helpers
 
 
responses
responses
 
 
views
views
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
app.py
app.py
 
 
config.py
config.py
 
 
main.py
main.py
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

Text to SQL Query Engine

This project enables users to connect to any database, input queries in natural human language, and retrieve relevant data by converting these queries into SQL. The project implements two different approaches to achieve this: one using pre-defined retrievers and query engines, and another using a Query Pipeline (DAG).

Features

  • Natural Language Querying: Input queries in plain human language and retrieve relevant data from a connected database.
  • SQL Conversion: Automatically convert natural language queries into SQL statements.
  • Multiple Approaches:
    • Pre-defined Retrievers and Query Engines: Quick and straightforward implementation using LlamaIndex components.
    • Query Pipeline (DAG): A more advanced and flexible approach, allowing for complex workflows and data processing steps.

Tech Stack

  • LlamaIndex: Used for building the natural language processing (NLP) components and managing the retrievers and query engines.
  • Flask: Lightweight web framework used to build the API endpoints and handle incoming requests.
  • Gemini: Leveraged for handling complex data processing and managing the execution of the query pipeline (DAG).

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/text-to-sql.git
    cd text-to-sql
    
  2. Create and activate a virtual environment:
    python3.10 -m venv venv
    
  3. Activate Virtual environment
    source venv/bin/activate
    
  4. Install the required dependencies:
    pip install -r requirements.txt
    
  5. Start The Server
    python main.py
    

Run the Request and Get the Response using Postman

POST Request

URL: http://localhost:5000/database/connect-and-query

Method: POST

Request Body

{
    "connection_string": "postgresql://postgres:postgres@localhost:5432/texttosql",
    "query": "Tell all the emails in users table?"
}
{
    "data": "\"assistant: [email protected], [email protected], [email protected], [email protected]\"",
    "message": "Success"
}

About

This project enables users to connect to any database, input queries in natural human language, and retrieve relevant data by converting these queries into SQL. The project implements two different approaches to achieve this: one using pre-defined retrievers and query engines, and another using a Query Pipeline (DAG).

Topics

flaskflask-sqlalchemylllama-index

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.