Live data from Hacker News

Show HN: Natural Language to SQL "Text-to-SQL" API

dataherald.com

1–10 of 41 posts

Show HN: Natural Language to SQL "Text-to-SQL" API

#1
Hi HN- Today, we are releasing the hosted API for our natural language to SQL engine, which allows you to:

(1) Explain Your Data: Feed in dictionaries, dbt, schemas, Confluence docs - we'll understand the business context to your data.

(2) Train Your AI: Fine-tune an LLM (including GPT-4) specifically for your data, increasing accuracy and lowering latency

(3) Trust the Answer: See confidence scores with each AI-generated query, stay in control.

(4) Conduct complex SQL queries

Problem background - Developers struggle to build NL-to-SQL into products because LLMs do not work out-of-the-box; they lack metadata and business definitions. Existing NL-to-SQL tools struggle with context, complexity, and adapting to your data.

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:

  select price from rent_prices where city=”Los Angeles” AND month=”05” AND year=”2023”
Dataherald integrates with major data warehouses, including PostgreSQL, Databricks, Snowflake, BigQuery, and DuckDB.

You can try it now free – no fees, no credit card, no sales pitches, just get the API key and get going. Let us know if it works for you, even your complex queries. (https://console.dataherald.ai/playground)

While the open source version works just fine (https://github.com/Dataherald/dataherald), the hosted API might be a better fit for those looking for: (1) someone else to take care of infrastructure setup, (2) access to an Admin UI console where you can configure and monitor performance, and (3) ability to invite team members to a project.

We're looking for feedback, particularly from anyone who can compare this performance to other NL-to-SQL products. Share your thoughts and join the conversation For more background on the release: https://www.dataherald.com/news/introducing-dhai

Show HN: Natural Language to SQL "Text-to-SQL" API
dataherald.com

Re: Show HN: Natural Language to SQL "Text-to-SQL" API

#3

What do you mean by complex SQL? How complex?

For large databases, LLMs do not perform well if you pass the entire schema (either run into context window issues or confuse the LLM with too much info). There is a schema linking step that identifies the relevant schema and only passes that. The schema linking is also done in the fine-tuning process.

Re: Show HN: Natural Language to SQL "Text-to-SQL" API

#5
post #3

What do you mean by complex SQL? How complex?

For large databases, LLMs do not perform well if you pass the entire schema (either run into context window issues or confuse the LLM with too much info). There is a schema linking step that identifies the relevant schema and only passes that. The schema linking is also done in the fine-tuning process.

Good, but.. What do you mean by complex SQL? How complex?

Re: Show HN: Natural Language to SQL "Text-to-SQL" API

#6
The submitted link results in a login wall. It would probably be worth updating the submission to the introducing-dhai page that's mentioned all the way at the end here, as getting greeted by a login prompt that way isn't going to entice people to explore or learn about the product.

Re: Show HN: Natural Language to SQL "Text-to-SQL" API

#7
post #5
post #3

Earlier quoted context omitted.

For large databases, LLMs do not perform well if you pass the entire schema (either run into context window issues or confuse the LLM with too much info). There is a schema linking step that identifies the relevant schema and only passes that. The schema linking is also done in the fine-tuning process.

Good, but.. What do you mean by complex SQL? How complex?

The largest we have successfully deployed is on the OSQuery schema https://osquery.io/ which is 277 tables and lots of business context (malwares, vulnerabilities, Windows registry keys, etc).

Re: Show HN: Natural Language to SQL "Text-to-SQL" API

#8

What do you mean by complex SQL? How complex?

I've been playing w/ this product self-hosted for a few weeks. It can join across multiple tables, windowing functions. I haven't tried self-joins yet, nor I have put much effort into tuning w/ Golden SQL or other documentation.

I would put this at the skill level of a junior data engineer. It's pretty impressive.

Re: Show HN: Natural Language to SQL "Text-to-SQL" API

#9
post #6

The submitted link results in a login wall. It would probably be worth updating the submission to the introducing-dhai page that's mentioned all the way at the end here, as getting greeted by a login prompt that way isn't going to entice people to explore or learn about the product.

i'll try to change it out the link
Post reply on HN