Inspiration
Part of my job entails fulfilling the handful of one-off data requests that come through Slack. I sought out to see if I could automate, or at least support, this piece of work.
What it does
By @-mentioning QueryThing and asking it a question, it will generate a SQL query given the context of your database, execute this query, and return the result (and query) to you in Slack.
How we built it
This is a Slack app that pings a very simple server (running on ngrok) when it's @-mentioned, and then using some OpenAI prompts and database context (via psycopg2), it returns data and the query used.
Challenges we ran into
I'm by no means a full-stack engineer, so this is my first slack app and ngrok server.
Accomplishments that we're proud of
The data and questions being asked are extremely simple, but it's cool to see it respond with the correct data.
What we learned
Use a virtual env and save yourself the headache.
What's next for QueryThing
I'd like to feed it more complicated questions and datasets, and see how/if accuracy is maintained. I'd also like to incorporate a mechanism to store previous queries/questions as they're completed, so QueryThing can gain more context over time about the business for which it's answering questions.
Built With
- flask
- ngrok
- openai
Log in or sign up for Devpost to join the conversation.