[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-posthog-exploring-llm-clusters":3,"mdc-qeowl-key":38,"related-repo-posthog-exploring-llm-clusters":2525,"related-org-posthog-exploring-llm-clusters":2643},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":33,"sourceUrl":36,"mdContent":37},"exploring-llm-clusters","analyze LLM usage patterns and clusters","Investigate AI observability clusters — understand usage patterns in AI\u002FLLM traffic, compare cluster behavior, compute cost\u002Flatency metrics, and drill into individual traces within clusters.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"posthog","PostHog","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fposthog.png",[12,16,17,20],{"name":13,"slug":14,"type":15},"Observability","observability","tag",{"name":9,"slug":8,"type":15},{"name":18,"slug":19,"type":15},"LLM","llm",{"name":21,"slug":22,"type":15},"Analytics","analytics",59,"https:\u002F\u002Fgithub.com\u002FPostHog\u002Fai-plugin","2026-04-06T18:44:29.40583",null,11,[29,30,31,32],"claude-code-plugin","codex-plugin","cursor-plugin","gemini-cli-extension",{"repoUrl":24,"stars":23,"forks":27,"topics":34,"description":35},[29,30,31,32],"Official PostHog plugin for Claude Code, Cursor, Gemini, Codex and other AI coding tools","https:\u002F\u002Fgithub.com\u002FPostHog\u002Fai-plugin\u002Ftree\u002FHEAD\u002Fskills\u002Fexploring-llm-clusters","---\nname: exploring-llm-clusters\ndescription: 'Investigate AI observability clusters — understand usage patterns in AI\u002FLLM traffic, compare cluster behavior, compute cost\u002Flatency metrics, and drill into individual traces within clusters.'\n---\n\n# Exploring LLM clusters\n\nUse this skill when investigating AI observability clusters —\nunderstanding what patterns exist in your AI\u002FLLM traffic,\ncomparing cluster behavior, and drilling into individual clusters.\n\n## Tools\n\n| Tool                               | Purpose                                         |\n| ---------------------------------- | ----------------------------------------------- |\n| `posthog:llma-clustering-job-list` | List clustering job configurations for the team |\n| `posthog:llma-clustering-job-get`  | Get a specific clustering job by ID             |\n| `posthog:execute-sql`              | Query cluster run events and compute metrics    |\n| `posthog:query-llm-traces-list`    | Find traces belonging to a cluster              |\n| `posthog:query-llm-trace`          | Inspect a specific trace in detail              |\n\n## How clustering works\n\nPostHog clusters LLM traces, individual generations, or evaluation events by embedding similarity.\nA Temporal workflow runs periodically or on-demand, producing cluster events stored as\n`$ai_trace_clusters` (trace-level), `$ai_generation_clusters` (generation-level), or\n`$ai_evaluation_clusters` (evaluation-level).\n\nEach cluster event contains:\n\n- `$ai_clustering_run_id` — unique run identifier (format: `\u003Cteam_id>_\u003Clevel>_\u003CYYYYMMDD>_\u003CHHMMSS>[_\u003Cjob_id>]`)\n- `$ai_clustering_level` — `\"trace\"`, `\"generation\"`, or `\"evaluation\"`\n- `$ai_window_start` \u002F `$ai_window_end` — time window analyzed\n- `$ai_total_items_analyzed` — number of traces, generations, or evaluations processed\n- `$ai_clusters` — JSON array of cluster objects\n- `$ai_clustering_params` — algorithm parameters used\n\n### Cluster object shape (inside `$ai_clusters`)\n\n```json\n{\n  \"cluster_id\": 0,\n  \"size\": 42,\n  \"title\": \"User authentication flows\",\n  \"description\": \"Traces involving login, signup, and token refresh operations\",\n  \"traces\": {\n    \"\u003Ctrace_or_generation_id>\": {\n      \"distance_to_centroid\": 0.123,\n      \"rank\": 0,\n      \"x\": -2.34,\n      \"y\": 1.56,\n      \"timestamp\": \"2026-03-28T10:00:00Z\",\n      \"trace_id\": \"abc-123\",\n      \"generation_id\": \"gen-456\"\n    }\n  },\n  \"centroid_x\": -2.1,\n  \"centroid_y\": 1.4\n}\n```\n\n- `cluster_id: -1` is the **noise\u002Foutlier** cluster (items that didn't fit any cluster)\n- Items in `traces` are keyed by trace ID (trace-level), generation event UUID (generation-level), or evaluation event UUID (evaluation-level)\n- `rank` orders items by proximity to centroid (0 = closest)\n- `x`, `y` are 2D coordinates for visualization (UMAP\u002FPCA\u002Ft-SNE reduced)\n\n## Clustering jobs\n\nEach team can have up to 10 clustering jobs. A job defines:\n\n- **name** — human-readable label\n- **analysis_level** — `\"trace\"`, `\"generation\"`, or `\"evaluation\"`\n- **event_filters** — property filters scoping which items are included\n- **enabled** — whether the job runs on schedule\n\nDefault jobs named `\"Default - traces\"`, `\"Default - generations\"`, and `\"Default - evaluations\"` are auto-created\nand disabled when a custom job is created for the same level.\n\n## Workflow: explore clusters\n\n### Step 1 — List recent clustering runs\n\n```sql\nposthog:execute-sql\nSELECT\n    toString(properties.$ai_clustering_run_id) AS run_id,\n    toString(properties.$ai_clustering_level) AS level,\n    toString(properties.$ai_clustering_job_id) AS job_id,\n    toString(properties.$ai_clustering_job_name) AS job_name,\n    toString(properties.$ai_window_start) AS window_start,\n    toString(properties.$ai_window_end) AS window_end,\n    toFloat64OrNull(toString(properties.$ai_total_items_analyzed)) AS total_items,\n    timestamp\nFROM events\nWHERE event IN ('$ai_trace_clusters', '$ai_generation_clusters', '$ai_evaluation_clusters')\n    AND timestamp >= now() - INTERVAL 14 DAY\nORDER BY timestamp DESC\nLIMIT 10\n```\n\n### Step 2 — Get clusters from a specific run\n\n```sql\nposthog:execute-sql\nSELECT\n    toString(properties.$ai_clustering_run_id) AS run_id,\n    toString(properties.$ai_clustering_level) AS level,\n    toString(properties.$ai_clustering_job_id) AS job_id,\n    toString(properties.$ai_clustering_job_name) AS job_name,\n    toString(properties.$ai_window_start) AS window_start,\n    toString(properties.$ai_window_end) AS window_end,\n    toFloat64OrNull(toString(properties.$ai_total_items_analyzed)) AS total_items,\n    properties.$ai_clusters AS clusters,\n    properties.$ai_clustering_params AS params,\n    timestamp\nFROM events\nWHERE event IN ('$ai_trace_clusters', '$ai_generation_clusters', '$ai_evaluation_clusters')\n    AND timestamp >= parseDateTimeBestEffort('\u003Cwindow_start>')\n    AND timestamp \u003C= parseDateTimeBestEffort('\u003Cwindow_end>')\n    AND toString(properties.$ai_clustering_run_id) = '\u003Crun_id>'\nORDER BY timestamp DESC\nLIMIT 1\n```\n\nThe `clusters` field is a JSON array. Parse it to see cluster titles, sizes, descriptions, optional `metrics`, and each cluster's `traces` map.\n\n**Important:** The clusters JSON can be very large (thousands of trace, generation, or evaluation IDs with coordinates).\nWhen the result is too large for inline display, it auto-persists to a file.\nUse `print_clusters.py` from [scripts\u002F](.\u002Fscripts\u002F) to get a readable summary.\n\n### Step 3 — Compute metrics for clusters\n\nFor trace-level clusters, compute cost\u002Flatency\u002Ftoken metrics:\n\n```sql\nposthog:execute-sql\nSELECT\n    properties.$ai_trace_id as trace_id,\n    sum(toFloat(properties.$ai_total_cost_usd)) as total_cost,\n    max(toFloat(properties.$ai_latency)) as latency,\n    sum(toInt(properties.$ai_input_tokens)) as input_tokens,\n    sum(toInt(properties.$ai_output_tokens)) as output_tokens,\n    countIf(properties.$ai_is_error = 'true') as error_count\nFROM events\nWHERE event IN ('$ai_generation', '$ai_embedding', '$ai_span')\n    AND timestamp >= parseDateTimeBestEffort('\u003Cwindow_start>')\n    AND timestamp \u003C= parseDateTimeBestEffort('\u003Cwindow_end>')\n    AND properties.$ai_trace_id IN ('\u003Ctrace_id_1>', '\u003Ctrace_id_2>', ...)\nGROUP BY trace_id\n```\n\nFor generation-level clusters, match by event UUID:\n\n```sql\nposthog:execute-sql\nSELECT\n    toString(uuid) as generation_id,\n    toFloat(properties.$ai_total_cost_usd) as cost,\n    toFloat(properties.$ai_latency) as latency,\n    toInt(properties.$ai_input_tokens) as input_tokens,\n    toInt(properties.$ai_output_tokens) as output_tokens,\n    if(properties.$ai_is_error = 'true', 1, 0) as is_error\nFROM events\nWHERE event = '$ai_generation'\n    AND timestamp >= parseDateTimeBestEffort('\u003Cwindow_start>')\n    AND timestamp \u003C= parseDateTimeBestEffort('\u003Cwindow_end>')\n    AND uuid IN ('\u003Cgen_uuid_1>', '\u003Cgen_uuid_2>', ...)\n```\n\nFor evaluation-level clusters, first check each cluster's `metrics` field from `$ai_clusters` (for example pass rate, N\u002FA rate, dominant evaluator name, and average judge cost). When you need individual evaluation rows, match by event UUID:\n\n```sql\nposthog:execute-sql\nSELECT\n    toString(uuid) AS evaluation_id,\n    toString(properties.$ai_trace_id) AS trace_id,\n    toString(properties.$ai_target_event_id) AS generation_id,\n    toString(properties.$ai_evaluation_name) AS evaluation_name,\n    toString(properties.$ai_evaluation_result) AS evaluation_result,\n    toString(properties.$ai_evaluation_reasoning) AS evaluation_reasoning,\n    toFloatOrNull(toString(properties.$ai_total_cost_usd)) AS judge_cost,\n    timestamp\nFROM events\nWHERE event = '$ai_evaluation'\n    AND timestamp >= parseDateTimeBestEffort('\u003Cwindow_start>')\n    AND timestamp \u003C= parseDateTimeBestEffort('\u003Cwindow_end>')\n    AND uuid IN ('\u003Ceval_uuid_1>', '\u003Ceval_uuid_2>', ...)\n```\n\n### Step 4 — Drill into specific traces\n\nOnce you've identified interesting clusters, use the trace tools to inspect individual traces:\n\n```json\nposthog:query-llm-trace\n{\n  \"traceId\": \"\u003Ctrace_id_from_cluster>\",\n  \"dateRange\": {\"date_from\": \"\u003Cwindow_start>\", \"date_to\": \"\u003Cwindow_end>\"}\n}\n```\n\n### When you need message content\n\nUse `events` for cluster events, IDs, cost\u002Flatency\u002Ftoken metrics, and evaluation rows.\nDo **not** query `events.properties.$ai_input`, `$ai_output`, or `$ai_output_choices` when you need user messages or full model inputs\u002Foutputs —\nthose heavy fields live on `posthog.ai_events`.\n\nFor a few representative examples, prefer `query-llm-trace`; it reads `posthog.ai_events` for you and returns the full event tree.\nFor batch extraction, first get the trace IDs from the cluster, then query `posthog.ai_events` anchored on `trace_id`:\n\n```sql\nposthog:execute-sql\nSELECT\n    trace_id,\n    timestamp,\n    span_id,\n    event,\n    model,\n    input,\n    output_choices\nFROM posthog.ai_events\nWHERE trace_id IN ('\u003Ctrace_id_1>', '\u003Ctrace_id_2>', ...)\nORDER BY trace_id, timestamp\n```\n\n`posthog.ai_events` has a shorter retention window than `events`; older clusters may still have metadata and metrics but no message content.\nFor more detail, use the exploring LLM traces skill's [event reference](..\u002Fexploring-llm-traces\u002Freferences\u002Fevents-and-properties.md).\n\n## Investigation patterns\n\n### \"What kinds of LLM usage do we have?\"\n\n1. List recent clustering runs (Step 1)\n2. Load the latest run's clusters (Step 2)\n3. Review cluster titles and descriptions — each represents a distinct usage pattern\n4. Compare cluster sizes to understand traffic distribution\n\n### \"Which cluster is most expensive \u002F slowest?\"\n\n1. Load clusters from a run (Step 2)\n2. Extract trace IDs from each cluster\n3. Compute metrics per cluster (Step 3)\n4. Aggregate: `avg(cost)`, `avg(latency)`, `sum(cost)` per cluster\n5. Compare across clusters\n\n### \"What's in this cluster?\"\n\n1. Load the cluster's traces (from the `traces` field)\n2. Sort by `rank` (closest to centroid = most representative)\n3. Inspect the top 3-5 traces via `query-llm-trace` to understand the pattern\n4. Check the cluster `title` and `description` for the AI-generated summary\n\n### \"Are there error-heavy clusters?\"\n\n1. Compute metrics (Step 3) with `error_count`\n2. Calculate error rate per cluster: `items_with_errors \u002F total_items`\n3. Focus on clusters with high error rates\n4. Drill into errored traces to find root causes\n\n### \"How do clusters compare across runs?\"\n\n1. List multiple runs (Step 1)\n2. Load clusters from each run\n3. Compare cluster titles — similar titles across runs indicate stable patterns\n4. Track cluster size changes to detect shifts in traffic patterns\n\n## Constructing UI links\n\n- **Clusters overview**: `https:\u002F\u002Fapp.posthog.com\u002Fai-observability\u002Fclusters`\n- **Specific run**: `https:\u002F\u002Fapp.posthog.com\u002Fai-observability\u002Fclusters\u002F\u003Curl_encoded_run_id>`\n- **Cluster detail**: `https:\u002F\u002Fapp.posthog.com\u002Fai-observability\u002Fclusters\u002F\u003Curl_encoded_run_id>\u002F\u003Ccluster_id>`\n\nAlways surface these links so the user can verify visually in the PostHog UI.\n\n## Tips\n\n- Always set a time range in SQL queries — cluster events without time bounds are slow\n- Start with run listing to orient, then drill into specific clusters\n- Cluster titles and descriptions are AI-generated summaries — verify by inspecting traces\n- The noise cluster (`cluster_id: -1`) contains outliers that didn't fit any pattern\n- Use `llma-clustering-job-list` to understand what clustering configs are active\n- Trace IDs in clusters can be used directly with `query-llm-trace` for deep inspection\n- Message content lives on `posthog.ai_events`, not `events.properties`; use `query-llm-trace` unless you need custom batch SQL\n- For large clusters, inspect the top-ranked traces (closest to centroid) for representative examples\n",{"data":39,"body":40},{"name":4,"description":6},{"type":41,"children":42},"root",[43,51,57,64,178,184,213,218,327,340,873,933,939,944,1003,1031,1037,1043,1172,1178,1324,1352,1379,1385,1390,1504,1509,1615,1634,1755,1761,1766,1927,1933,1983,2016,2117,2141,2147,2153,2177,2183,2233,2239,2297,2303,2338,2344,2367,2373,2422,2427,2433,2519],{"type":44,"tag":45,"props":46,"children":47},"element","h1",{"id":4},[48],{"type":49,"value":50},"text","Exploring LLM clusters",{"type":44,"tag":52,"props":53,"children":54},"p",{},[55],{"type":49,"value":56},"Use this skill when investigating AI observability clusters —\nunderstanding what patterns exist in your AI\u002FLLM traffic,\ncomparing cluster behavior, and drilling into individual clusters.",{"type":44,"tag":58,"props":59,"children":61},"h2",{"id":60},"tools",[62],{"type":49,"value":63},"Tools",{"type":44,"tag":65,"props":66,"children":67},"table",{},[68,87],{"type":44,"tag":69,"props":70,"children":71},"thead",{},[72],{"type":44,"tag":73,"props":74,"children":75},"tr",{},[76,82],{"type":44,"tag":77,"props":78,"children":79},"th",{},[80],{"type":49,"value":81},"Tool",{"type":44,"tag":77,"props":83,"children":84},{},[85],{"type":49,"value":86},"Purpose",{"type":44,"tag":88,"props":89,"children":90},"tbody",{},[91,110,127,144,161],{"type":44,"tag":73,"props":92,"children":93},{},[94,105],{"type":44,"tag":95,"props":96,"children":97},"td",{},[98],{"type":44,"tag":99,"props":100,"children":102},"code",{"className":101},[],[103],{"type":49,"value":104},"posthog:llma-clustering-job-list",{"type":44,"tag":95,"props":106,"children":107},{},[108],{"type":49,"value":109},"List clustering job configurations for the team",{"type":44,"tag":73,"props":111,"children":112},{},[113,122],{"type":44,"tag":95,"props":114,"children":115},{},[116],{"type":44,"tag":99,"props":117,"children":119},{"className":118},[],[120],{"type":49,"value":121},"posthog:llma-clustering-job-get",{"type":44,"tag":95,"props":123,"children":124},{},[125],{"type":49,"value":126},"Get a specific clustering job by ID",{"type":44,"tag":73,"props":128,"children":129},{},[130,139],{"type":44,"tag":95,"props":131,"children":132},{},[133],{"type":44,"tag":99,"props":134,"children":136},{"className":135},[],[137],{"type":49,"value":138},"posthog:execute-sql",{"type":44,"tag":95,"props":140,"children":141},{},[142],{"type":49,"value":143},"Query cluster run events and compute metrics",{"type":44,"tag":73,"props":145,"children":146},{},[147,156],{"type":44,"tag":95,"props":148,"children":149},{},[150],{"type":44,"tag":99,"props":151,"children":153},{"className":152},[],[154],{"type":49,"value":155},"posthog:query-llm-traces-list",{"type":44,"tag":95,"props":157,"children":158},{},[159],{"type":49,"value":160},"Find traces belonging to a cluster",{"type":44,"tag":73,"props":162,"children":163},{},[164,173],{"type":44,"tag":95,"props":165,"children":166},{},[167],{"type":44,"tag":99,"props":168,"children":170},{"className":169},[],[171],{"type":49,"value":172},"posthog:query-llm-trace",{"type":44,"tag":95,"props":174,"children":175},{},[176],{"type":49,"value":177},"Inspect a specific trace in detail",{"type":44,"tag":58,"props":179,"children":181},{"id":180},"how-clustering-works",[182],{"type":49,"value":183},"How clustering works",{"type":44,"tag":52,"props":185,"children":186},{},[187,189,195,197,203,205,211],{"type":49,"value":188},"PostHog clusters LLM traces, individual generations, or evaluation events by embedding similarity.\nA Temporal workflow runs periodically or on-demand, producing cluster events stored as\n",{"type":44,"tag":99,"props":190,"children":192},{"className":191},[],[193],{"type":49,"value":194},"$ai_trace_clusters",{"type":49,"value":196}," (trace-level), ",{"type":44,"tag":99,"props":198,"children":200},{"className":199},[],[201],{"type":49,"value":202},"$ai_generation_clusters",{"type":49,"value":204}," (generation-level), or\n",{"type":44,"tag":99,"props":206,"children":208},{"className":207},[],[209],{"type":49,"value":210},"$ai_evaluation_clusters",{"type":49,"value":212}," (evaluation-level).",{"type":44,"tag":52,"props":214,"children":215},{},[216],{"type":49,"value":217},"Each cluster event contains:",{"type":44,"tag":219,"props":220,"children":221},"ul",{},[222,242,275,294,305,316],{"type":44,"tag":223,"props":224,"children":225},"li",{},[226,232,234,240],{"type":44,"tag":99,"props":227,"children":229},{"className":228},[],[230],{"type":49,"value":231},"$ai_clustering_run_id",{"type":49,"value":233}," — unique run identifier (format: ",{"type":44,"tag":99,"props":235,"children":237},{"className":236},[],[238],{"type":49,"value":239},"\u003Cteam_id>_\u003Clevel>_\u003CYYYYMMDD>_\u003CHHMMSS>[_\u003Cjob_id>]",{"type":49,"value":241},")",{"type":44,"tag":223,"props":243,"children":244},{},[245,251,253,259,261,267,269],{"type":44,"tag":99,"props":246,"children":248},{"className":247},[],[249],{"type":49,"value":250},"$ai_clustering_level",{"type":49,"value":252}," — ",{"type":44,"tag":99,"props":254,"children":256},{"className":255},[],[257],{"type":49,"value":258},"\"trace\"",{"type":49,"value":260},", ",{"type":44,"tag":99,"props":262,"children":264},{"className":263},[],[265],{"type":49,"value":266},"\"generation\"",{"type":49,"value":268},", or ",{"type":44,"tag":99,"props":270,"children":272},{"className":271},[],[273],{"type":49,"value":274},"\"evaluation\"",{"type":44,"tag":223,"props":276,"children":277},{},[278,284,286,292],{"type":44,"tag":99,"props":279,"children":281},{"className":280},[],[282],{"type":49,"value":283},"$ai_window_start",{"type":49,"value":285}," \u002F ",{"type":44,"tag":99,"props":287,"children":289},{"className":288},[],[290],{"type":49,"value":291},"$ai_window_end",{"type":49,"value":293}," — time window analyzed",{"type":44,"tag":223,"props":295,"children":296},{},[297,303],{"type":44,"tag":99,"props":298,"children":300},{"className":299},[],[301],{"type":49,"value":302},"$ai_total_items_analyzed",{"type":49,"value":304}," — number of traces, generations, or evaluations processed",{"type":44,"tag":223,"props":306,"children":307},{},[308,314],{"type":44,"tag":99,"props":309,"children":311},{"className":310},[],[312],{"type":49,"value":313},"$ai_clusters",{"type":49,"value":315}," — JSON array of cluster objects",{"type":44,"tag":223,"props":317,"children":318},{},[319,325],{"type":44,"tag":99,"props":320,"children":322},{"className":321},[],[323],{"type":49,"value":324},"$ai_clustering_params",{"type":49,"value":326}," — algorithm parameters used",{"type":44,"tag":328,"props":329,"children":331},"h3",{"id":330},"cluster-object-shape-inside-ai_clusters",[332,334,339],{"type":49,"value":333},"Cluster object shape (inside ",{"type":44,"tag":99,"props":335,"children":337},{"className":336},[],[338],{"type":49,"value":313},{"type":49,"value":241},{"type":44,"tag":341,"props":342,"children":347},"pre",{"className":343,"code":344,"language":345,"meta":346,"style":346},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"cluster_id\": 0,\n  \"size\": 42,\n  \"title\": \"User authentication flows\",\n  \"description\": \"Traces involving login, signup, and token refresh operations\",\n  \"traces\": {\n    \"\u003Ctrace_or_generation_id>\": {\n      \"distance_to_centroid\": 0.123,\n      \"rank\": 0,\n      \"x\": -2.34,\n      \"y\": 1.56,\n      \"timestamp\": \"2026-03-28T10:00:00Z\",\n      \"trace_id\": \"abc-123\",\n      \"generation_id\": \"gen-456\"\n    }\n  },\n  \"centroid_x\": -2.1,\n  \"centroid_y\": 1.4\n}\n","json","",[348],{"type":44,"tag":99,"props":349,"children":350},{"__ignoreMap":346},[351,363,399,429,469,507,533,560,591,620,650,679,717,755,790,799,808,838,864],{"type":44,"tag":352,"props":353,"children":356},"span",{"class":354,"line":355},"line",1,[357],{"type":44,"tag":352,"props":358,"children":360},{"style":359},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[361],{"type":49,"value":362},"{\n",{"type":44,"tag":352,"props":364,"children":366},{"class":354,"line":365},2,[367,372,378,383,388,394],{"type":44,"tag":352,"props":368,"children":369},{"style":359},[370],{"type":49,"value":371},"  \"",{"type":44,"tag":352,"props":373,"children":375},{"style":374},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[376],{"type":49,"value":377},"cluster_id",{"type":44,"tag":352,"props":379,"children":380},{"style":359},[381],{"type":49,"value":382},"\"",{"type":44,"tag":352,"props":384,"children":385},{"style":359},[386],{"type":49,"value":387},":",{"type":44,"tag":352,"props":389,"children":391},{"style":390},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[392],{"type":49,"value":393}," 0",{"type":44,"tag":352,"props":395,"children":396},{"style":359},[397],{"type":49,"value":398},",\n",{"type":44,"tag":352,"props":400,"children":402},{"class":354,"line":401},3,[403,407,412,416,420,425],{"type":44,"tag":352,"props":404,"children":405},{"style":359},[406],{"type":49,"value":371},{"type":44,"tag":352,"props":408,"children":409},{"style":374},[410],{"type":49,"value":411},"size",{"type":44,"tag":352,"props":413,"children":414},{"style":359},[415],{"type":49,"value":382},{"type":44,"tag":352,"props":417,"children":418},{"style":359},[419],{"type":49,"value":387},{"type":44,"tag":352,"props":421,"children":422},{"style":390},[423],{"type":49,"value":424}," 42",{"type":44,"tag":352,"props":426,"children":427},{"style":359},[428],{"type":49,"value":398},{"type":44,"tag":352,"props":430,"children":432},{"class":354,"line":431},4,[433,437,442,446,450,455,461,465],{"type":44,"tag":352,"props":434,"children":435},{"style":359},[436],{"type":49,"value":371},{"type":44,"tag":352,"props":438,"children":439},{"style":374},[440],{"type":49,"value":441},"title",{"type":44,"tag":352,"props":443,"children":444},{"style":359},[445],{"type":49,"value":382},{"type":44,"tag":352,"props":447,"children":448},{"style":359},[449],{"type":49,"value":387},{"type":44,"tag":352,"props":451,"children":452},{"style":359},[453],{"type":49,"value":454}," \"",{"type":44,"tag":352,"props":456,"children":458},{"style":457},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[459],{"type":49,"value":460},"User authentication flows",{"type":44,"tag":352,"props":462,"children":463},{"style":359},[464],{"type":49,"value":382},{"type":44,"tag":352,"props":466,"children":467},{"style":359},[468],{"type":49,"value":398},{"type":44,"tag":352,"props":470,"children":472},{"class":354,"line":471},5,[473,477,482,486,490,494,499,503],{"type":44,"tag":352,"props":474,"children":475},{"style":359},[476],{"type":49,"value":371},{"type":44,"tag":352,"props":478,"children":479},{"style":374},[480],{"type":49,"value":481},"description",{"type":44,"tag":352,"props":483,"children":484},{"style":359},[485],{"type":49,"value":382},{"type":44,"tag":352,"props":487,"children":488},{"style":359},[489],{"type":49,"value":387},{"type":44,"tag":352,"props":491,"children":492},{"style":359},[493],{"type":49,"value":454},{"type":44,"tag":352,"props":495,"children":496},{"style":457},[497],{"type":49,"value":498},"Traces involving login, signup, and token refresh operations",{"type":44,"tag":352,"props":500,"children":501},{"style":359},[502],{"type":49,"value":382},{"type":44,"tag":352,"props":504,"children":505},{"style":359},[506],{"type":49,"value":398},{"type":44,"tag":352,"props":508,"children":510},{"class":354,"line":509},6,[511,515,520,524,528],{"type":44,"tag":352,"props":512,"children":513},{"style":359},[514],{"type":49,"value":371},{"type":44,"tag":352,"props":516,"children":517},{"style":374},[518],{"type":49,"value":519},"traces",{"type":44,"tag":352,"props":521,"children":522},{"style":359},[523],{"type":49,"value":382},{"type":44,"tag":352,"props":525,"children":526},{"style":359},[527],{"type":49,"value":387},{"type":44,"tag":352,"props":529,"children":530},{"style":359},[531],{"type":49,"value":532}," {\n",{"type":44,"tag":352,"props":534,"children":536},{"class":354,"line":535},7,[537,542,548,552,556],{"type":44,"tag":352,"props":538,"children":539},{"style":359},[540],{"type":49,"value":541},"    \"",{"type":44,"tag":352,"props":543,"children":545},{"style":544},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[546],{"type":49,"value":547},"\u003Ctrace_or_generation_id>",{"type":44,"tag":352,"props":549,"children":550},{"style":359},[551],{"type":49,"value":382},{"type":44,"tag":352,"props":553,"children":554},{"style":359},[555],{"type":49,"value":387},{"type":44,"tag":352,"props":557,"children":558},{"style":359},[559],{"type":49,"value":532},{"type":44,"tag":352,"props":561,"children":563},{"class":354,"line":562},8,[564,569,574,578,582,587],{"type":44,"tag":352,"props":565,"children":566},{"style":359},[567],{"type":49,"value":568},"      \"",{"type":44,"tag":352,"props":570,"children":571},{"style":390},[572],{"type":49,"value":573},"distance_to_centroid",{"type":44,"tag":352,"props":575,"children":576},{"style":359},[577],{"type":49,"value":382},{"type":44,"tag":352,"props":579,"children":580},{"style":359},[581],{"type":49,"value":387},{"type":44,"tag":352,"props":583,"children":584},{"style":390},[585],{"type":49,"value":586}," 0.123",{"type":44,"tag":352,"props":588,"children":589},{"style":359},[590],{"type":49,"value":398},{"type":44,"tag":352,"props":592,"children":594},{"class":354,"line":593},9,[595,599,604,608,612,616],{"type":44,"tag":352,"props":596,"children":597},{"style":359},[598],{"type":49,"value":568},{"type":44,"tag":352,"props":600,"children":601},{"style":390},[602],{"type":49,"value":603},"rank",{"type":44,"tag":352,"props":605,"children":606},{"style":359},[607],{"type":49,"value":382},{"type":44,"tag":352,"props":609,"children":610},{"style":359},[611],{"type":49,"value":387},{"type":44,"tag":352,"props":613,"children":614},{"style":390},[615],{"type":49,"value":393},{"type":44,"tag":352,"props":617,"children":618},{"style":359},[619],{"type":49,"value":398},{"type":44,"tag":352,"props":621,"children":623},{"class":354,"line":622},10,[624,628,633,637,641,646],{"type":44,"tag":352,"props":625,"children":626},{"style":359},[627],{"type":49,"value":568},{"type":44,"tag":352,"props":629,"children":630},{"style":390},[631],{"type":49,"value":632},"x",{"type":44,"tag":352,"props":634,"children":635},{"style":359},[636],{"type":49,"value":382},{"type":44,"tag":352,"props":638,"children":639},{"style":359},[640],{"type":49,"value":387},{"type":44,"tag":352,"props":642,"children":643},{"style":390},[644],{"type":49,"value":645}," -2.34",{"type":44,"tag":352,"props":647,"children":648},{"style":359},[649],{"type":49,"value":398},{"type":44,"tag":352,"props":651,"children":652},{"class":354,"line":27},[653,657,662,666,670,675],{"type":44,"tag":352,"props":654,"children":655},{"style":359},[656],{"type":49,"value":568},{"type":44,"tag":352,"props":658,"children":659},{"style":390},[660],{"type":49,"value":661},"y",{"type":44,"tag":352,"props":663,"children":664},{"style":359},[665],{"type":49,"value":382},{"type":44,"tag":352,"props":667,"children":668},{"style":359},[669],{"type":49,"value":387},{"type":44,"tag":352,"props":671,"children":672},{"style":390},[673],{"type":49,"value":674}," 1.56",{"type":44,"tag":352,"props":676,"children":677},{"style":359},[678],{"type":49,"value":398},{"type":44,"tag":352,"props":680,"children":682},{"class":354,"line":681},12,[683,687,692,696,700,704,709,713],{"type":44,"tag":352,"props":684,"children":685},{"style":359},[686],{"type":49,"value":568},{"type":44,"tag":352,"props":688,"children":689},{"style":390},[690],{"type":49,"value":691},"timestamp",{"type":44,"tag":352,"props":693,"children":694},{"style":359},[695],{"type":49,"value":382},{"type":44,"tag":352,"props":697,"children":698},{"style":359},[699],{"type":49,"value":387},{"type":44,"tag":352,"props":701,"children":702},{"style":359},[703],{"type":49,"value":454},{"type":44,"tag":352,"props":705,"children":706},{"style":457},[707],{"type":49,"value":708},"2026-03-28T10:00:00Z",{"type":44,"tag":352,"props":710,"children":711},{"style":359},[712],{"type":49,"value":382},{"type":44,"tag":352,"props":714,"children":715},{"style":359},[716],{"type":49,"value":398},{"type":44,"tag":352,"props":718,"children":720},{"class":354,"line":719},13,[721,725,730,734,738,742,747,751],{"type":44,"tag":352,"props":722,"children":723},{"style":359},[724],{"type":49,"value":568},{"type":44,"tag":352,"props":726,"children":727},{"style":390},[728],{"type":49,"value":729},"trace_id",{"type":44,"tag":352,"props":731,"children":732},{"style":359},[733],{"type":49,"value":382},{"type":44,"tag":352,"props":735,"children":736},{"style":359},[737],{"type":49,"value":387},{"type":44,"tag":352,"props":739,"children":740},{"style":359},[741],{"type":49,"value":454},{"type":44,"tag":352,"props":743,"children":744},{"style":457},[745],{"type":49,"value":746},"abc-123",{"type":44,"tag":352,"props":748,"children":749},{"style":359},[750],{"type":49,"value":382},{"type":44,"tag":352,"props":752,"children":753},{"style":359},[754],{"type":49,"value":398},{"type":44,"tag":352,"props":756,"children":758},{"class":354,"line":757},14,[759,763,768,772,776,780,785],{"type":44,"tag":352,"props":760,"children":761},{"style":359},[762],{"type":49,"value":568},{"type":44,"tag":352,"props":764,"children":765},{"style":390},[766],{"type":49,"value":767},"generation_id",{"type":44,"tag":352,"props":769,"children":770},{"style":359},[771],{"type":49,"value":382},{"type":44,"tag":352,"props":773,"children":774},{"style":359},[775],{"type":49,"value":387},{"type":44,"tag":352,"props":777,"children":778},{"style":359},[779],{"type":49,"value":454},{"type":44,"tag":352,"props":781,"children":782},{"style":457},[783],{"type":49,"value":784},"gen-456",{"type":44,"tag":352,"props":786,"children":787},{"style":359},[788],{"type":49,"value":789},"\"\n",{"type":44,"tag":352,"props":791,"children":793},{"class":354,"line":792},15,[794],{"type":44,"tag":352,"props":795,"children":796},{"style":359},[797],{"type":49,"value":798},"    }\n",{"type":44,"tag":352,"props":800,"children":802},{"class":354,"line":801},16,[803],{"type":44,"tag":352,"props":804,"children":805},{"style":359},[806],{"type":49,"value":807},"  },\n",{"type":44,"tag":352,"props":809,"children":811},{"class":354,"line":810},17,[812,816,821,825,829,834],{"type":44,"tag":352,"props":813,"children":814},{"style":359},[815],{"type":49,"value":371},{"type":44,"tag":352,"props":817,"children":818},{"style":374},[819],{"type":49,"value":820},"centroid_x",{"type":44,"tag":352,"props":822,"children":823},{"style":359},[824],{"type":49,"value":382},{"type":44,"tag":352,"props":826,"children":827},{"style":359},[828],{"type":49,"value":387},{"type":44,"tag":352,"props":830,"children":831},{"style":390},[832],{"type":49,"value":833}," -2.1",{"type":44,"tag":352,"props":835,"children":836},{"style":359},[837],{"type":49,"value":398},{"type":44,"tag":352,"props":839,"children":841},{"class":354,"line":840},18,[842,846,851,855,859],{"type":44,"tag":352,"props":843,"children":844},{"style":359},[845],{"type":49,"value":371},{"type":44,"tag":352,"props":847,"children":848},{"style":374},[849],{"type":49,"value":850},"centroid_y",{"type":44,"tag":352,"props":852,"children":853},{"style":359},[854],{"type":49,"value":382},{"type":44,"tag":352,"props":856,"children":857},{"style":359},[858],{"type":49,"value":387},{"type":44,"tag":352,"props":860,"children":861},{"style":390},[862],{"type":49,"value":863}," 1.4\n",{"type":44,"tag":352,"props":865,"children":867},{"class":354,"line":866},19,[868],{"type":44,"tag":352,"props":869,"children":870},{"style":359},[871],{"type":49,"value":872},"}\n",{"type":44,"tag":219,"props":874,"children":875},{},[876,895,907,917],{"type":44,"tag":223,"props":877,"children":878},{},[879,885,887,893],{"type":44,"tag":99,"props":880,"children":882},{"className":881},[],[883],{"type":49,"value":884},"cluster_id: -1",{"type":49,"value":886}," is the ",{"type":44,"tag":888,"props":889,"children":890},"strong",{},[891],{"type":49,"value":892},"noise\u002Foutlier",{"type":49,"value":894}," cluster (items that didn't fit any cluster)",{"type":44,"tag":223,"props":896,"children":897},{},[898,900,905],{"type":49,"value":899},"Items in ",{"type":44,"tag":99,"props":901,"children":903},{"className":902},[],[904],{"type":49,"value":519},{"type":49,"value":906}," are keyed by trace ID (trace-level), generation event UUID (generation-level), or evaluation event UUID (evaluation-level)",{"type":44,"tag":223,"props":908,"children":909},{},[910,915],{"type":44,"tag":99,"props":911,"children":913},{"className":912},[],[914],{"type":49,"value":603},{"type":49,"value":916}," orders items by proximity to centroid (0 = closest)",{"type":44,"tag":223,"props":918,"children":919},{},[920,925,926,931],{"type":44,"tag":99,"props":921,"children":923},{"className":922},[],[924],{"type":49,"value":632},{"type":49,"value":260},{"type":44,"tag":99,"props":927,"children":929},{"className":928},[],[930],{"type":49,"value":661},{"type":49,"value":932}," are 2D coordinates for visualization (UMAP\u002FPCA\u002Ft-SNE reduced)",{"type":44,"tag":58,"props":934,"children":936},{"id":935},"clustering-jobs",[937],{"type":49,"value":938},"Clustering jobs",{"type":44,"tag":52,"props":940,"children":941},{},[942],{"type":49,"value":943},"Each team can have up to 10 clustering jobs. A job defines:",{"type":44,"tag":219,"props":945,"children":946},{},[947,957,983,993],{"type":44,"tag":223,"props":948,"children":949},{},[950,955],{"type":44,"tag":888,"props":951,"children":952},{},[953],{"type":49,"value":954},"name",{"type":49,"value":956}," — human-readable label",{"type":44,"tag":223,"props":958,"children":959},{},[960,965,966,971,972,977,978],{"type":44,"tag":888,"props":961,"children":962},{},[963],{"type":49,"value":964},"analysis_level",{"type":49,"value":252},{"type":44,"tag":99,"props":967,"children":969},{"className":968},[],[970],{"type":49,"value":258},{"type":49,"value":260},{"type":44,"tag":99,"props":973,"children":975},{"className":974},[],[976],{"type":49,"value":266},{"type":49,"value":268},{"type":44,"tag":99,"props":979,"children":981},{"className":980},[],[982],{"type":49,"value":274},{"type":44,"tag":223,"props":984,"children":985},{},[986,991],{"type":44,"tag":888,"props":987,"children":988},{},[989],{"type":49,"value":990},"event_filters",{"type":49,"value":992}," — property filters scoping which items are included",{"type":44,"tag":223,"props":994,"children":995},{},[996,1001],{"type":44,"tag":888,"props":997,"children":998},{},[999],{"type":49,"value":1000},"enabled",{"type":49,"value":1002}," — whether the job runs on schedule",{"type":44,"tag":52,"props":1004,"children":1005},{},[1006,1008,1014,1015,1021,1023,1029],{"type":49,"value":1007},"Default jobs named ",{"type":44,"tag":99,"props":1009,"children":1011},{"className":1010},[],[1012],{"type":49,"value":1013},"\"Default - traces\"",{"type":49,"value":260},{"type":44,"tag":99,"props":1016,"children":1018},{"className":1017},[],[1019],{"type":49,"value":1020},"\"Default - generations\"",{"type":49,"value":1022},", and ",{"type":44,"tag":99,"props":1024,"children":1026},{"className":1025},[],[1027],{"type":49,"value":1028},"\"Default - evaluations\"",{"type":49,"value":1030}," are auto-created\nand disabled when a custom job is created for the same level.",{"type":44,"tag":58,"props":1032,"children":1034},{"id":1033},"workflow-explore-clusters",[1035],{"type":49,"value":1036},"Workflow: explore clusters",{"type":44,"tag":328,"props":1038,"children":1040},{"id":1039},"step-1-list-recent-clustering-runs",[1041],{"type":49,"value":1042},"Step 1 — List recent clustering runs",{"type":44,"tag":341,"props":1044,"children":1048},{"className":1045,"code":1046,"language":1047,"meta":346,"style":346},"language-sql shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","posthog:execute-sql\nSELECT\n    toString(properties.$ai_clustering_run_id) AS run_id,\n    toString(properties.$ai_clustering_level) AS level,\n    toString(properties.$ai_clustering_job_id) AS job_id,\n    toString(properties.$ai_clustering_job_name) AS job_name,\n    toString(properties.$ai_window_start) AS window_start,\n    toString(properties.$ai_window_end) AS window_end,\n    toFloat64OrNull(toString(properties.$ai_total_items_analyzed)) AS total_items,\n    timestamp\nFROM events\nWHERE event IN ('$ai_trace_clusters', '$ai_generation_clusters', '$ai_evaluation_clusters')\n    AND timestamp >= now() - INTERVAL 14 DAY\nORDER BY timestamp DESC\nLIMIT 10\n","sql",[1049],{"type":44,"tag":99,"props":1050,"children":1051},{"__ignoreMap":346},[1052,1060,1068,1076,1084,1092,1100,1108,1116,1124,1132,1140,1148,1156,1164],{"type":44,"tag":352,"props":1053,"children":1054},{"class":354,"line":355},[1055],{"type":44,"tag":352,"props":1056,"children":1057},{},[1058],{"type":49,"value":1059},"posthog:execute-sql\n",{"type":44,"tag":352,"props":1061,"children":1062},{"class":354,"line":365},[1063],{"type":44,"tag":352,"props":1064,"children":1065},{},[1066],{"type":49,"value":1067},"SELECT\n",{"type":44,"tag":352,"props":1069,"children":1070},{"class":354,"line":401},[1071],{"type":44,"tag":352,"props":1072,"children":1073},{},[1074],{"type":49,"value":1075},"    toString(properties.$ai_clustering_run_id) AS run_id,\n",{"type":44,"tag":352,"props":1077,"children":1078},{"class":354,"line":431},[1079],{"type":44,"tag":352,"props":1080,"children":1081},{},[1082],{"type":49,"value":1083},"    toString(properties.$ai_clustering_level) AS level,\n",{"type":44,"tag":352,"props":1085,"children":1086},{"class":354,"line":471},[1087],{"type":44,"tag":352,"props":1088,"children":1089},{},[1090],{"type":49,"value":1091},"    toString(properties.$ai_clustering_job_id) AS job_id,\n",{"type":44,"tag":352,"props":1093,"children":1094},{"class":354,"line":509},[1095],{"type":44,"tag":352,"props":1096,"children":1097},{},[1098],{"type":49,"value":1099},"    toString(properties.$ai_clustering_job_name) AS job_name,\n",{"type":44,"tag":352,"props":1101,"children":1102},{"class":354,"line":535},[1103],{"type":44,"tag":352,"props":1104,"children":1105},{},[1106],{"type":49,"value":1107},"    toString(properties.$ai_window_start) AS window_start,\n",{"type":44,"tag":352,"props":1109,"children":1110},{"class":354,"line":562},[1111],{"type":44,"tag":352,"props":1112,"children":1113},{},[1114],{"type":49,"value":1115},"    toString(properties.$ai_window_end) AS window_end,\n",{"type":44,"tag":352,"props":1117,"children":1118},{"class":354,"line":593},[1119],{"type":44,"tag":352,"props":1120,"children":1121},{},[1122],{"type":49,"value":1123},"    toFloat64OrNull(toString(properties.$ai_total_items_analyzed)) AS total_items,\n",{"type":44,"tag":352,"props":1125,"children":1126},{"class":354,"line":622},[1127],{"type":44,"tag":352,"props":1128,"children":1129},{},[1130],{"type":49,"value":1131},"    timestamp\n",{"type":44,"tag":352,"props":1133,"children":1134},{"class":354,"line":27},[1135],{"type":44,"tag":352,"props":1136,"children":1137},{},[1138],{"type":49,"value":1139},"FROM events\n",{"type":44,"tag":352,"props":1141,"children":1142},{"class":354,"line":681},[1143],{"type":44,"tag":352,"props":1144,"children":1145},{},[1146],{"type":49,"value":1147},"WHERE event IN ('$ai_trace_clusters', '$ai_generation_clusters', '$ai_evaluation_clusters')\n",{"type":44,"tag":352,"props":1149,"children":1150},{"class":354,"line":719},[1151],{"type":44,"tag":352,"props":1152,"children":1153},{},[1154],{"type":49,"value":1155},"    AND timestamp >= now() - INTERVAL 14 DAY\n",{"type":44,"tag":352,"props":1157,"children":1158},{"class":354,"line":757},[1159],{"type":44,"tag":352,"props":1160,"children":1161},{},[1162],{"type":49,"value":1163},"ORDER BY timestamp DESC\n",{"type":44,"tag":352,"props":1165,"children":1166},{"class":354,"line":792},[1167],{"type":44,"tag":352,"props":1168,"children":1169},{},[1170],{"type":49,"value":1171},"LIMIT 10\n",{"type":44,"tag":328,"props":1173,"children":1175},{"id":1174},"step-2-get-clusters-from-a-specific-run",[1176],{"type":49,"value":1177},"Step 2 — Get clusters from a specific run",{"type":44,"tag":341,"props":1179,"children":1181},{"className":1045,"code":1180,"language":1047,"meta":346,"style":346},"posthog:execute-sql\nSELECT\n    toString(properties.$ai_clustering_run_id) AS run_id,\n    toString(properties.$ai_clustering_level) AS level,\n    toString(properties.$ai_clustering_job_id) AS job_id,\n    toString(properties.$ai_clustering_job_name) AS job_name,\n    toString(properties.$ai_window_start) AS window_start,\n    toString(properties.$ai_window_end) AS window_end,\n    toFloat64OrNull(toString(properties.$ai_total_items_analyzed)) AS total_items,\n    properties.$ai_clusters AS clusters,\n    properties.$ai_clustering_params AS params,\n    timestamp\nFROM events\nWHERE event IN ('$ai_trace_clusters', '$ai_generation_clusters', '$ai_evaluation_clusters')\n    AND timestamp >= parseDateTimeBestEffort('\u003Cwindow_start>')\n    AND timestamp \u003C= parseDateTimeBestEffort('\u003Cwindow_end>')\n    AND toString(properties.$ai_clustering_run_id) = '\u003Crun_id>'\nORDER BY timestamp DESC\nLIMIT 1\n",[1182],{"type":44,"tag":99,"props":1183,"children":1184},{"__ignoreMap":346},[1185,1192,1199,1206,1213,1220,1227,1234,1241,1248,1256,1264,1271,1278,1285,1293,1301,1309,1316],{"type":44,"tag":352,"props":1186,"children":1187},{"class":354,"line":355},[1188],{"type":44,"tag":352,"props":1189,"children":1190},{},[1191],{"type":49,"value":1059},{"type":44,"tag":352,"props":1193,"children":1194},{"class":354,"line":365},[1195],{"type":44,"tag":352,"props":1196,"children":1197},{},[1198],{"type":49,"value":1067},{"type":44,"tag":352,"props":1200,"children":1201},{"class":354,"line":401},[1202],{"type":44,"tag":352,"props":1203,"children":1204},{},[1205],{"type":49,"value":1075},{"type":44,"tag":352,"props":1207,"children":1208},{"class":354,"line":431},[1209],{"type":44,"tag":352,"props":1210,"children":1211},{},[1212],{"type":49,"value":1083},{"type":44,"tag":352,"props":1214,"children":1215},{"class":354,"line":471},[1216],{"type":44,"tag":352,"props":1217,"children":1218},{},[1219],{"type":49,"value":1091},{"type":44,"tag":352,"props":1221,"children":1222},{"class":354,"line":509},[1223],{"type":44,"tag":352,"props":1224,"children":1225},{},[1226],{"type":49,"value":1099},{"type":44,"tag":352,"props":1228,"children":1229},{"class":354,"line":535},[1230],{"type":44,"tag":352,"props":1231,"children":1232},{},[1233],{"type":49,"value":1107},{"type":44,"tag":352,"props":1235,"children":1236},{"class":354,"line":562},[1237],{"type":44,"tag":352,"props":1238,"children":1239},{},[1240],{"type":49,"value":1115},{"type":44,"tag":352,"props":1242,"children":1243},{"class":354,"line":593},[1244],{"type":44,"tag":352,"props":1245,"children":1246},{},[1247],{"type":49,"value":1123},{"type":44,"tag":352,"props":1249,"children":1250},{"class":354,"line":622},[1251],{"type":44,"tag":352,"props":1252,"children":1253},{},[1254],{"type":49,"value":1255},"    properties.$ai_clusters AS clusters,\n",{"type":44,"tag":352,"props":1257,"children":1258},{"class":354,"line":27},[1259],{"type":44,"tag":352,"props":1260,"children":1261},{},[1262],{"type":49,"value":1263},"    properties.$ai_clustering_params AS params,\n",{"type":44,"tag":352,"props":1265,"children":1266},{"class":354,"line":681},[1267],{"type":44,"tag":352,"props":1268,"children":1269},{},[1270],{"type":49,"value":1131},{"type":44,"tag":352,"props":1272,"children":1273},{"class":354,"line":719},[1274],{"type":44,"tag":352,"props":1275,"children":1276},{},[1277],{"type":49,"value":1139},{"type":44,"tag":352,"props":1279,"children":1280},{"class":354,"line":757},[1281],{"type":44,"tag":352,"props":1282,"children":1283},{},[1284],{"type":49,"value":1147},{"type":44,"tag":352,"props":1286,"children":1287},{"class":354,"line":792},[1288],{"type":44,"tag":352,"props":1289,"children":1290},{},[1291],{"type":49,"value":1292},"    AND timestamp >= parseDateTimeBestEffort('\u003Cwindow_start>')\n",{"type":44,"tag":352,"props":1294,"children":1295},{"class":354,"line":801},[1296],{"type":44,"tag":352,"props":1297,"children":1298},{},[1299],{"type":49,"value":1300},"    AND timestamp \u003C= parseDateTimeBestEffort('\u003Cwindow_end>')\n",{"type":44,"tag":352,"props":1302,"children":1303},{"class":354,"line":810},[1304],{"type":44,"tag":352,"props":1305,"children":1306},{},[1307],{"type":49,"value":1308},"    AND toString(properties.$ai_clustering_run_id) = '\u003Crun_id>'\n",{"type":44,"tag":352,"props":1310,"children":1311},{"class":354,"line":840},[1312],{"type":44,"tag":352,"props":1313,"children":1314},{},[1315],{"type":49,"value":1163},{"type":44,"tag":352,"props":1317,"children":1318},{"class":354,"line":866},[1319],{"type":44,"tag":352,"props":1320,"children":1321},{},[1322],{"type":49,"value":1323},"LIMIT 1\n",{"type":44,"tag":52,"props":1325,"children":1326},{},[1327,1329,1335,1337,1343,1345,1350],{"type":49,"value":1328},"The ",{"type":44,"tag":99,"props":1330,"children":1332},{"className":1331},[],[1333],{"type":49,"value":1334},"clusters",{"type":49,"value":1336}," field is a JSON array. Parse it to see cluster titles, sizes, descriptions, optional ",{"type":44,"tag":99,"props":1338,"children":1340},{"className":1339},[],[1341],{"type":49,"value":1342},"metrics",{"type":49,"value":1344},", and each cluster's ",{"type":44,"tag":99,"props":1346,"children":1348},{"className":1347},[],[1349],{"type":49,"value":519},{"type":49,"value":1351}," map.",{"type":44,"tag":52,"props":1353,"children":1354},{},[1355,1360,1362,1368,1370,1377],{"type":44,"tag":888,"props":1356,"children":1357},{},[1358],{"type":49,"value":1359},"Important:",{"type":49,"value":1361}," The clusters JSON can be very large (thousands of trace, generation, or evaluation IDs with coordinates).\nWhen the result is too large for inline display, it auto-persists to a file.\nUse ",{"type":44,"tag":99,"props":1363,"children":1365},{"className":1364},[],[1366],{"type":49,"value":1367},"print_clusters.py",{"type":49,"value":1369}," from ",{"type":44,"tag":1371,"props":1372,"children":1374},"a",{"href":1373},".\u002Fscripts\u002F",[1375],{"type":49,"value":1376},"scripts\u002F",{"type":49,"value":1378}," to get a readable summary.",{"type":44,"tag":328,"props":1380,"children":1382},{"id":1381},"step-3-compute-metrics-for-clusters",[1383],{"type":49,"value":1384},"Step 3 — Compute metrics for clusters",{"type":44,"tag":52,"props":1386,"children":1387},{},[1388],{"type":49,"value":1389},"For trace-level clusters, compute cost\u002Flatency\u002Ftoken metrics:",{"type":44,"tag":341,"props":1391,"children":1393},{"className":1045,"code":1392,"language":1047,"meta":346,"style":346},"posthog:execute-sql\nSELECT\n    properties.$ai_trace_id as trace_id,\n    sum(toFloat(properties.$ai_total_cost_usd)) as total_cost,\n    max(toFloat(properties.$ai_latency)) as latency,\n    sum(toInt(properties.$ai_input_tokens)) as input_tokens,\n    sum(toInt(properties.$ai_output_tokens)) as output_tokens,\n    countIf(properties.$ai_is_error = 'true') as error_count\nFROM events\nWHERE event IN ('$ai_generation', '$ai_embedding', '$ai_span')\n    AND timestamp >= parseDateTimeBestEffort('\u003Cwindow_start>')\n    AND timestamp \u003C= parseDateTimeBestEffort('\u003Cwindow_end>')\n    AND properties.$ai_trace_id IN ('\u003Ctrace_id_1>', '\u003Ctrace_id_2>', ...)\nGROUP BY trace_id\n",[1394],{"type":44,"tag":99,"props":1395,"children":1396},{"__ignoreMap":346},[1397,1404,1411,1419,1427,1435,1443,1451,1459,1466,1474,1481,1488,1496],{"type":44,"tag":352,"props":1398,"children":1399},{"class":354,"line":355},[1400],{"type":44,"tag":352,"props":1401,"children":1402},{},[1403],{"type":49,"value":1059},{"type":44,"tag":352,"props":1405,"children":1406},{"class":354,"line":365},[1407],{"type":44,"tag":352,"props":1408,"children":1409},{},[1410],{"type":49,"value":1067},{"type":44,"tag":352,"props":1412,"children":1413},{"class":354,"line":401},[1414],{"type":44,"tag":352,"props":1415,"children":1416},{},[1417],{"type":49,"value":1418},"    properties.$ai_trace_id as trace_id,\n",{"type":44,"tag":352,"props":1420,"children":1421},{"class":354,"line":431},[1422],{"type":44,"tag":352,"props":1423,"children":1424},{},[1425],{"type":49,"value":1426},"    sum(toFloat(properties.$ai_total_cost_usd)) as total_cost,\n",{"type":44,"tag":352,"props":1428,"children":1429},{"class":354,"line":471},[1430],{"type":44,"tag":352,"props":1431,"children":1432},{},[1433],{"type":49,"value":1434},"    max(toFloat(properties.$ai_latency)) as latency,\n",{"type":44,"tag":352,"props":1436,"children":1437},{"class":354,"line":509},[1438],{"type":44,"tag":352,"props":1439,"children":1440},{},[1441],{"type":49,"value":1442},"    sum(toInt(properties.$ai_input_tokens)) as input_tokens,\n",{"type":44,"tag":352,"props":1444,"children":1445},{"class":354,"line":535},[1446],{"type":44,"tag":352,"props":1447,"children":1448},{},[1449],{"type":49,"value":1450},"    sum(toInt(properties.$ai_output_tokens)) as output_tokens,\n",{"type":44,"tag":352,"props":1452,"children":1453},{"class":354,"line":562},[1454],{"type":44,"tag":352,"props":1455,"children":1456},{},[1457],{"type":49,"value":1458},"    countIf(properties.$ai_is_error = 'true') as error_count\n",{"type":44,"tag":352,"props":1460,"children":1461},{"class":354,"line":593},[1462],{"type":44,"tag":352,"props":1463,"children":1464},{},[1465],{"type":49,"value":1139},{"type":44,"tag":352,"props":1467,"children":1468},{"class":354,"line":622},[1469],{"type":44,"tag":352,"props":1470,"children":1471},{},[1472],{"type":49,"value":1473},"WHERE event IN ('$ai_generation', '$ai_embedding', '$ai_span')\n",{"type":44,"tag":352,"props":1475,"children":1476},{"class":354,"line":27},[1477],{"type":44,"tag":352,"props":1478,"children":1479},{},[1480],{"type":49,"value":1292},{"type":44,"tag":352,"props":1482,"children":1483},{"class":354,"line":681},[1484],{"type":44,"tag":352,"props":1485,"children":1486},{},[1487],{"type":49,"value":1300},{"type":44,"tag":352,"props":1489,"children":1490},{"class":354,"line":719},[1491],{"type":44,"tag":352,"props":1492,"children":1493},{},[1494],{"type":49,"value":1495},"    AND properties.$ai_trace_id IN ('\u003Ctrace_id_1>', '\u003Ctrace_id_2>', ...)\n",{"type":44,"tag":352,"props":1497,"children":1498},{"class":354,"line":757},[1499],{"type":44,"tag":352,"props":1500,"children":1501},{},[1502],{"type":49,"value":1503},"GROUP BY trace_id\n",{"type":44,"tag":52,"props":1505,"children":1506},{},[1507],{"type":49,"value":1508},"For generation-level clusters, match by event UUID:",{"type":44,"tag":341,"props":1510,"children":1512},{"className":1045,"code":1511,"language":1047,"meta":346,"style":346},"posthog:execute-sql\nSELECT\n    toString(uuid) as generation_id,\n    toFloat(properties.$ai_total_cost_usd) as cost,\n    toFloat(properties.$ai_latency) as latency,\n    toInt(properties.$ai_input_tokens) as input_tokens,\n    toInt(properties.$ai_output_tokens) as output_tokens,\n    if(properties.$ai_is_error = 'true', 1, 0) as is_error\nFROM events\nWHERE event = '$ai_generation'\n    AND timestamp >= parseDateTimeBestEffort('\u003Cwindow_start>')\n    AND timestamp \u003C= parseDateTimeBestEffort('\u003Cwindow_end>')\n    AND uuid IN ('\u003Cgen_uuid_1>', '\u003Cgen_uuid_2>', ...)\n",[1513],{"type":44,"tag":99,"props":1514,"children":1515},{"__ignoreMap":346},[1516,1523,1530,1538,1546,1554,1562,1570,1578,1585,1593,1600,1607],{"type":44,"tag":352,"props":1517,"children":1518},{"class":354,"line":355},[1519],{"type":44,"tag":352,"props":1520,"children":1521},{},[1522],{"type":49,"value":1059},{"type":44,"tag":352,"props":1524,"children":1525},{"class":354,"line":365},[1526],{"type":44,"tag":352,"props":1527,"children":1528},{},[1529],{"type":49,"value":1067},{"type":44,"tag":352,"props":1531,"children":1532},{"class":354,"line":401},[1533],{"type":44,"tag":352,"props":1534,"children":1535},{},[1536],{"type":49,"value":1537},"    toString(uuid) as generation_id,\n",{"type":44,"tag":352,"props":1539,"children":1540},{"class":354,"line":431},[1541],{"type":44,"tag":352,"props":1542,"children":1543},{},[1544],{"type":49,"value":1545},"    toFloat(properties.$ai_total_cost_usd) as cost,\n",{"type":44,"tag":352,"props":1547,"children":1548},{"class":354,"line":471},[1549],{"type":44,"tag":352,"props":1550,"children":1551},{},[1552],{"type":49,"value":1553},"    toFloat(properties.$ai_latency) as latency,\n",{"type":44,"tag":352,"props":1555,"children":1556},{"class":354,"line":509},[1557],{"type":44,"tag":352,"props":1558,"children":1559},{},[1560],{"type":49,"value":1561},"    toInt(properties.$ai_input_tokens) as input_tokens,\n",{"type":44,"tag":352,"props":1563,"children":1564},{"class":354,"line":535},[1565],{"type":44,"tag":352,"props":1566,"children":1567},{},[1568],{"type":49,"value":1569},"    toInt(properties.$ai_output_tokens) as output_tokens,\n",{"type":44,"tag":352,"props":1571,"children":1572},{"class":354,"line":562},[1573],{"type":44,"tag":352,"props":1574,"children":1575},{},[1576],{"type":49,"value":1577},"    if(properties.$ai_is_error = 'true', 1, 0) as is_error\n",{"type":44,"tag":352,"props":1579,"children":1580},{"class":354,"line":593},[1581],{"type":44,"tag":352,"props":1582,"children":1583},{},[1584],{"type":49,"value":1139},{"type":44,"tag":352,"props":1586,"children":1587},{"class":354,"line":622},[1588],{"type":44,"tag":352,"props":1589,"children":1590},{},[1591],{"type":49,"value":1592},"WHERE event = '$ai_generation'\n",{"type":44,"tag":352,"props":1594,"children":1595},{"class":354,"line":27},[1596],{"type":44,"tag":352,"props":1597,"children":1598},{},[1599],{"type":49,"value":1292},{"type":44,"tag":352,"props":1601,"children":1602},{"class":354,"line":681},[1603],{"type":44,"tag":352,"props":1604,"children":1605},{},[1606],{"type":49,"value":1300},{"type":44,"tag":352,"props":1608,"children":1609},{"class":354,"line":719},[1610],{"type":44,"tag":352,"props":1611,"children":1612},{},[1613],{"type":49,"value":1614},"    AND uuid IN ('\u003Cgen_uuid_1>', '\u003Cgen_uuid_2>', ...)\n",{"type":44,"tag":52,"props":1616,"children":1617},{},[1618,1620,1625,1627,1632],{"type":49,"value":1619},"For evaluation-level clusters, first check each cluster's ",{"type":44,"tag":99,"props":1621,"children":1623},{"className":1622},[],[1624],{"type":49,"value":1342},{"type":49,"value":1626}," field from ",{"type":44,"tag":99,"props":1628,"children":1630},{"className":1629},[],[1631],{"type":49,"value":313},{"type":49,"value":1633}," (for example pass rate, N\u002FA rate, dominant evaluator name, and average judge cost). When you need individual evaluation rows, match by event UUID:",{"type":44,"tag":341,"props":1635,"children":1637},{"className":1045,"code":1636,"language":1047,"meta":346,"style":346},"posthog:execute-sql\nSELECT\n    toString(uuid) AS evaluation_id,\n    toString(properties.$ai_trace_id) AS trace_id,\n    toString(properties.$ai_target_event_id) AS generation_id,\n    toString(properties.$ai_evaluation_name) AS evaluation_name,\n    toString(properties.$ai_evaluation_result) AS evaluation_result,\n    toString(properties.$ai_evaluation_reasoning) AS evaluation_reasoning,\n    toFloatOrNull(toString(properties.$ai_total_cost_usd)) AS judge_cost,\n    timestamp\nFROM events\nWHERE event = '$ai_evaluation'\n    AND timestamp >= parseDateTimeBestEffort('\u003Cwindow_start>')\n    AND timestamp \u003C= parseDateTimeBestEffort('\u003Cwindow_end>')\n    AND uuid IN ('\u003Ceval_uuid_1>', '\u003Ceval_uuid_2>', ...)\n",[1638],{"type":44,"tag":99,"props":1639,"children":1640},{"__ignoreMap":346},[1641,1648,1655,1663,1671,1679,1687,1695,1703,1711,1718,1725,1733,1740,1747],{"type":44,"tag":352,"props":1642,"children":1643},{"class":354,"line":355},[1644],{"type":44,"tag":352,"props":1645,"children":1646},{},[1647],{"type":49,"value":1059},{"type":44,"tag":352,"props":1649,"children":1650},{"class":354,"line":365},[1651],{"type":44,"tag":352,"props":1652,"children":1653},{},[1654],{"type":49,"value":1067},{"type":44,"tag":352,"props":1656,"children":1657},{"class":354,"line":401},[1658],{"type":44,"tag":352,"props":1659,"children":1660},{},[1661],{"type":49,"value":1662},"    toString(uuid) AS evaluation_id,\n",{"type":44,"tag":352,"props":1664,"children":1665},{"class":354,"line":431},[1666],{"type":44,"tag":352,"props":1667,"children":1668},{},[1669],{"type":49,"value":1670},"    toString(properties.$ai_trace_id) AS trace_id,\n",{"type":44,"tag":352,"props":1672,"children":1673},{"class":354,"line":471},[1674],{"type":44,"tag":352,"props":1675,"children":1676},{},[1677],{"type":49,"value":1678},"    toString(properties.$ai_target_event_id) AS generation_id,\n",{"type":44,"tag":352,"props":1680,"children":1681},{"class":354,"line":509},[1682],{"type":44,"tag":352,"props":1683,"children":1684},{},[1685],{"type":49,"value":1686},"    toString(properties.$ai_evaluation_name) AS evaluation_name,\n",{"type":44,"tag":352,"props":1688,"children":1689},{"class":354,"line":535},[1690],{"type":44,"tag":352,"props":1691,"children":1692},{},[1693],{"type":49,"value":1694},"    toString(properties.$ai_evaluation_result) AS evaluation_result,\n",{"type":44,"tag":352,"props":1696,"children":1697},{"class":354,"line":562},[1698],{"type":44,"tag":352,"props":1699,"children":1700},{},[1701],{"type":49,"value":1702},"    toString(properties.$ai_evaluation_reasoning) AS evaluation_reasoning,\n",{"type":44,"tag":352,"props":1704,"children":1705},{"class":354,"line":593},[1706],{"type":44,"tag":352,"props":1707,"children":1708},{},[1709],{"type":49,"value":1710},"    toFloatOrNull(toString(properties.$ai_total_cost_usd)) AS judge_cost,\n",{"type":44,"tag":352,"props":1712,"children":1713},{"class":354,"line":622},[1714],{"type":44,"tag":352,"props":1715,"children":1716},{},[1717],{"type":49,"value":1131},{"type":44,"tag":352,"props":1719,"children":1720},{"class":354,"line":27},[1721],{"type":44,"tag":352,"props":1722,"children":1723},{},[1724],{"type":49,"value":1139},{"type":44,"tag":352,"props":1726,"children":1727},{"class":354,"line":681},[1728],{"type":44,"tag":352,"props":1729,"children":1730},{},[1731],{"type":49,"value":1732},"WHERE event = '$ai_evaluation'\n",{"type":44,"tag":352,"props":1734,"children":1735},{"class":354,"line":719},[1736],{"type":44,"tag":352,"props":1737,"children":1738},{},[1739],{"type":49,"value":1292},{"type":44,"tag":352,"props":1741,"children":1742},{"class":354,"line":757},[1743],{"type":44,"tag":352,"props":1744,"children":1745},{},[1746],{"type":49,"value":1300},{"type":44,"tag":352,"props":1748,"children":1749},{"class":354,"line":792},[1750],{"type":44,"tag":352,"props":1751,"children":1752},{},[1753],{"type":49,"value":1754},"    AND uuid IN ('\u003Ceval_uuid_1>', '\u003Ceval_uuid_2>', ...)\n",{"type":44,"tag":328,"props":1756,"children":1758},{"id":1757},"step-4-drill-into-specific-traces",[1759],{"type":49,"value":1760},"Step 4 — Drill into specific traces",{"type":44,"tag":52,"props":1762,"children":1763},{},[1764],{"type":49,"value":1765},"Once you've identified interesting clusters, use the trace tools to inspect individual traces:",{"type":44,"tag":341,"props":1767,"children":1769},{"className":343,"code":1768,"language":345,"meta":346,"style":346},"posthog:query-llm-trace\n{\n  \"traceId\": \"\u003Ctrace_id_from_cluster>\",\n  \"dateRange\": {\"date_from\": \"\u003Cwindow_start>\", \"date_to\": \"\u003Cwindow_end>\"}\n}\n",[1770],{"type":44,"tag":99,"props":1771,"children":1772},{"__ignoreMap":346},[1773,1782,1789,1826,1920],{"type":44,"tag":352,"props":1774,"children":1775},{"class":354,"line":355},[1776],{"type":44,"tag":352,"props":1777,"children":1779},{"style":1778},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[1780],{"type":49,"value":1781},"posthog:query-llm-trace\n",{"type":44,"tag":352,"props":1783,"children":1784},{"class":354,"line":365},[1785],{"type":44,"tag":352,"props":1786,"children":1787},{"style":359},[1788],{"type":49,"value":362},{"type":44,"tag":352,"props":1790,"children":1791},{"class":354,"line":401},[1792,1796,1801,1805,1809,1813,1818,1822],{"type":44,"tag":352,"props":1793,"children":1794},{"style":359},[1795],{"type":49,"value":371},{"type":44,"tag":352,"props":1797,"children":1798},{"style":374},[1799],{"type":49,"value":1800},"traceId",{"type":44,"tag":352,"props":1802,"children":1803},{"style":359},[1804],{"type":49,"value":382},{"type":44,"tag":352,"props":1806,"children":1807},{"style":359},[1808],{"type":49,"value":387},{"type":44,"tag":352,"props":1810,"children":1811},{"style":359},[1812],{"type":49,"value":454},{"type":44,"tag":352,"props":1814,"children":1815},{"style":457},[1816],{"type":49,"value":1817},"\u003Ctrace_id_from_cluster>",{"type":44,"tag":352,"props":1819,"children":1820},{"style":359},[1821],{"type":49,"value":382},{"type":44,"tag":352,"props":1823,"children":1824},{"style":359},[1825],{"type":49,"value":398},{"type":44,"tag":352,"props":1827,"children":1828},{"class":354,"line":431},[1829,1833,1838,1842,1846,1851,1855,1860,1864,1868,1872,1877,1881,1886,1890,1895,1899,1903,1907,1912,1916],{"type":44,"tag":352,"props":1830,"children":1831},{"style":359},[1832],{"type":49,"value":371},{"type":44,"tag":352,"props":1834,"children":1835},{"style":374},[1836],{"type":49,"value":1837},"dateRange",{"type":44,"tag":352,"props":1839,"children":1840},{"style":359},[1841],{"type":49,"value":382},{"type":44,"tag":352,"props":1843,"children":1844},{"style":359},[1845],{"type":49,"value":387},{"type":44,"tag":352,"props":1847,"children":1848},{"style":359},[1849],{"type":49,"value":1850}," {",{"type":44,"tag":352,"props":1852,"children":1853},{"style":359},[1854],{"type":49,"value":382},{"type":44,"tag":352,"props":1856,"children":1857},{"style":544},[1858],{"type":49,"value":1859},"date_from",{"type":44,"tag":352,"props":1861,"children":1862},{"style":359},[1863],{"type":49,"value":382},{"type":44,"tag":352,"props":1865,"children":1866},{"style":359},[1867],{"type":49,"value":387},{"type":44,"tag":352,"props":1869,"children":1870},{"style":359},[1871],{"type":49,"value":454},{"type":44,"tag":352,"props":1873,"children":1874},{"style":457},[1875],{"type":49,"value":1876},"\u003Cwindow_start>",{"type":44,"tag":352,"props":1878,"children":1879},{"style":359},[1880],{"type":49,"value":382},{"type":44,"tag":352,"props":1882,"children":1883},{"style":359},[1884],{"type":49,"value":1885},",",{"type":44,"tag":352,"props":1887,"children":1888},{"style":359},[1889],{"type":49,"value":454},{"type":44,"tag":352,"props":1891,"children":1892},{"style":544},[1893],{"type":49,"value":1894},"date_to",{"type":44,"tag":352,"props":1896,"children":1897},{"style":359},[1898],{"type":49,"value":382},{"type":44,"tag":352,"props":1900,"children":1901},{"style":359},[1902],{"type":49,"value":387},{"type":44,"tag":352,"props":1904,"children":1905},{"style":359},[1906],{"type":49,"value":454},{"type":44,"tag":352,"props":1908,"children":1909},{"style":457},[1910],{"type":49,"value":1911},"\u003Cwindow_end>",{"type":44,"tag":352,"props":1913,"children":1914},{"style":359},[1915],{"type":49,"value":382},{"type":44,"tag":352,"props":1917,"children":1918},{"style":359},[1919],{"type":49,"value":872},{"type":44,"tag":352,"props":1921,"children":1922},{"class":354,"line":471},[1923],{"type":44,"tag":352,"props":1924,"children":1925},{"style":359},[1926],{"type":49,"value":872},{"type":44,"tag":328,"props":1928,"children":1930},{"id":1929},"when-you-need-message-content",[1931],{"type":49,"value":1932},"When you need message content",{"type":44,"tag":52,"props":1934,"children":1935},{},[1936,1938,1944,1946,1951,1953,1959,1960,1966,1967,1973,1975,1981],{"type":49,"value":1937},"Use ",{"type":44,"tag":99,"props":1939,"children":1941},{"className":1940},[],[1942],{"type":49,"value":1943},"events",{"type":49,"value":1945}," for cluster events, IDs, cost\u002Flatency\u002Ftoken metrics, and evaluation rows.\nDo ",{"type":44,"tag":888,"props":1947,"children":1948},{},[1949],{"type":49,"value":1950},"not",{"type":49,"value":1952}," query ",{"type":44,"tag":99,"props":1954,"children":1956},{"className":1955},[],[1957],{"type":49,"value":1958},"events.properties.$ai_input",{"type":49,"value":260},{"type":44,"tag":99,"props":1961,"children":1963},{"className":1962},[],[1964],{"type":49,"value":1965},"$ai_output",{"type":49,"value":268},{"type":44,"tag":99,"props":1968,"children":1970},{"className":1969},[],[1971],{"type":49,"value":1972},"$ai_output_choices",{"type":49,"value":1974}," when you need user messages or full model inputs\u002Foutputs —\nthose heavy fields live on ",{"type":44,"tag":99,"props":1976,"children":1978},{"className":1977},[],[1979],{"type":49,"value":1980},"posthog.ai_events",{"type":49,"value":1982},".",{"type":44,"tag":52,"props":1984,"children":1985},{},[1986,1988,1994,1996,2001,2003,2008,2010,2015],{"type":49,"value":1987},"For a few representative examples, prefer ",{"type":44,"tag":99,"props":1989,"children":1991},{"className":1990},[],[1992],{"type":49,"value":1993},"query-llm-trace",{"type":49,"value":1995},"; it reads ",{"type":44,"tag":99,"props":1997,"children":1999},{"className":1998},[],[2000],{"type":49,"value":1980},{"type":49,"value":2002}," for you and returns the full event tree.\nFor batch extraction, first get the trace IDs from the cluster, then query ",{"type":44,"tag":99,"props":2004,"children":2006},{"className":2005},[],[2007],{"type":49,"value":1980},{"type":49,"value":2009}," anchored on ",{"type":44,"tag":99,"props":2011,"children":2013},{"className":2012},[],[2014],{"type":49,"value":729},{"type":49,"value":387},{"type":44,"tag":341,"props":2017,"children":2019},{"className":1045,"code":2018,"language":1047,"meta":346,"style":346},"posthog:execute-sql\nSELECT\n    trace_id,\n    timestamp,\n    span_id,\n    event,\n    model,\n    input,\n    output_choices\nFROM posthog.ai_events\nWHERE trace_id IN ('\u003Ctrace_id_1>', '\u003Ctrace_id_2>', ...)\nORDER BY trace_id, timestamp\n",[2020],{"type":44,"tag":99,"props":2021,"children":2022},{"__ignoreMap":346},[2023,2030,2037,2045,2053,2061,2069,2077,2085,2093,2101,2109],{"type":44,"tag":352,"props":2024,"children":2025},{"class":354,"line":355},[2026],{"type":44,"tag":352,"props":2027,"children":2028},{},[2029],{"type":49,"value":1059},{"type":44,"tag":352,"props":2031,"children":2032},{"class":354,"line":365},[2033],{"type":44,"tag":352,"props":2034,"children":2035},{},[2036],{"type":49,"value":1067},{"type":44,"tag":352,"props":2038,"children":2039},{"class":354,"line":401},[2040],{"type":44,"tag":352,"props":2041,"children":2042},{},[2043],{"type":49,"value":2044},"    trace_id,\n",{"type":44,"tag":352,"props":2046,"children":2047},{"class":354,"line":431},[2048],{"type":44,"tag":352,"props":2049,"children":2050},{},[2051],{"type":49,"value":2052},"    timestamp,\n",{"type":44,"tag":352,"props":2054,"children":2055},{"class":354,"line":471},[2056],{"type":44,"tag":352,"props":2057,"children":2058},{},[2059],{"type":49,"value":2060},"    span_id,\n",{"type":44,"tag":352,"props":2062,"children":2063},{"class":354,"line":509},[2064],{"type":44,"tag":352,"props":2065,"children":2066},{},[2067],{"type":49,"value":2068},"    event,\n",{"type":44,"tag":352,"props":2070,"children":2071},{"class":354,"line":535},[2072],{"type":44,"tag":352,"props":2073,"children":2074},{},[2075],{"type":49,"value":2076},"    model,\n",{"type":44,"tag":352,"props":2078,"children":2079},{"class":354,"line":562},[2080],{"type":44,"tag":352,"props":2081,"children":2082},{},[2083],{"type":49,"value":2084},"    input,\n",{"type":44,"tag":352,"props":2086,"children":2087},{"class":354,"line":593},[2088],{"type":44,"tag":352,"props":2089,"children":2090},{},[2091],{"type":49,"value":2092},"    output_choices\n",{"type":44,"tag":352,"props":2094,"children":2095},{"class":354,"line":622},[2096],{"type":44,"tag":352,"props":2097,"children":2098},{},[2099],{"type":49,"value":2100},"FROM posthog.ai_events\n",{"type":44,"tag":352,"props":2102,"children":2103},{"class":354,"line":27},[2104],{"type":44,"tag":352,"props":2105,"children":2106},{},[2107],{"type":49,"value":2108},"WHERE trace_id IN ('\u003Ctrace_id_1>', '\u003Ctrace_id_2>', ...)\n",{"type":44,"tag":352,"props":2110,"children":2111},{"class":354,"line":681},[2112],{"type":44,"tag":352,"props":2113,"children":2114},{},[2115],{"type":49,"value":2116},"ORDER BY trace_id, timestamp\n",{"type":44,"tag":52,"props":2118,"children":2119},{},[2120,2125,2127,2132,2134,2140],{"type":44,"tag":99,"props":2121,"children":2123},{"className":2122},[],[2124],{"type":49,"value":1980},{"type":49,"value":2126}," has a shorter retention window than ",{"type":44,"tag":99,"props":2128,"children":2130},{"className":2129},[],[2131],{"type":49,"value":1943},{"type":49,"value":2133},"; older clusters may still have metadata and metrics but no message content.\nFor more detail, use the exploring LLM traces skill's ",{"type":44,"tag":1371,"props":2135,"children":2137},{"href":2136},"..\u002Fexploring-llm-traces\u002Freferences\u002Fevents-and-properties.md",[2138],{"type":49,"value":2139},"event reference",{"type":49,"value":1982},{"type":44,"tag":58,"props":2142,"children":2144},{"id":2143},"investigation-patterns",[2145],{"type":49,"value":2146},"Investigation patterns",{"type":44,"tag":328,"props":2148,"children":2150},{"id":2149},"what-kinds-of-llm-usage-do-we-have",[2151],{"type":49,"value":2152},"\"What kinds of LLM usage do we have?\"",{"type":44,"tag":2154,"props":2155,"children":2156},"ol",{},[2157,2162,2167,2172],{"type":44,"tag":223,"props":2158,"children":2159},{},[2160],{"type":49,"value":2161},"List recent clustering runs (Step 1)",{"type":44,"tag":223,"props":2163,"children":2164},{},[2165],{"type":49,"value":2166},"Load the latest run's clusters (Step 2)",{"type":44,"tag":223,"props":2168,"children":2169},{},[2170],{"type":49,"value":2171},"Review cluster titles and descriptions — each represents a distinct usage pattern",{"type":44,"tag":223,"props":2173,"children":2174},{},[2175],{"type":49,"value":2176},"Compare cluster sizes to understand traffic distribution",{"type":44,"tag":328,"props":2178,"children":2180},{"id":2179},"which-cluster-is-most-expensive-slowest",[2181],{"type":49,"value":2182},"\"Which cluster is most expensive \u002F slowest?\"",{"type":44,"tag":2154,"props":2184,"children":2185},{},[2186,2191,2196,2201,2228],{"type":44,"tag":223,"props":2187,"children":2188},{},[2189],{"type":49,"value":2190},"Load clusters from a run (Step 2)",{"type":44,"tag":223,"props":2192,"children":2193},{},[2194],{"type":49,"value":2195},"Extract trace IDs from each cluster",{"type":44,"tag":223,"props":2197,"children":2198},{},[2199],{"type":49,"value":2200},"Compute metrics per cluster (Step 3)",{"type":44,"tag":223,"props":2202,"children":2203},{},[2204,2206,2212,2213,2219,2220,2226],{"type":49,"value":2205},"Aggregate: ",{"type":44,"tag":99,"props":2207,"children":2209},{"className":2208},[],[2210],{"type":49,"value":2211},"avg(cost)",{"type":49,"value":260},{"type":44,"tag":99,"props":2214,"children":2216},{"className":2215},[],[2217],{"type":49,"value":2218},"avg(latency)",{"type":49,"value":260},{"type":44,"tag":99,"props":2221,"children":2223},{"className":2222},[],[2224],{"type":49,"value":2225},"sum(cost)",{"type":49,"value":2227}," per cluster",{"type":44,"tag":223,"props":2229,"children":2230},{},[2231],{"type":49,"value":2232},"Compare across clusters",{"type":44,"tag":328,"props":2234,"children":2236},{"id":2235},"whats-in-this-cluster",[2237],{"type":49,"value":2238},"\"What's in this cluster?\"",{"type":44,"tag":2154,"props":2240,"children":2241},{},[2242,2254,2266,2278],{"type":44,"tag":223,"props":2243,"children":2244},{},[2245,2247,2252],{"type":49,"value":2246},"Load the cluster's traces (from the ",{"type":44,"tag":99,"props":2248,"children":2250},{"className":2249},[],[2251],{"type":49,"value":519},{"type":49,"value":2253}," field)",{"type":44,"tag":223,"props":2255,"children":2256},{},[2257,2259,2264],{"type":49,"value":2258},"Sort by ",{"type":44,"tag":99,"props":2260,"children":2262},{"className":2261},[],[2263],{"type":49,"value":603},{"type":49,"value":2265}," (closest to centroid = most representative)",{"type":44,"tag":223,"props":2267,"children":2268},{},[2269,2271,2276],{"type":49,"value":2270},"Inspect the top 3-5 traces via ",{"type":44,"tag":99,"props":2272,"children":2274},{"className":2273},[],[2275],{"type":49,"value":1993},{"type":49,"value":2277}," to understand the pattern",{"type":44,"tag":223,"props":2279,"children":2280},{},[2281,2283,2288,2290,2295],{"type":49,"value":2282},"Check the cluster ",{"type":44,"tag":99,"props":2284,"children":2286},{"className":2285},[],[2287],{"type":49,"value":441},{"type":49,"value":2289}," and ",{"type":44,"tag":99,"props":2291,"children":2293},{"className":2292},[],[2294],{"type":49,"value":481},{"type":49,"value":2296}," for the AI-generated summary",{"type":44,"tag":328,"props":2298,"children":2300},{"id":2299},"are-there-error-heavy-clusters",[2301],{"type":49,"value":2302},"\"Are there error-heavy clusters?\"",{"type":44,"tag":2154,"props":2304,"children":2305},{},[2306,2317,2328,2333],{"type":44,"tag":223,"props":2307,"children":2308},{},[2309,2311],{"type":49,"value":2310},"Compute metrics (Step 3) with ",{"type":44,"tag":99,"props":2312,"children":2314},{"className":2313},[],[2315],{"type":49,"value":2316},"error_count",{"type":44,"tag":223,"props":2318,"children":2319},{},[2320,2322],{"type":49,"value":2321},"Calculate error rate per cluster: ",{"type":44,"tag":99,"props":2323,"children":2325},{"className":2324},[],[2326],{"type":49,"value":2327},"items_with_errors \u002F total_items",{"type":44,"tag":223,"props":2329,"children":2330},{},[2331],{"type":49,"value":2332},"Focus on clusters with high error rates",{"type":44,"tag":223,"props":2334,"children":2335},{},[2336],{"type":49,"value":2337},"Drill into errored traces to find root causes",{"type":44,"tag":328,"props":2339,"children":2341},{"id":2340},"how-do-clusters-compare-across-runs",[2342],{"type":49,"value":2343},"\"How do clusters compare across runs?\"",{"type":44,"tag":2154,"props":2345,"children":2346},{},[2347,2352,2357,2362],{"type":44,"tag":223,"props":2348,"children":2349},{},[2350],{"type":49,"value":2351},"List multiple runs (Step 1)",{"type":44,"tag":223,"props":2353,"children":2354},{},[2355],{"type":49,"value":2356},"Load clusters from each run",{"type":44,"tag":223,"props":2358,"children":2359},{},[2360],{"type":49,"value":2361},"Compare cluster titles — similar titles across runs indicate stable patterns",{"type":44,"tag":223,"props":2363,"children":2364},{},[2365],{"type":49,"value":2366},"Track cluster size changes to detect shifts in traffic patterns",{"type":44,"tag":58,"props":2368,"children":2370},{"id":2369},"constructing-ui-links",[2371],{"type":49,"value":2372},"Constructing UI links",{"type":44,"tag":219,"props":2374,"children":2375},{},[2376,2392,2407],{"type":44,"tag":223,"props":2377,"children":2378},{},[2379,2384,2386],{"type":44,"tag":888,"props":2380,"children":2381},{},[2382],{"type":49,"value":2383},"Clusters overview",{"type":49,"value":2385},": ",{"type":44,"tag":99,"props":2387,"children":2389},{"className":2388},[],[2390],{"type":49,"value":2391},"https:\u002F\u002Fapp.posthog.com\u002Fai-observability\u002Fclusters",{"type":44,"tag":223,"props":2393,"children":2394},{},[2395,2400,2401],{"type":44,"tag":888,"props":2396,"children":2397},{},[2398],{"type":49,"value":2399},"Specific run",{"type":49,"value":2385},{"type":44,"tag":99,"props":2402,"children":2404},{"className":2403},[],[2405],{"type":49,"value":2406},"https:\u002F\u002Fapp.posthog.com\u002Fai-observability\u002Fclusters\u002F\u003Curl_encoded_run_id>",{"type":44,"tag":223,"props":2408,"children":2409},{},[2410,2415,2416],{"type":44,"tag":888,"props":2411,"children":2412},{},[2413],{"type":49,"value":2414},"Cluster detail",{"type":49,"value":2385},{"type":44,"tag":99,"props":2417,"children":2419},{"className":2418},[],[2420],{"type":49,"value":2421},"https:\u002F\u002Fapp.posthog.com\u002Fai-observability\u002Fclusters\u002F\u003Curl_encoded_run_id>\u002F\u003Ccluster_id>",{"type":44,"tag":52,"props":2423,"children":2424},{},[2425],{"type":49,"value":2426},"Always surface these links so the user can verify visually in the PostHog UI.",{"type":44,"tag":58,"props":2428,"children":2430},{"id":2429},"tips",[2431],{"type":49,"value":2432},"Tips",{"type":44,"tag":219,"props":2434,"children":2435},{},[2436,2441,2446,2451,2463,2475,2487,2514],{"type":44,"tag":223,"props":2437,"children":2438},{},[2439],{"type":49,"value":2440},"Always set a time range in SQL queries — cluster events without time bounds are slow",{"type":44,"tag":223,"props":2442,"children":2443},{},[2444],{"type":49,"value":2445},"Start with run listing to orient, then drill into specific clusters",{"type":44,"tag":223,"props":2447,"children":2448},{},[2449],{"type":49,"value":2450},"Cluster titles and descriptions are AI-generated summaries — verify by inspecting traces",{"type":44,"tag":223,"props":2452,"children":2453},{},[2454,2456,2461],{"type":49,"value":2455},"The noise cluster (",{"type":44,"tag":99,"props":2457,"children":2459},{"className":2458},[],[2460],{"type":49,"value":884},{"type":49,"value":2462},") contains outliers that didn't fit any pattern",{"type":44,"tag":223,"props":2464,"children":2465},{},[2466,2467,2473],{"type":49,"value":1937},{"type":44,"tag":99,"props":2468,"children":2470},{"className":2469},[],[2471],{"type":49,"value":2472},"llma-clustering-job-list",{"type":49,"value":2474}," to understand what clustering configs are active",{"type":44,"tag":223,"props":2476,"children":2477},{},[2478,2480,2485],{"type":49,"value":2479},"Trace IDs in clusters can be used directly with ",{"type":44,"tag":99,"props":2481,"children":2483},{"className":2482},[],[2484],{"type":49,"value":1993},{"type":49,"value":2486}," for deep inspection",{"type":44,"tag":223,"props":2488,"children":2489},{},[2490,2492,2497,2499,2505,2507,2512],{"type":49,"value":2491},"Message content lives on ",{"type":44,"tag":99,"props":2493,"children":2495},{"className":2494},[],[2496],{"type":49,"value":1980},{"type":49,"value":2498},", not ",{"type":44,"tag":99,"props":2500,"children":2502},{"className":2501},[],[2503],{"type":49,"value":2504},"events.properties",{"type":49,"value":2506},"; use ",{"type":44,"tag":99,"props":2508,"children":2510},{"className":2509},[],[2511],{"type":49,"value":1993},{"type":49,"value":2513}," unless you need custom batch SQL",{"type":44,"tag":223,"props":2515,"children":2516},{},[2517],{"type":49,"value":2518},"For large clusters, inspect the top-ranked traces (closest to centroid) for representative examples",{"type":44,"tag":2520,"props":2521,"children":2522},"style",{},[2523],{"type":49,"value":2524},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2526,"total":2642},[2527,2542,2560,2577,2592,2606,2624],{"slug":2528,"name":2528,"fn":2529,"description":2530,"org":2531,"tags":2532,"stars":23,"repoUrl":24,"updatedAt":2541},"analyzing-experiment-session-replays","analyze session replays for PostHog experiments","Analyze session replay patterns across experiment variants to understand user behavior differences. Use when the user wants to see how users interact with different experiment variants, identify usability issues, compare behavior patterns between control and test groups, or get qualitative insights to complement quantitative experiment results.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2533,2534,2537,2538],{"name":21,"slug":22,"type":15},{"name":2535,"slug":2536,"type":15},"Design","design",{"name":9,"slug":8,"type":15},{"name":2539,"slug":2540,"type":15},"User Research","user-research","2026-04-06T18:44:38.291781",{"slug":2543,"name":2543,"fn":2544,"description":2545,"org":2546,"tags":2547,"stars":23,"repoUrl":24,"updatedAt":2559},"assessing-heatmaps","analyze page heatmaps and suggest improvements","Assesses what a page's heatmap is telling you and recommends concrete changes. Pulls click \u002F rageclick \u002F scroll-depth data for a URL, names the hot elements by cross-referencing autocapture events on the same page, and can create a saved heatmap the user opens in PostHog, then summarizes the behavior and proposes improvements.\nTRIGGER when: user asks what a heatmap shows, why people aren't clicking something, where users rage-click, how far they scroll, what to change on a page based on heatmap\u002Fclick data, or to 'analyze\u002Fassess\u002Freview the heatmap' for a URL.\nDO NOT TRIGGER when: the user only wants to create a saved heatmap screenshot with no analysis (use heatmaps-saved-create directly), or is asking about session replay in general (use investigating-replay).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2548,2549,2552,2553,2556],{"name":21,"slug":22,"type":15},{"name":2550,"slug":2551,"type":15},"Frontend","frontend",{"name":9,"slug":8,"type":15},{"name":2554,"slug":2555,"type":15},"Product Management","product-management",{"name":2557,"slug":2558,"type":15},"UX Design","ux-design","2026-06-05T07:40:43.37798",{"slug":2561,"name":2561,"fn":2562,"description":2563,"org":2564,"tags":2565,"stars":23,"repoUrl":24,"updatedAt":2576},"auditing-experiments-flags","audit PostHog experiments and feature flags","Audit PostHog experiments and feature flags for configuration issues, staleness, and best-practice violations. Read when the user asks to audit, health-check, or review experiments or feature flags, check flag hygiene, or verify experiment setup.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2566,2569,2572,2573],{"name":2567,"slug":2568,"type":15},"Audit","audit",{"name":2570,"slug":2571,"type":15},"Feature Flags","feature-flags",{"name":9,"slug":8,"type":15},{"name":2574,"slug":2575,"type":15},"QA","qa","2026-04-06T18:44:30.657553",{"slug":2578,"name":2578,"fn":2579,"description":2580,"org":2581,"tags":2582,"stars":23,"repoUrl":24,"updatedAt":2591},"authoring-scouts","author and edit PostHog Signals scouts","How to author, edit, and adapt PostHog Signals scouts — the scheduled agents that scan a project and write reports into the Signals inbox. Use when a user wants to customize a canonical scout for their own setup (narrow its scope, retune its thresholds, add disqualifiers), tweak a scout's schedule or dry-run posture, or write a brand-new scout from scratch for a specific use case (a custom event, a product surface no canonical scout covers), or steer a scout without editing it at all by leaving it a note. Covers the scout SKILL.md anatomy, the report contract, the dedupe + scratchpad-memory conventions, the scout-notes steering channel, the per-team skills-store path vs the canonical in-repo path, and the write-and-inspect test loop (with dry-run as an optional safety net). Trigger on \"write\u002Fedit\u002Fcustomize a signals scout\", \"new scout for X\", \"tune my scout schedule\", \"make a scout that watches \u003Cevent>\", \"leave a note for \u002F give feedback to a scout\", \"tell the scouts about X\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2583,2586,2589,2590],{"name":2584,"slug":2585,"type":15},"Agents","agents",{"name":2587,"slug":2588,"type":15},"Automation","automation",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-07-28T05:33:45.509154",{"slug":2593,"name":2593,"fn":2594,"description":2595,"org":2596,"tags":2597,"stars":23,"repoUrl":24,"updatedAt":2605},"building-a-dashboard","build and update PostHog dashboards","Build a new dashboard, or update an existing one, from a set of insights — the same job the in-app assistant does with its upsert-dashboard tool, but over MCP. Use when a user asks to create a dashboard, put several metrics\u002Fcharts together on one page, assemble a dashboard for a topic (product analytics, retention, revenue, activation, etc.), or add\u002Fremove\u002Freplace insights on a dashboard they already have. Covers deciding create vs update, reusing existing insights vs creating new ones, and using PostHog's vetted dashboard templates as reference for what a strong dashboard on a topic looks like.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2598,2599,2602],{"name":21,"slug":22,"type":15},{"name":2600,"slug":2601,"type":15},"Dashboards","dashboards",{"name":2603,"slug":2604,"type":15},"MCP","mcp","2026-07-21T06:07:38.060598",{"slug":2607,"name":2607,"fn":2608,"description":2609,"org":2610,"tags":2611,"stars":23,"repoUrl":24,"updatedAt":2623},"checking-deploy-timing","correlate PostHog deployments with GitHub commits","Determine when a PostHog code change reached a given environment by reading the hidden GIT deploy annotations in the project and correlating them with the merge commit on GitHub. Use when PostHog staff ask \"when was X deployed\", \"is my change live in the US\u002FEU yet\", \"has my PR shipped\", \"did the fix roll out to prod-us\", or otherwise want to know whether\u002Fwhen a commit, PR, or feature went out to a region. Do not answer deploy-timing questions from event\u002Fdata volume alone — that only shows when data changed, not when code shipped.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2612,2615,2618,2621,2622],{"name":2613,"slug":2614,"type":15},"Deployment","deployment",{"name":2616,"slug":2617,"type":15},"Git","git",{"name":2619,"slug":2620,"type":15},"GitHub","github",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-06-28T07:46:59.53536",{"slug":2625,"name":2625,"fn":2626,"description":2627,"org":2628,"tags":2629,"stars":23,"repoUrl":24,"updatedAt":2641},"choosing-trend-or-slope-view","visualize trends and growth over time","Clarify how to visualize change over a time range before building a trend. Use whenever the user asks how much something changed, grew, dropped, improved, or regressed between two points or periods — \"how much did X change from A to B\", \"before vs after\", \"start vs end\", \"week over week\", \"compare this month to last\", \"change over time\" — or mentions a \"slope chart\" \u002F \"slopegraph\". Two readings of \"change\" need different charts: the whole trend (a line, every interval) versus just the two endpoints (a slope, start vs end). Ask which they want, then render it. Not for choosing a saved insight ChartDisplayType in the insight editor.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2630,2631,2634,2637,2638],{"name":21,"slug":22,"type":15},{"name":2632,"slug":2633,"type":15},"Charts","charts",{"name":2635,"slug":2636,"type":15},"Data Visualization","data-visualization",{"name":9,"slug":8,"type":15},{"name":2639,"slug":2640,"type":15},"Reporting","reporting","2026-06-18T08:18:57.960157",56,{"items":2644,"total":2803},[2645,2660,2670,2683,2696,2711,2727,2740,2752,2767,2777,2793],{"slug":2646,"name":2646,"fn":2647,"description":2648,"org":2649,"tags":2650,"stars":2657,"repoUrl":2658,"updatedAt":2659},"analyzing-expensive-users","analyze expensive users in AI observability","Analyze the most expensive users in AI observability and explain why they cost so much. Use when the user asks about top spenders, expensive users, per-user LLM cost, user-level cost drivers, or patterns behind high AI observability spend.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2651,2652,2655,2656],{"name":21,"slug":22,"type":15},{"name":2653,"slug":2654,"type":15},"Cost Optimization","cost-optimization",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},35568,"https:\u002F\u002Fgithub.com\u002FPostHog\u002Fposthog","2026-07-28T05:34:11.117757",{"slug":2661,"name":2661,"fn":2662,"description":2663,"org":2664,"tags":2665,"stars":2657,"repoUrl":2658,"updatedAt":2669},"auditing-endpoints","audit PostHog project endpoints","Audit every endpoint in a PostHog project for staleness, failed materialisations, and unused materialised versions. Use when the user asks \"what endpoints can I clean up?\", \"are any of my endpoints broken?\", \"which materialised versions are still being called?\", or wants a one-shot cleanup pass over the Endpoints product. Produces a prioritised report grouped by issue type, with recommended actions but does not modify anything without explicit confirmation.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2666,2667,2668],{"name":21,"slug":22,"type":15},{"name":2567,"slug":2568,"type":15},{"name":9,"slug":8,"type":15},"2026-06-08T08:08:33.693989",{"slug":2671,"name":2671,"fn":2672,"description":2673,"org":2674,"tags":2675,"stars":2657,"repoUrl":2658,"updatedAt":2682},"auditing-warehouse-source-health","audit PostHog data warehouse source health","Audit the health of a PostHog project's data warehouse sources and syncs — find every broken or degraded source connection, sync schema, and webhook channel. Use when the user asks \"why are my imports failing?\", \"what's broken with my sources?\", \"why is my warehouse data stale?\", or wants a one-shot triage of source\u002Fsync health before deciding where to dig in. Produces a prioritized report grouped by severity, with recommended next steps. For materialized-view health use `auditing-warehouse-view-health`; for a single failing sync use `diagnosing-failed-warehouse-syncs`.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2676,2677,2680,2681],{"name":2567,"slug":2568,"type":15},{"name":2678,"slug":2679,"type":15},"Data Warehouse","data-warehouse",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-06-18T08:22:57.67984",{"slug":2684,"name":2684,"fn":2685,"description":2686,"org":2687,"tags":2688,"stars":2657,"repoUrl":2658,"updatedAt":2695},"auditing-warehouse-view-health","audit PostHog materialized view health","Audit the health of a PostHog project's materialized views (saved queries) — find every failed materialization and flag unused or stale materialized views that cost storage and compute. Use when the user asks \"which of my views are broken?\", \"why is this materialized view failing?\", \"are any of my views wasting compute?\", or wants a one-shot triage of view health. For source\u002Fsync health use `auditing-warehouse-source-health`.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2689,2690,2691,2694],{"name":2567,"slug":2568,"type":15},{"name":2678,"slug":2679,"type":15},{"name":2692,"slug":2693,"type":15},"Performance","performance",{"name":9,"slug":8,"type":15},"2026-06-18T08:25:10.936787",{"slug":2697,"name":2697,"fn":2698,"description":2699,"org":2700,"tags":2701,"stars":2657,"repoUrl":2658,"updatedAt":2710},"authoring-error-tracking-alerts","author PostHog error tracking alerts","Author error tracking alerts that fire when an issue is created, reopened, or starts spiking. Use when the user asks to set up error notifications, route exceptions to Slack\u002Fwebhook\u002FLinear, or evaluate which error events are worth alerting on. Covers trigger-event selection, integration choice, dedup against existing alerts, and shipping with the canonical message body shape.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2702,2705,2708,2709],{"name":2703,"slug":2704,"type":15},"Alerting","alerting",{"name":2706,"slug":2707,"type":15},"Debugging","debugging",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-06-18T08:24:40.318583",{"slug":2712,"name":2712,"fn":2713,"description":2714,"org":2715,"tags":2716,"stars":2657,"repoUrl":2658,"updatedAt":2726},"authoring-log-alerts","author log alerts in PostHog","Author useful, low-noise log alerts on services in a PostHog project. Use when the user asks to set up alerts for their logs, suggest alerts they should add, or evaluate whether a service is worth monitoring. Covers service triage, baseline characterisation, threshold drafting, back-testing via simulate, and shipping with a notification destination.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2717,2718,2721,2722,2725],{"name":21,"slug":22,"type":15},{"name":2719,"slug":2720,"type":15},"Monitoring","monitoring",{"name":13,"slug":14,"type":15},{"name":2723,"slug":2724,"type":15},"Operations","operations",{"name":9,"slug":8,"type":15},"2026-07-18T05:10:54.430898",{"slug":2728,"name":2728,"fn":2729,"description":2730,"org":2731,"tags":2732,"stars":2657,"repoUrl":2658,"updatedAt":2739},"building-workflows","build and edit PostHog workflows","Build, edit, test, enable, and monitor PostHog workflows over MCP. Author the action\u002Fedge graph so it runs and opens cleanly in the visual editor, then change drafts surgically with patch operations. Use when asked to build, set up, automate, change, fix, or debug a workflow, campaign, broadcast, drip sequence, or event-triggered automation in the workflows product.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2733,2734,2735,2736],{"name":2587,"slug":2588,"type":15},{"name":2603,"slug":2604,"type":15},{"name":9,"slug":8,"type":15},{"name":2737,"slug":2738,"type":15},"Workflow Automation","workflow-automation","2026-07-28T05:34:12.167015",{"slug":2741,"name":2741,"fn":2742,"description":2743,"org":2744,"tags":2745,"stars":2657,"repoUrl":2658,"updatedAt":2751},"check-posthog-loading","inspect PostHog SDK loading across URLs","Inspect how the PostHog JavaScript SDK is loaded across a list of URLs. Use to confirm consistent installation across pages, find pages missing the snippet, detect mismatched API keys or hosts between pages, and verify the load method (head snippet vs deferred vs array.js).\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2746,2747,2748,2749,2750],{"name":21,"slug":22,"type":15},{"name":2706,"slug":2707,"type":15},{"name":2550,"slug":2551,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-05-07T05:56:19.828048",{"slug":2753,"name":2753,"fn":2754,"description":2755,"org":2756,"tags":2757,"stars":2657,"repoUrl":2658,"updatedAt":2766},"consuming-endpoints-from-client-code","integrate PostHog endpoints into client applications","Wire a PostHog endpoint into a client app or SDK. Covers fetching the OpenAPI spec, generating a typed client with openapi-generator or @hey-api\u002Fopenapi-ts, sending the right auth header, shaping the variables payload (HogQL code_name vs insight breakdown property), handling rate-limit and materialised-endpoint error responses. Use when the user says \"how do I call my endpoint\", \"generate a client for this\", or \"what auth header do I use\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2758,2761,2762,2763],{"name":2759,"slug":2760,"type":15},"API Development","api-development",{"name":2550,"slug":2551,"type":15},{"name":9,"slug":8,"type":15},{"name":2764,"slug":2765,"type":15},"SDK","sdk","2026-06-08T08:08:34.929454",{"slug":2768,"name":2768,"fn":2769,"description":2770,"org":2771,"tags":2772,"stars":2657,"repoUrl":2658,"updatedAt":2776},"copying-endpoints-across-projects","copy PostHog endpoints across projects","Copy a PostHog endpoint (a saved HogQL\u002Finsight query exposed as an API route) to another project in the same organization, or duplicate it under a new name in the same project. Use when the user wants to duplicate an endpoint, promote an endpoint from staging to production, replicate an endpoint's query\u002Fvariables\u002Ffreshness config in another workspace, or clone an endpoint to iterate on it. Unlike feature flags and experiments, endpoints have NO native cross-project copy tool — this skill covers the read-then-recreate flow (endpoint-get then endpoint-create), the active-project switching it requires, name-collision checks, and the safe defaults (land unmaterialised in the target, verify with endpoint-run). Does not cover editing endpoint versions (see managing-endpoint-versions) or authoring a brand-new endpoint from scratch (see creating-an-endpoint).\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2773,2774,2775],{"name":2759,"slug":2760,"type":15},{"name":2723,"slug":2724,"type":15},{"name":9,"slug":8,"type":15},"2026-07-15T05:29:58.442727",{"slug":2778,"name":2778,"fn":2779,"description":2780,"org":2781,"tags":2782,"stars":2657,"repoUrl":2658,"updatedAt":2792},"creating-ai-subscription","schedule recurring AI-generated PostHog reports","Create a recurring AI-generated PostHog report — schedule a free-text prompt to run on a cron, with the LLM-synthesized markdown delivered to email or Slack on each tick. Use when the user wants a recurring AI summary of X on any cadence (daily, weekly, monthly, yearly) rather than a one-off report. (To attach an AI summary to an existing insight\u002Fdashboard subscription instead of a free-text prompt, see `managing-subscriptions` and its `summary_enabled` option.)\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2783,2784,2787,2788,2789],{"name":2587,"slug":2588,"type":15},{"name":2785,"slug":2786,"type":15},"Email","email",{"name":9,"slug":8,"type":15},{"name":2639,"slug":2640,"type":15},{"name":2790,"slug":2791,"type":15},"Slack","slack","2026-06-09T07:32:27.935712",{"slug":2794,"name":2794,"fn":2795,"description":2796,"org":2797,"tags":2798,"stars":2657,"repoUrl":2658,"updatedAt":2802},"creating-an-endpoint","create PostHog API endpoints","Create a PostHog endpoint with the right shape on the first try — covers query kind choice, name conventions, what to expose as variables (HogQL code_name vs insight breakdown), data_freshness_seconds, and whether to materialise on day one. Use when the user says \"create an endpoint\", \"expose this query as an API\", \"turn this insight into an endpoint\", or asks for help structuring a new endpoint. Steers away from common mistakes: materialising a query with cohort breakdowns or compare mode, inline-only variables on a materialised endpoint, unbounded date ranges, ambiguous names.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[2799,2800,2801],{"name":21,"slug":22,"type":15},{"name":2759,"slug":2760,"type":15},{"name":9,"slug":8,"type":15},"2026-06-08T08:08:29.624498",231]