Title: Hi HN community. We are excited to open source Dataherald’s natural-language-to-SQL engine today (<a href="https:&#x2F;&#x2F;github.com&#x2F;Dataherald&#x2F;dataherald">https:&#x2F;&#x2F;github.com&#x2F;Dataherald&#x2F;dataherald</a>). This engine allows you to set up an API from your structured database that can answer questions in plain English.<p>GPT-4 class LLMs have gotten remarkably good at writing SQL. However, out-of-the-box LLMs and existing frameworks would not work with our own structured data at a necessary quality level. For example, given the question “what was the average rent in Los Angeles in May 2023?” a reasonable human would either assume the question is about Los Angeles, CA or would confirm the state with the question asker in a follow up. However, an LLM translates this to:<p>select price from rent_prices where city=”Los Angeles” AND month=”05” AND year=”2023”<p>This pulls data for Los Angeles, CA and Los Angeles, TX without getting columns to differentiate between the two. You can read more about the challenges of enterprise-level text-to-SQL in this blog post I wrote on the topic: <a href="https:&#x2F;&#x2F;medium.com&#x2F;dataherald&#x2F;why-enterprise-natural-language-to-sql-is-hard-8849414f41c" rel="nofollow noreferrer">https:&#x2F;&#x2F;medium.com&#x2F;dataherald&#x2F;why-enterprise-natural-languag...</a><p>Dataherald comes with “batteries-included.” It has best-in-class implementations of core components, including, but not limited to: a state of the art NL-to-SQL agent, an LLM-based SQL-accuracy evaluator. The architecture is modular, allowing these components to be easily replaced. It’s easy to set up and use with major data warehouses.<p>There is a “Context Store” where information (NL2SQL examples, schemas and table descriptions) is used for the LLM prompts to make the engine get better with usage. And we even made it fast!<p>This version allows you to easily connect to PG, Databricks, BigQuery or Snowflake and set up an API for semantic interactions with your structured data. You can then add business and data context that are used for few-shot prompting by the engine.<p>The NL-to-SQL agent in this open source release was developed by our own Mohammadreza Pourreza, whose DIN-SQL algorithm is currently top of the Spider (<a href="https:&#x2F;&#x2F;yale-lily.github.io&#x2F;spider" rel="nofollow noreferrer">https:&#x2F;&#x2F;yale-lily.github.io&#x2F;spider</a>) and Bird (<a href="https:&#x2F;&#x2F;bird-bench.github.io&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;bird-bench.github.io&#x2F;</a>) NL 2 SQL benchmarks. This agent has outperformed the Langchain SQLAgent anywhere from 12%-250%.5x (depending on the provided context) in our own internal benchmarking while being only ~15s slower on average.<p>Needless to say, this is an early release and the codebase is under swift development. We would love for you to try it out and give us your feedback! And if you are interested in contributing, we’d love to hear from you!
Upvote: