Submitted by Mogen1000 t3_10rcn5o in singularity
HighTechPipefitter t1_j6xe1ge wrote
Reply to comment by dgrsmith in GPT tool that lets you connect to databases and ask questions in text. by Mogen1000
There's definitely a learning curve for the user to learn to properly express themselves. But there's also different strategies you can use to help them.
A library of common prompt examples is a first one.
A UI with predefined chunks of query that you assemble is another.
You could also use embeddings to detect ambiguity and ask your user for precision.
You also don't need to expose your whole schema right away, this can be done gradually. You start with the most common requests and build from there. This way you don't need to invest a huge amount of resources from the beginning.
We are barely scratching the surface on how to use it. This will be common practice pretty soon.
If you are in a position that you have access to a database at work, I strongly suggest that you give it a try. It's surprisingly good.
dgrsmith t1_j6xffed wrote
>If you are in a position that you have access to a database at work, I strongly suggest that you give it a try. It's surprisingly good.
I'll give it a try with synthetic data! Maybe I'll be surprised at the amount of finessing it doesn't take. I assume it's gonna take quite a bit to make it work, but I'll give it a shot!
HighTechPipefitter t1_j6xjlgw wrote
Fun starts here: https://platform.openai.com/examples/default-sql-translate
Then "all you need" is to create an API call with python to get the query from OpenAI and send that query to your database through another API call.
Start small, there's a lot of little quirks but the potential is definitely there.
I expect that in the coming years you will start to see a bunch of articles about the best practice on how to integrate an AI with a database.
Good luck.
Viewing a single comment thread. View all comments