Semogram Docs
Forecasting and predictionsDefine a forecaster

Prompt design

Define the event, window, evidence limitations and output instructions

The prompt tells the selected model what to predict. It should define the event or quantity, identify the window and explain how to handle incomplete evidence. It does not change the query's permissions, train a model or establish that the evidence is sufficient.

Supported template variables

VariableValue
{{subject_ref}}The run's subject reference
{{horizon}}The forecast-window label
{{params_json}}Resolved run parameters serialized as JSON
{{evidence_json}}Query evidence, diagnostics and snapshot metadata
{{output_schema_json}}The configured output schema

The main forecaster prompt must include subject_ref, horizon and evidence_json. Unknown variables are rejected. These are substitutions, not an executable template language. In chain/agent execution, step prompts additionally support steps_json and trace_json; do not put those extra variables in the main prompt.

Equipment prompt

Equipment failure instructions
Estimate the probability that equipment {{subject_ref}} experiences an unplanned mechanical failure causing at least one hour of downtime during {{horizon}}. A preventive service visit is not a failure. Use only the supplied evidence; explain its age, missing history and limitations. Do not describe this synthetic fixture as measured failure statistics. Return probability, confidence and rationale in the output schema.

Evidence:
{{evidence_json}}

This event counts an unplanned mechanical failure causing at least one hour of downtime. It excludes a preventive visit. If your organization uses another definition, change both the prompt and observation protocol before collecting scores.

Author and review

You need a Semogram account with project access and a published equipment evidence query. In New forecaster, describe that exact event to the creation assistant. Inspect its proposed query and prompt, validate and approve creation. In the manual option, enter the text under Advanced → Prompt. The edit form exposes Prompt template. A connected assistant can use forecaster_create or forecaster_update with promptTemplate and a unique idempotencyKey.

Prompt changes publish a new immutable forecaster version. Inspect the saved version before running. Compare outputs with real observations; do not add “give a high confidence answer” to hide uncertain or sparse evidence.

Avoid information leakage

Do not include the later outcome in the prompt or evidence for a prediction meant to be evaluated historically. State missing data plainly. A generated rationale may describe its supporting evidence but is still model output; verify referenced measurements against the stored query evidence.