Why this matters
Paul Graham’s “do things that don’t scale” essentially boils down to: talk to your best users. The 10 people who use your product more than anyone else are a goldmine — they tell you what to build, they refer their friends, they renew without thinking.
The only thing stopping every SaaS founder from doing this weekly is friction. “Who are my top users?” is a SQL query against your events table. Most founders are 6 dashboards deep and never quite pull the trigger.
Agentry does it in one prompt because the agent already knows your event vocabulary, can weight by intent (revenue > vanity > pageviews), and can output it as a paste-able list.
What you get
- A ranked list of your top users by weighted activity
- Each user’s email, signup date, plan, and top 3 actions
- A copy-paste-ready Markdown table for your weekly review doc
Walk through it
Rank users by total events this month, weighted 3x for revenue events and 2x for collaboration. Give me their emails, signup date, top 3 actions, and plan.
Let me see what events you have so I can categorize them as revenue / collaboration / other.
agentry_list_event_names {
project_id: "default",
matching: "subscription|payment|invite|share|comment|created"
}
{
"events": [
{ "name": "subscription_started", "count": 142 },
{ "name": "subscription_upgraded", "count": 38 },
{ "name": "invoice_paid", "count": 480 },
{ "name": "team_member_invited", "count": 86 },
{ "name": "comment_added", "count": 1240 },
{ "name": "project_shared", "count": 91 },
{ "name": "project_created", "count": 720 }
]
}
Got it. Categorizing:
- Revenue (3x): subscription_started, subscription_upgraded, invoice_paid
- Collaboration (2x): team_member_invited, comment_added, project_shared
- Other (1x): everything else
Running the query.
agentry_analytics_query {
project_id: "default",
hogql: "
SELECT
person.properties.email AS email,
person.properties.signup_date AS signup_date,
person.properties.plan AS plan,
sum(CASE WHEN event IN ('subscription_started','subscription_upgraded','invoice_paid') THEN 3
WHEN event IN ('team_member_invited','comment_added','project_shared') THEN 2
ELSE 1 END) AS weighted_score,
arrayJoin(topK(3)(event)) AS top_action,
count() AS total_events
FROM events
WHERE timestamp > now() - INTERVAL 30 DAY
AND person.properties.email IS NOT NULL
GROUP BY email, signup_date, plan
ORDER BY weighted_score DESC
LIMIT 10
"
}
Top 10:
| # | Email | Plan | Signup | Score | Top Actions |
|---|------------------------|-------|------------|-------|--------------------------------------|
| 1 | [email protected] | pro | 2026-01-12 | 487 | project_created, comment_added, … |
| 2 | [email protected] | scale | 2025-09-04 | 412 | invoice_paid, project_shared, … |
| 3 | [email protected] | pro | 2026-02-28 | 388 | comment_added, project_created, … |
| 4 | [email protected] | free | 2026-04-19 | 364 | project_created, $pageview, … |
| 5 | [email protected] | pro | 2025-11-22 | 351 | team_member_invited, comment_added, … |
…
Two things jump out:
- #4 [email protected] is on FREE plan but has more weighted activity than 80% of pro users. Strong upgrade candidate. Personal email from you would probably convert them.
- #2 [email protected] has high invoice_paid count (likely on monthly billing) — worth a check-in to ask about annual.
Want me to draft personal emails for the upgrade candidates?
The output
🏆 Top 10 power users (last 30 days, weighted)
1. [email protected] pro score 487 💪 active daily
2. [email protected] scale score 412 💰 monthly billing — pitch annual
3. [email protected] pro score 388
4. [email protected] free score 364 ⚠️ upgrade candidate
5. [email protected] pro score 351
… (5 more)
Actionable callouts:
• 1 free user with pro-tier activity → personal upgrade email
• 1 monthly customer with consistent usage → annual upsell
Generated table is paste-ready for your weekly review doc.
Setting it up
Agentry has no SDK and no separate identify() call. Every analytics event is a raw POST to /v1/analytics/, and you attach the identifier + user properties inline in the event body.
1. distinct_id set to the user email (or any stable per-user identifier) on every event:
await fetch(`https://api.agentry.sh/v1/analytics/${process.env.AGENTRY_PROJECT_ID}/`, {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.AGENTRY_DSN}`,
"Content-Type": "application/json",
"User-Agent": "myapp/1.0", // REQUIRED — Cloudflare 403s default UAs
},
body: JSON.stringify({
event: "project_created",
distinct_id: user.email,
properties: { project_id: project.id },
}),
});
2. User properties via $set on any event so the agent can rank by plan / signup date. PostHog (which /v1/analytics/ forwards to) reads $set and updates the person record:
await fetch(`https://api.agentry.sh/v1/analytics/${process.env.AGENTRY_PROJECT_ID}/`, {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.AGENTRY_DSN}`,
"Content-Type": "application/json",
"User-Agent": "myapp/1.0",
},
body: JSON.stringify({
event: "$identify", // or piggyback $set on any event you already send
distinct_id: user.email,
properties: {
$set: {
plan: user.plan, // "free" | "pro" | "scale"
signup_date: user.created_at,
team_id: user.team_id,
},
},
}),
});
That’s it. The agent figures out the rest from your event names.
Variations
- “Show me the top 10 free-tier users. I want to email them personally about upgrading.”
- “Find users who were top-10 last month but dropped out of the top 50 this month — they’re cooling off.”
- “Power users by team_id instead of email — which companies are the most engaged?”
- “For each top user, draft a 2-sentence email asking them what they wish Agentry could do.”