Live data from Hacker News

Show HN: Dataherald AI – Natural Language to SQL Engine

github.com

41–50 of 108 posts

Re: Show HN: Dataherald AI – Natural Language to SQL Engine

#41

Not to dismiss the effort here, but wondering if this should go even further than bridging natural language to SQL. With recent work on LLMs showing promising capabilities in handling complex data structures, maybe the real play is to cut out the SQL altogether. Direct interaction with LLM-optimized data stores could yield more efficient, flexible, and fine-tuned results, eliminating the translational losses that mig…

This is a rather superficial take that seems to only consider the aspect of querying a database, but, nevertheless, I'll jot down a few quick counterpoints:

1) A middle layer, such as SQL, offers a vital introspection point to understand and fix LLM mistakes. Without it, we will end up with a "black box" that could lead to errors in data queries and manipulations, making debugging and correction much more challenging.

2) Mathematical properties and data integrity: Databases are built around principles like 3NF and BCNF that are pivotal for efficiency and data integrity. It is highly doubtful that these essential principles could be as effectively replicated in a pure LLM-based system without losing critical aspects of data management and efficient query planning & execution.

3) You mentioned "translational losses" without clarity on what these might be. SQL is a specialized declarative language with clear structure and syntax, while human language often leaves room for ambiguity. Relying solely on an LLM could lead to interpretations that are likely but not necessarily correct. This ambiguity might actually increase "translational losses" rather than reduce them.

I understand there's a lot of excitement around generative AI at the moment, but DBMS are an extremely complex topic and this feels like another case of "when you have a hammer everything looks like a nail".

Re: Show HN: Dataherald AI – Natural Language to SQL Engine

#42

Any solutions like this that work with self hosted models?

Depends what you mean by 'work.' You can definitely use them, but GPT-4 is the only model that generates good SQL without lots of training + fine-tuning (and it is very difficult/impossible to come up with Nl SQL training sets). So GPT-4 is the only model that works well in terms of accuracy for now.

That being said, I am pretty sure the self hosted models will get there very soon.

Are you looking to deploy a solution with a self-hosted model?

Re: Show HN: Dataherald AI – Natural Language to SQL Engine

#43
post #42

Any solutions like this that work with self hosted models?

Depends what you mean by 'work.' You can definitely use them, but GPT-4 is the only model that generates good SQL without lots of training + fine-tuning (and it is very difficult/impossible to come up with Nl SQL training sets). So GPT-4 is the only model that works well in terms of accuracy for now. That being said, I am pretty sure the self hosted models will get there very soon. Are you looking to deploy a solutio…

What about datasets like https://huggingface.co/datasets/b-mc2/sql-create-context? An OSS model based on StarCoder was also recently published which is roughly between GPT-3.5 and GPT-4: https://github.com/defog-ai/sqlcoder

Re: Show HN: Dataherald AI – Natural Language to SQL Engine

#44
Congrats on the initial launch!

Here a few thoughts, feedback, and questions:

* you do a good job in this post of describing why you need more than just ChatGPT to get acceptable quality, but much less of that is in the readme. I wouldn't be afraid to sell the project a bit harder, even in early days

* likewise, I think a small visual of the architecture would be helpful, just to make clear what the relationship is to chatGPT, and the additional features of a context store, etc

* Between the notes here and your product pages, it seems a strategy for commercialization with this repo being a lower level tool, with your commercial service having UI, simplified integration, and a hosted version to make this easier for semi-techical teams? If that is the case, I wouldn't be afraid to make that more explicit. GitHub is more and more a place for discovery, even to semi-techical people, but to do that well, I think focusing on a readme that makes it clear who the open source is for is important

* How are you planning on solving the data access problem? Is this a full SaaS service that will need access to the customer data directly somehow? Do you deploy this in the customer's environment? In thinking beyond this open source release and to the commercial side, that would be what I would want to know

* This point has been hit by others in this thread, but I would be curious to know what your plans are to help protect against valid but incorrect queries? I am not as convinced that this problem is insurmountable, as it does seem like you could build features to remove ambiguity by asking questions, show alternatives, etc that most semi-techical people could reason through, but ultimately it seems like thinking about how to involve the teams that own the data might be an important part of the problem.

