Skip to content

A backend application that converts NLP to SQL queries.

License

Notifications You must be signed in to change notification settings

gentcod/nlp-to-sql

Repository files navigation

nlp-to-sql

A backend application that enables conversational database interactions, leveraging Retrieval-Augmented Generation (RAG) to generate context-aware, tailored responses. It converts NLP to SQL queries. It takes a textual request and returns a textual response based on the queried data.

PROJECT OVERVIEW

Example Question/Request:

  • How many accounts have been opened till date?

Generated Query:

   SELECT COUNT(*) FROM accounts;

Example Respose:

  • We've got a total of 114 accounts opened so far.

SECURITY CONSIDERATIONS

  • Prompts are engineered to ensure that conversations can only lead to READ operations:

    • Conditions in place to ensure that queries generated by the AI model are only SELECT statements.
    • Programmatically, generated queries from the AI model are also checked to ensure that only SELECT statements are used to query the database.
    • Sensitive data are exempted from the query generated and subsequently from the response provided.
  • Database connection strings are not persisted or stored but please ensure that temporary connection strings are created before supplying them during usage. Good to note that they are only used programmatically for establishing database connection and further getting requested data.

About

A backend application that converts NLP to SQL queries.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published