predictive_query
Generate predictive insights from observation patterns. Predict whether a venue is likely to see increased foot traffic based on current patterns.
Uses historical observation_stream data to compute trend analysis via linear regression on time-bucketed metrics. Generates predictions with confidence intervals based on the observed trend, variance, and sample size.
WHEN TO USE:
Predicting future audience patterns at a venue or screen
Forecasting foot traffic trends for campaign planning
Understanding whether metrics are trending up, down, or stable
Making data-driven decisions about inventory and pricing
RETURNS:
prediction: The predicted trend and expected values
trend: 'increasing' | 'decreasing' | 'stable'
current_avg: Current average metric value
predicted_avg: Predicted average over the time horizon
change_pct: Expected percentage change
confidence_interval: { lower, upper } bounds
confidence: Overall prediction confidence (0-1)
supporting_data: Recent data points that inform the prediction
data_points: Array of { bucket, avg_value, sample_count }
total_observations: Total observations analyzed
methodology: Description of the prediction approach
suggested_next_queries: Follow-up queries to refine the prediction
EXAMPLE: User: "Will this QSR venue see more foot traffic next week?" predictive_query({ question: "Will foot traffic increase at QSR venues?", venue_type: "restaurant_qsr", time_horizon: "7d" })
User: "Predict audience attention trends for this screen" predictive_query({ question: "What will audience attention look like?", screen_id: "507f1f77bcf86cd799439011", time_horizon: "3d" })
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| question | Yes | Natural language question about the predicted trend or outcome | |
| screen_id | No | Filter predictions to a specific screen (mongo ID). Optional. | |
| venue_type | No | Filter predictions to a specific venue type. Optional. | |
| time_horizon | No | How far ahead to predict (e.g., "1d", "3d", "7d", "14d"). Default: "7d", max: "30d" |