PQL — the Predictive Query Language
PQL expresses predictions the way SQL expresses lookups. One statement names a target (what to predict), a population (who to predict it for), and an anchor-relative time window:
PREDICT COUNT(orders.*, 0, 90, days) = 0
FOR EACH customers.customer_id
For every customer, will they place zero orders in the 90 days after the anchor time?
Why a language?
- Declarative — changing the question means changing the string, not a pipeline.
- Validated — every query is bound against your schema before execution: unknown names, type mismatches, and backwards time windows are rejected up front.
- Self-routing — the query's shape determines the task type (classification, regression, ranking, forecasting), which selects the model checkpoint and output form.
PQL derives from Kumo/KumoRFM's predictive query language. One grammar, three verified implementations (ANTLR in Java; recursive descent in Python and Rust), all tested against a shared 44-query corpus.