Skip to content
AITroveRead. Build. Understand.
Make this comfortable

Forecast prompts: define target, horizon, and time grain

Last updated: 7 Oct 202611 min read
tutorial
AdvancedBy AITrove Editorial

A forecasting prompt needs a target with units, entity key, time grain, forecast origin, horizon, and data-finalization rule. A request for 'next week's demand' is ambiguous if the source records orders by local day but the planner buys kits by depot-week. The application should convert timestamps to the agreed depot calendar, aggregate once, and provide a typed series. The model can explain the contract or flag a missing field; it should not improvise the calendar boundary. Preserve whether the target is submitted orders, fulfilled orders, or consumed stock. Those measures answer different operating questions.

Operational case

Aster Repair plans weekly replacement-kit inventory for depot D-47. Each week runs Monday 00:00 through the next Monday 00:00 in the depot's local time zone. The target is fulfilled kits, not submitted requests. At the Sunday 18:00 planning origin, the current week has not finished, so the next complete week is the forecast target. A prompt that treats Sunday's partial count as a full week will understate demand. The contract marks unfinished periods as partial and excludes them from a full-week baseline.

Output
Entity: depot D-47
Target: fulfilled replacement kits, count
Grain: depot-local Monday-to-Monday week
Origin: Sunday 18:00 local
Horizon: next complete week
Current week: partial, not a completed observation

Performance and review cost

Converting and aggregating N event records by entity and local week is O(N) expected time with a keyed map and O(W) storage for W resulting weeks. Calendar conversion deserves an explicit test near time-zone changes; one wrong boundary can alter several weekly totals. Keep the source event count and aggregation version beside the series so an analyst can reproduce the target before debating models.

Common Mistakes

  • Do not mix submitted orders with fulfilled kits.
  • Do not treat a partial week as a complete observation.
  • Do not leave the depot calendar implicit.

Connected lessons

prompt engineering
forecasting
Storage details