Show HN: DaLMatian – Text2sql that works (dalmatian.ai)
There are many constraints that make this reality difficult to achieve. The product needs to scale to databases with millions of columns and extract business logic from very complex queries. It also needs to be fast, at least faster than an analyst would take to write the query. On top of all this, an analyst needs to be allowed to use it from a security standpoint. Our app meets all the key requirements of an enterprise data analyst while also being lightweight enough to run locally on a typical laptop.
Here's how it works. To get started, you simply need to open a file of past queries in our IDE (try it here: https://www.dalmatian.ai/download) and add a file with your database schema (instructions here: https://www.dalmatian.ai/docs#configuration). There is also an option to connect a database to auto pull your schema (no actual data is seen by the LLM). We do not see anything you input since the app is local and the only external connection is with OpenAI. It's just like asking ChatGPT for help with queries, but in a streamlined way.
If you'd download our free IDE and try to break it, we'd love to hear what you come up with!
29 comments
[ 3.5 ms ] story [ 69.0 ms ] thread1) I appreciate that it's said to be local first but the fact that it depends on an OpenAI API usage is...kinda a big hole in that? The organization I work in wouldn't really accept this for approval, and from the title I was hoping that this would be a local-first fine tuned (or fine-tunable) LLM.
2) The about page stating that you met at Princeton is a huge bear signal for me. I don't think tools should be adopted based on how much of an elite (cognitive or financial or social or athletic or whatever) their creators are, and given the use of the OpenAI APIs I question why the "top ML conferences" bit is here at all.
It's not everything, but there is a reasonable approach where someone would trust OpenAI much more than $startup.
Just call it what it is. We're just a wrapper around gpt4, so the treatment of your data is subject to OpenAI's privacy policies and while we'll try to keep you informed of any changes you should be aware of that major dependency.
Stay on top of it, as the shape of the claims keeps shifting as they adapt their business model, such as with the introduction of the Team billing.
2 - agreed the background isn't why anyone should adopt a tool, just wanted to share our story. I would add that creating a good wrapper can actually be quite challenging, need to synthesize many pieces under constraints like memory, compute, speed, accuracy.
How easy is it to select which tables should be taken into account?
Is there an intermediate context layer step to work with this?
Do you need to provide working examples for the tool to know how joins and relations are usually handled?
For now we don't particularly handle huge schema, being over 10-20k tokens. I would suggest adding only the tables you need. But I will hopefully this week test a solution that automatically pre-determines which tables to include for huge schemas before the actual SQL query generation and thereby using relatively few tokens.
> How easy is it to select which tables should be taken into account?
You can edit the schema using code editor (it will be in CSV). That is relatively easy. I previously had a solution where you could manually tick off tables to include, but found it a bit cumbersome. Might add that back though. Ideally I want everything you run without the user having to include/exclude tables.
> Is there an intermediate context layer step to work with this?
I will test adding this. Must also be performant in terms of speed and reliability.
> Do you need to provide working examples for the tool to know how joins and relations are usually handled?
Normally AI can infer that from the schema. If not you can "teach" AI using RAG: https://www.sqlai.ai/posts/enhancing-ai-accuracy-for-sql-gen...
But looks like there are plenty of products coming out in this area, and it has me wondering: what is the actual big picture for enterprises here?
I would assume enterprises employ enough people to write yet another query for whatever use case.
- Is the expectation that in the future, we can bring the flexibility of SQL-like languages to people unfamiliar with SQL?
- Perhaps a salesperson unfamiliar with SQL would like to conduct an analysis. Is the volume and variety of such queries so high that optimizing for the turnaround time from an SQL query designed by data analyst to the salesperson to consume the results is so worthwhile?
Perhaps I am underestimating the scale of the problem but would love some insider perspective here.
https://github.com/awslabs/unified-text2sql-benchmark
https://github.com/defog-ai/sql-eval