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!
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!