creating-online-evaluations

Creates continuously-running online evaluations that score PostHog AI generations and traces.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill creating-online-evaluations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: creating-online-evaluations
Source: https://github.com/PostHog/posthog-foss/tree/main/products/ai_observability/skills/creating-online-evaluations
Command: npx skills add https://github.com/PostHog/posthog-foss --skill creating-online-evaluations

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Teams running LLM features in production need automated scoring of AI outputs to catch real failure modes, but manually configuring evaluations risks wrong scope, wasted LLM-judge cost, and evals that never fire. This Skill turns observed production failures into scoped, verified, continuously-running evaluations in PostHog AI observability.

Core Features & Use Cases

  • Failure-driven eval proposals: Converts ranked failure modes from production traces into a plain-language candidate set and lets the user pick which evals to create.
  • Full eval lifecycle: Chooses eval type (hog, llm_judge, sentiment), target (generation, trace, session), provider keys, and conditions, then creates disabled, verifies scope with SQL volume checks, and enables.
  • Safe fallbacks: Proposes a sentiment eval when no failure mode is found, and redirects to instrumentation when no $ai_generation events exist.
  • Use Case: After discovering that support replies drift off topic ~40 times per day, use this Skill to propose and create an llm_judge evaluation that scores each matching generation, verify its event volume, and enable it with a UI link for review.

Quick Start

Create an online evaluation in PostHog that continuously checks whether my AI agent's replies stay on the user's topic.

Frequently Asked Questions about creating-online-evaluations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an online evaluation in PostHog AI observability?

Start from a real failure mode found in production traces, propose candidate evals for the user to pick, then create each one disabled with the llma-evaluation-create tool. Verify the condition scope with a SQL volume check before enabling it with llma-evaluation-update.

When should I use a hog eval versus an llm_judge eval?

Use hog for structural, rule-based criteria like JSON parsing, length, regex, or tool-call shape since it is deterministic and needs no provider key. Use llm_judge only for subjective criteria like tone or on-topic checks, which cost an LLM call per run and require a usable provider key.

What is the difference between generation, trace, and session evaluation targets?

A generation target scores each matching $ai_generation immediately after ingestion. A trace target scores the whole trace once after a settle window, and a session target scores an entire $ai_session_id session after it goes quiet. Sentiment evals only support the generation target.

Why is my PostHog evaluation never firing?

Common causes are conditions that match no events, no $ai_generation events in the project at all, or a session target where producers never set $ai_session_id. Verify scope by running a SQL count over the last 7 days mirroring each condition property before enabling.

Does an llm_judge evaluation require a provider key?

Yes, an llm_judge eval needs a valid provider and model plus a usable provider key in the ok state. You can pin a specific key via provider_key_id or leave it null only when the team's active key is usable and matches the model's provider.

What should I do if no failure mode is worth an evaluation?

Propose a sentiment eval as the floor, since it labels user messages positive, neutral, or negative with no judge cost. If the project has no $ai_generation events at all, no eval can fire, so set up LLM analytics instrumentation first.