Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: DuckGPT – Ask questions, let GPT do the SQL through DuckDB (github.com/cube2222)
3 points by cube2222 on March 26, 2023 | hide | past | favorite | 3 comments


Hey, author here!

I’ve been playing with ChatGPT and DuckDB recently, for completely unrelated reasons, but this made me come up with an idea: writing natural language queries and having them be actually executed as SQL underneath, in a fully-streamlined fashion.

It’s a weekend toy project / tech demo, so don’t expect too much, but I’m actually surprised how well it works! Even with complicated queries, it succeeds. It sometimes gets the queries wrong (esp. dialect specific stuff), but it reads the error message and is able to successfully adjust its queries without any human help.

From the technical side, ChatGPT here is offered commands to read the schemas of specific files, and to execute queries. This seems to be enough to make it work well. Adding more commands (like one to preview the beginnings of the files) seemed to get it a bit confused, so I wonder if GPT4 would do better here and allow for a bit more power.

There are a couple demo videos in the README, make sure to check them out!


This is brilliant! Nice job!

Asked the same question in another thread (https://news.ycombinator.com/item?id=35320571), but i suppose it belongs here:

Why didn't you do the same for OctoSQL? Are you considering DuckDB for your compute engine for OctoSQL?


Ah, I've responded there already, but posting it here for future reference: https://news.ycombinator.com/item?id=35327014




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: