Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL Template Matcher #2

Open
1 of 2 tasks
anisbhsl opened this issue Jan 5, 2024 · 0 comments
Open
1 of 2 tasks

SQL Template Matcher #2

anisbhsl opened this issue Jan 5, 2024 · 0 comments
Assignees

Comments

@anisbhsl
Copy link
Collaborator

anisbhsl commented Jan 5, 2024

Description

Current implementation uses SQL agent to generate SQL statement when provided with user query. This is inconsistent and it is difficult to railguard the response. To prevent this, create a SQLTemplateMatcher as base class which will have following base classes

  1. FuzzySQLTemplateMatcher : Rule based query to SQL statement
  2. LLMBasedSQLTemplateMatcher : LLM based query to SQL template matcher with entity extraction

Refer to this boilerplate for base class:

class SQLTemplateMatcher:
    def __init__(self, ...):
    ...

    def add_query_template(self, query, sql_statement):
     ...

    def match(self, query) -> list:
         return top k matched sql statements along with entity substition (or we can do subsition in another step)

The constructor could take: table schema, sql templates

Deliverables

  • Base Matcher Class
  • LLM Based SQL Template Matcher
  • Fuzzy SQL Template Matcher

Tasks

  1. connectwithprakash
  2. anisbhsl
@anisbhsl anisbhsl self-assigned this Jan 5, 2024
@anisbhsl anisbhsl linked a pull request Jan 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant