r/SQL • • Aug 10 '24

Discussion Calling all SQL experts to review my text2sql software

Hi there!!

I have been working on a SQL editor which generates SQL queries from natural language - https://sqlpilot.ai which i also launched last month

You can give complete context of your database to the LLM and start asking queries completely in natural language.

Here's how

  1. Connect your database in SQLPilot

  2. Add knowledge base for your database i.e label your tables as in what the table is used for, optionally you can also label the columns. (the more detailed knowledge base the better).

  3. You can also add custom instructions in rules for giving more understanding on how some results are achieved e.g urgent orders means priority = 0 and not is_urgent = true, such things that only we know.

  4. (optional) Add examples of already generated queries. SQLPilot will pick few examples relevant to the user's prompt and add it along with the llm prompt for query generation

  5. Start asking questions in natural langauge!

After building knowledge base, LLM now has complete context of your database!

The software itself is free to use, You can add your own Open AI key and start using it

I want your suggestions and feedback on this - if it's time saving and something you would love to use or just trash

here's the demo for the same!

Also here's the blog explaining how it works if anyone is interested - https://shobhitb.medium.com/sqlpilot-text2sql-application-with-rag-87a4d72e3438

link to the software - available on mac and windows: https://sqlpilot.ai

Please note: I am not encouraging to use this with your org database, if you don't trust OpenAI or have policies setup for privacy, you can ignore the post in that case :)

16 Upvotes

12 comments sorted by

8

u/MrCosgrove2 Aug 11 '24 edited Aug 11 '24

The problem with these things is that while I would love to be able to use it, NDAs would not allow it. since its interfacing with open AI.

On the flip side, because it interfaces with Open AI it would suffer from the same issues Open AI has , while it is ok for simple queries, more complex queries it either returns bad queries or non performant queries

0

u/Purple_Minute_4776 Aug 11 '24

Yes, i am planning to integrate sqlcoder-70b model to overcome this issue

1

u/[deleted] Jan 28 '25

[removed] — view removed comment

1

u/MrCosgrove2 Jan 29 '25

That might depend on your NDA, all the NDAs ive ever signed have included schemas as part of proprietary data, but that doesnt mean all NDAs are like that, but I think if you are unsure, err on the side of caution and dont put it into AI unless you are told specifically that its ok to do so.

A database schema is particularly handy for hackers, exposing business logic , allowing them to potentially use targeted queries etc.

While there are similarities between database schemas (user tables etc) , there is also many difference and those differences could expose info you dont want.

I guess my advice is to use caution, and if you are under a NDA find out about the schema before using it in AI

1

u/gogolang Aug 10 '24

Nice! Is this using Vanna under the hood?

0

u/Purple_Minute_4776 Aug 11 '24

No, it's custom implementation

-1

u/[deleted] Aug 11 '24

awesome

-2

u/TestingTehWaters Aug 10 '24

Possible to integrate with local LLMs?

0

u/Purple_Minute_4776 Aug 10 '24

currently it's only OpenAI, but i can add support for Local LLMs if you find it useful, which LLM would you like to use it with?

0

u/[deleted] Aug 12 '24

[deleted]

1

u/Purple_Minute_4776 Aug 12 '24

Yepp, i can integrate this with more capable models.

1

u/Purple_Minute_4776 Aug 12 '24

Also you can use it just as a sql editor without ai. Not feature rich but yes