Hacker News Activity Analysis with GPT-4 Agent (eu.getdot.ai)
Hey, we are building Dot, a data bot (https://www.getdot.ai) that lets data teams enable everyone in their org to self-serve on governed data. We thought we'd demo it using the tried and true method of "show Hacker News stuff about itself".
For this analysis, we used the BigQuery dataset of HN (https://console.cloud.google.com/marketplace/product/y-combi...). We created one more table to pre-calculate yearly retention. And of course, a lot of the heavy lifting is done by OpenAI's GPT-4 models and the fantastic plotly library for visualization.
Let us know what other things you'd like to see about Hacker News data in the comments, and try our best to share the answers!
53 comments
[ 4.9 ms ] story [ 109 ms ] threadGreat stuff.
Dot will ask a clarifying question.
Questions like, "what kind of data do you have access to?" or "how can you help me?" would work.
Dot today works well for questions that can be answered with 1 SQL query and some Python.
https://eu.getdot.ai/share/135b4e3f-2526-4d1c-ac69-d1716133f...
It asks ChatGPT to write SQL to get sales data, ChatGPT (or most SQLers) trust that every year-month combo has atleast one entry - which means the graphs its presenting could be wrong. Because if there was no entries for a year-month it it will skip that year-month and make it look like you never had a 0 month.
I've made this mistake before in prod, and without some janky lookup table of every date in existence... you need more code :( Fairly few people actually notice the potentially missing month, but still its a bug n a bad one.
Looks cool regardless though, good luck!
You probably refer to one of the demos on our landing page?
I like how you describe the problem. You're absolutely right that SQL seems easy but it's these edge cases that make it hard to get right. Joining metrics with a date spine is definitely a good practice to avoid missing date periods.
I think we could/should teach Dot to do that in the future. It should at least be a feature you can turn on as the data team.
Indeed, not sure how I ended up there but did on mobile, commented here.
> You're absolutely right that SQL seems easy but it's these edge cases that make it hard to get right
SQL/data analysis is endlessly pesky! I assume it would be easier to spot on tighter increments like "minutely" or "hourly"
> It should at least be a feature you can turn on as the data team.
Some might want the missing points, others wont - sounds like a good option (but id default to "enabled", each to their own though)
Having a date dimension provides an elegant solution in many cases.
Also once you start saying "i want secondly/minutely breakdowns", the dimension (neat term) gets pretty...large (probably less than the TB of data though)
I find that many places need a spine.
after seeing the demo, i immediately wanted to sign up and input a google sheet where i'm tracking my health stats from a current case of covid. but yall don't have that connection. a google sheets connection would be handy. so many orgs i work with use that. it's not the best way for people to maintain data, but a lot of people still use it.
also, the sign up with elon musk placeholder text was a turn off. regardless of how one personally feels about him, you could put any person there and somebody wouldn't like it. it's too risky and imo nobody needs placeholder text for a personal info form. i imagine this is early startup branding experiments which i respect, but thought i'd offer my unsolicited feedback.
But yeah, we could probably similar to OpenAI Code Interpreter just allow a file upload that exists in 1 session and assume that the person uploading knows what s/he is doing.
Good advice on Elon. I am personally a fan but I understand that he is controversial.
FWIW, I'd ask:
- 1) Who are the top posters and commenters by average score on posts and comments?
- 2) Which users instigate the most positive discussions in reply to their comments. (Not longest or more... but highest quality, without arguments, flamewars, etc.)
It is that 2nd question I'm really interested in because it really might need analysis of the substance of content, not just stats.
Your 2nd question would require some preprocessing per message that should probably be done as part of data preparation and not at query time.
A service to preprocess the data with custom prompts would be neat.
It is pretty cool to mess about with it. I posted it last week, but didn't get any nibbles: https://github.com/MittaAI/mitta-community/tree/main/cookboo...
From BigQuery and Snowflake I know they have remote/external function that you can use to just plug in the OpenAI API.
Like, if I am running a t-shirt store, my users can query like: "Do you have a round neck t-shirt in red color in XL size" and it returns all relevant results
> that was a bad visualization...
You could potentially stage the query in two parts — one in which it builds the query that you execute , and the 2nd in which you provide data for it to analyse/visualise.
Also a little curious why you didn't choose that heading for this story too but maybe you have already run all the numbers .... ?
We actually wanted to post it as Show HN, but dang advised that since it is not directly interactive it is more of a regular post.