Anyways, congrats again! This is an area I am really excited to see how it evolves (and will be exploring more!). My email is in my profile if you are interested in chatting more :)

Re: Show HN: Dataherald AI – Natural Language to SQL Engine

#45

Not to dismiss the effort here, but wondering if this should go even further than bridging natural language to SQL. With recent work on LLMs showing promising capabilities in handling complex data structures, maybe the real play is to cut out the SQL altogether. Direct interaction with LLM-optimized data stores could yield more efficient, flexible, and fine-tuned results, eliminating the translational losses that mig…

This is a rather superficial take that seems to only consider the aspect of querying a database, but, nevertheless, I'll jot down a few quick counterpoints: 1) A middle layer, such as SQL, offers a vital introspection point to understand and fix LLM mistakes. Without it, we will end up with a "black box" that could lead to errors in data queries and manipulations, making debugging and correction much more challenging…

Appreciate your insights. A few comments/responses

1. Agree on the introspection point, but it's worth noting that the future of LLMs might involve self-awareness capabilities, which could provide an introspective mechanism similar to SQL's transparency. the aim would be to build upon this middle layer, not blindly supplant it. 2. While 3NF, BCNF, and other normalization forms have served us well, they are essentially tools to manage imperfections in our storage and retrieval systems. LLMs can be trained to understand these nuances intrinsically. additionally, database theories have evolved, with advancements like distributed databases, graph-based models, and nosql. so, it's not entirely outside the realm of possibility that we can pivot and adapt to new paradigms. 3. The "translational losses" referred to the semantic disconnect between natural language queries and their SQL representations. while SQL is unambiguous, the leap from a user's intent to the SQL formulation often introduces errors or inefficiencies. LLMs can be trained to improve over time, constantly refining based on feedback loops.

not arguing that SQL or databases as we know them are obsolete today, just advocating for a more imaginative exploration about where the tech is headed.

Re: Show HN: Dataherald AI – Natural Language to SQL Engine

#47

Not to dismiss the effort here, but wondering if this should go even further than bridging natural language to SQL. With recent work on LLMs showing promising capabilities in handling complex data structures, maybe the real play is to cut out the SQL altogether. Direct interaction with LLM-optimized data stores could yield more efficient, flexible, and fine-tuned results, eliminating the translational losses that mig…

I doubt any current LLM is up to the job of bypassing SQL, even for the simplest of queries.

The thing is, an SQL database is already a sort of AI - an old school algorithmic AI:

“The code generator, and especially the logic in where*.c and in select.c, is sometimes called the query planner. For any particular SQL statement, there might be hundreds, thousands, or millions of different algorithms to compute the answer. The query planner is an AI that strives to select the best algorithm from these millions of choices.”

https://www.sqlite.org/arch.html

Translating natural language into SQL is ironic, because SQL was intended to be a natural language that would be interpreted by an AI.

In the future maybe an AI could be trained to bypass high-level languages. Perhaps it could generate intermediate representation (IR) code - skipping the tokenising and parsing. Perhaps it could generate byte code directly. Or it could even skip the VM and generate machine code to work with the back-end API.

Re: Show HN: Dataherald AI – Natural Language to SQL Engine

#48

Excellent! This blows writing SQL by hand out of the water. In 10 years, programming languages like Java, SQL, etc will be dead. I predict everyone will write in their native language (English, Chinese, etc) and a AI-based compiler will write the actual code for them.

Once an AI is capable of writing sensible code it will be telling humans what to do, not the other way around.

Re: Show HN: Dataherald AI – Natural Language to SQL Engine

#49
post #38

Earlier quoted context omitted.

A less sarcastic take: This only works if you have perfect data engineering. But if you have perfect data engineering, point and click tools like Looker will work too.

Sort of. Having perfect data engineering is a requirement if you want to connect an LLM straight to your data warehouse. For real world scenarios, you need a way to add context over time (including examples of how to answer questions from messy data). The same way a new team member would need to be on-boarded the tool needs to learn the context of the data and business logic, store it under supervision from an admin…

Personally I think that's a great response. Continuous schema mapping, gotcha-patching, and formalization of undocumented knowledge is imperative, and this can be solved by engineers using an ongoing process. Kudos on the launch.

I did an NL-to-SQL startup, but now I think is a much better time to do this.

Post reply on HN