Canonical SignalQL examples
Each example lists the product question, SignalQL, logical output shape, and a compiled Postgres SQL pattern summary. For exact generated SQL text + params, run the query through the CLI or MCP run_signalql.
Dataset assumptions match fixtures/seed.sql.
Funnel — signup to activation
Question: What share of signups reach activated within the window?
SignalQL:
FUNNEL "signup" THEN "activated" FROM events DURING LAST 28 DAYSShape: One row with step_1, step_2, … counts and conversion_rate.
SQL pattern: Filtered aggregate with COUNT(DISTINCT CASE WHEN event_name = $k …) (see compiler output).
Retention starter — active vs signup volume
Question: How many users fired signup vs activated recently?
Use two queries (v0.1 keeps retention algebra minimal):
COUNT users FROM events WHERE event_name = "signup" DURING LAST 28 DAYSCOUNT users FROM events WHERE event_name = "activated" DURING LAST 28 DAYSShape: Single-row count each.
SQL pattern: Two parameterized COUNT(DISTINCT user_id) queries over events filtered by event_name and time window.
Growth — daily signups
Question: How many signup events per day?
COUNT events FROM events WHERE event_name = "signup" DURING LAST 30 DAYS GROUP BY DAYShape: Rows (day, count) ordered by day.
SQL pattern: SELECT date_trunc('day', timestamp) AS day, COUNT(*) ... GROUP BY day ORDER BY day.
Onboarding dropoff — funnel slice
Question: Where do users drop between onboarding completion and activation?
FUNNEL "onboarding_complete" THEN "activated" FROM events DURING LAST 14 DAYSShape: Step counts + conversion_rate.
SQL pattern: Distinct-user conditional counts per funnel step with derived conversion ratio.
Feature usage — view items
Question: How often was view_item tracked?
COUNT events FROM events WHERE event_name = "view_item" DURING LAST 14 DAYS GROUP BY DAYShape: (day, count) rows.
SQL pattern: Day-bucketed aggregate over events filtered by event_name and bounded timestamp.
Segmentation — pro plan purchases
Question: Among purchases tagged plan=pro on the event, how many distinct users?
COUNT users FROM events WHERE properties.plan = "pro" AND event_name = "purchase" DURING LAST 28 DAYSShape: Single-row count.
SQL pattern: COUNT(DISTINCT user_id) with predicates on properties.plan, event_name, and timestamp window.
These examples are mirrored in fixtures/query-fixtures.json and the playground presets.
v0.4 Operational Graph
These use the aspectgraph-work-pack relationship vocab over v0.4 core operators, and run against the bundled graph fixture.
Unvalidated assumptions (structural absence — not "at risk"):
MATCH entity(assumption) WITHOUT validated_by RETURN entity_idReasoning lineage — why does this ticket exist?
TRACE entity(ticket) WHERE id = "123" VIA derived_from DEPTH <= 6Shape: ordered lineage chain ticket → decision → experiment → metric → assumption → interview.
Reachability — decisions connected to an experiment:
FIND entity(decision) CONNECTED TO entity(experiment) WHERE name = "onboarding-v2" VIA supports RETURN entity_idContext bundle for an LLM:
CONTEXT FOR entity(roadmap) WHERE quarter = "Q3" DEPTH <= 2 INCLUDE entities, relationships, evidenceTime-travel — reasoning as believed at a past date:
TRACE entity(ticket) WHERE id = "123" VIA derived_from AS OF "2026-03-01T00:00:00Z"