Skip to main content

End-to-end: condition watch

Advanced ⏱ 20 min manufacturing · end-to-end · baselines

You will build: the condition-monitoring pipeline from the Manufacturing use case — vibration and temperature baselines per asset, a drift rule, and an LLM-drafted context note for the technician.

telemetry → streaming:baseline → rule-based:detect → llm:contextualize → webhook (maintenance board)

Prerequisites​

  • The quickstart completed.
  • Optional for step 4: a local Ollama (plant-floor deployments keep the model on the OT segment). Without it, stop after step 3 — detection works.

1 · Scaffold​

pulse new condition --source webhook \
--stage streaming:baseline --stage rule-based:detect --stage llm:contextualize \
--sink webhook

2 · The baseline stage — each machine against itself​

stages:
- name: baseline
engine: streaming
operators:
- { type: keyBy, field: asset_id }
- type: window
spec: "sliding(15m,1m)"
aggregations:
vib_avg: "avg(vibration)"
vib_stddev: "stddev(vibration)"
temp_max: "max(temperature)"

keyBy: asset_id is the load-bearing line: deviation is measured against each machine's own recent history, not a fleet-wide constant.

3 · The detect stage​

- name: detect
engine: rule-based
rules:
- { condition: "vib_stddev > 4.0 || temp_max > 85", action: flag }

4 · The context stage​

- name: contextualize
engine: llm
systemPrompt: |
Summarize the drift for the technician: which metric
moved, how far beyond its band, over which window.

5 · Sink to the maintenance board and deploy​

pulse secret set MAINT_BOARD_WEBHOOK https://webhook.site/<your-id>
pulse secret set PULSE_WEBHOOK_SECRET dev-secret # the scaffolded webhook source requires it
pulse deploy .

6 · Simulate a bearing going bad​

for v in 1.1 1.2 1.4 2.8 5.5 9.2; do
pulse events publish --topic condition.in --value '{"asset_id":"press-04","vibration":'"$v"',"temperature":71}'
done
pulse events tail --topic condition.detect.out

As the vibration spread widens, vib_stddev breaks the band and the flag fires — hours of warning that a historian would only have shown you after the stop.

What just happened​

The "predictive" part is exactly what it claims to be: statistical baselines catching drift, per asset, in real time — with your own reliability model pluggable as a further stage when you have one. The alert path, the context drafting and the audit trail are the parts you didn't have to build.

Troubleshooting​

No flag fires

stddev needs spread within the window — send the escalating burst within a couple of minutes and check condition.baseline.out for the computed values.

Next​