exploring-llm-clusters
What it does
This skill explores the clusters PostHog builds from your AI traffic, which group similar traces, generations or evaluations together. It is for teams that want to understand the main types of requests their AI handles.
When to use it
- βWhen you want to see which kinds of requests your AI handles most often.
- βWhen you want to compare how two groups of AI traffic behave.
- βWhen you want to look at the cost or speed of one group of conversations.
Skill link
https://github.com/PostHog/posthog/blob/master/products/ai_observability/skills/exploring-llm-clusters/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βWhat are the main types of requests our AI handles, and which group costs the most?β
5 new skills a week. 1 minute to read.
How it works
It reads the saved clustering results, which group traces by how similar they are, and calculates cost and speed for each group. It can then open individual conversations inside a group to show examples.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Exploring LLM clusters
Use this skill when investigating AI observability clusters β understanding what patterns exist in your AI/LLM traffic, comparing cluster behavior, and drilling into individual clusters.
Tools
| Tool | Purpose |
|---|---|
posthog:llma-clustering-job-list |
List clustering job configurations for the team |
posthog:llma-clustering-job-get |
Get a specific clustering job by ID |
posthog:execute-sql |
Query cluster run events and compute metrics |
posthog:query-llm-traces-list |
Find traces belonging to a cluster |
posthog:query-llm-trace |
Inspect a specific trace in detail |
How clustering works
PostHog clusters LLM traces, individual generations, or evaluation events by embedding similarity.
A Temporal workflow runs periodically or on-demand, producing cluster events stored as
$ai_trace_clusters (trace-level), $ai_generation_clusters (generation-level), or
$ai_evaluation_clusters (evaluation-level).
Each cluster event contains:
$ai_clustering_run_idβ unique run identifier (format:<team_id>_<level>_<YYYYMMDD>_<HHMMSS>[_<job_id>])$ai_clustering_levelβ"trace","generation", or"evaluation"$ai_window_start/$ai_window_endβ time window of the data that was analyzed$ai_total_items_analyzedβ number of traces, generations, or evaluations processed$ai_clustersβ JSON array of cluster objects$ai_clustering_paramsβ algorithm parameters used
The analyzed window closes when a run starts, and the cluster event lands once the run finishes.
So the cluster event's own timestamp is always after $ai_window_end, by anything from seconds to hours.
Use the window only to bound the traces, generations, and evaluations that were analyzed.
To find the cluster event itself, filter on $ai_clustering_run_id with a plain recent-time bound.
Cluster object shape (inside $ai_clusters)
{
"cluster_id": 0,
"size": 42,
"title": "User authentication flows",
"description": "Traces involving login, signup, and token refresh operations",
"traces": {
"<trace_or_generation_id>": {
"distance_to_centroid": 0.123,
"rank": 0,
"x": -2.34,
"y": 1.56,
"timestamp": "2026-03-28T10:00:00Z",
"trace_id": "abc-123",
"generation_id": "gen-456"
}
},
"centroid_x": -2.1,
"centroid_y": 1.4
}
cluster_id: -1is the noise/outlier cluster (items that didn't fit any cluster)- Items in
tracesare keyed by trace ID (trace-level), generation event UUID (generation-level), or evaluation event UUID (evaluation-level) rankorders items by proximity to centroid (0 = closest)x,yare 2D coordinates for visualization (UMAP/PCA/t-SNE reduced)
Clustering jobs
Each team can have up to 10 clustering jobs. A job defines:
- name β human-readable label
- analysis_level β
"trace","generation", or"evaluation" - event_filters β property filters scoping which items are included
- enabled β whether the job runs on schedule
Default jobs named "Default - traces", "Default - generations", and "Default - evaluations" are auto-created
and disabled when a custom job is created for the same level.
Workflow: explore clusters
Step 1 β List recent clustering runs
posthog:execute-sql
SELECT
toString(properties.$ai_clustering_run_id) AS run_id,
toString(properties.$ai_clustering_level) AS level,
toString(properties.$ai_clustering_job_id) AS job_id,
toString(properties.$ai_clustering_job_name) AS job_name,
toString(properties.$ai_window_start) AS window_start,
toString(properties.$ai_window_end) AS window_end,
toFloat64OrNull(toString(properties.$ai_total_items_analyzed)) AS total_items,
timestamp
FROM events
WHERE event IN ('$ai_trace_clusters', '$ai_generation_clusters', '$ai_evaluation_clusters')
AND timestamp >= now() - INTERVAL 14 DAY
ORDER BY timestamp DESC
LIMIT 10
Step 2 β Get clusters from a specific run
posthog:execute-sql
SELECT
toString(properties.$ai_clustering_run_id) AS run_id,
toString(properties.$ai_clustering_level) AS level,
toString(properties.$ai_clustering_job_id) AS job_id,
toString(properties.$ai_clustering_job_name) AS job_name,
FAQ
How does PostHog group the traffic?
It compares the content of traces or generations for similarity, and it runs the grouping on a schedule or when you start it.
Can I look inside one group?
Yes. It finds the traces in a cluster and shows the detail of any one of them.
Who decides what the groups mean?
The groups are produced automatically, so the skill helps you read them and check the examples before you draw conclusions.
Details
Original description by the author
Investigate AI observability clusters β understand usage patterns in AI/LLM traffic, compare cluster behavior, compute cost/latency metrics, and drill into individual traces within clusters.
repo: PostHog/posthog
Popularity
- GitHub stars
- 41k
- Ranking position
- #6830
- License
- β
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
depot-ci
41kHelps your agent set up and run Depot CI workflows, a GitHub Actions alternative, including migrating existing workflows and reading run logs.
depot-container-builds
41kHelps your agent build Docker images on Depot's remote builders, including multi-platform images, pushing to registries, and fixing build failures.
depot-github-runners
41kHelps your agent move GitHub Actions jobs to Depot-managed runners, choosing runner sizes and labels, and troubleshooting runner setup issues.
editing-agents-md
41kHelps your agent decide whether a rule belongs in an AGENTS.md or CLAUDE.md file, and write it so it sticks without bloating the file.
Similar skills
gitcrawl
394kLets your agent search a saved archive of GitHub issues and pull requests, group duplicates, and check their current status on GitHub.
slacrawl
394kLets your agent search and count messages in a local Slack archive, check how fresh that archive is, and refresh it when needed.
goplaces
394kHelps your agent search for places, get their details and reviews, and resolve place names using Google Places, with JSON output for scripts.