Skip to main content

Assistant (Ask)

The assistant answers a plain-language question from your company's own records: alerts, work orders, downtime and maintenance. It is what the portal's Ask panel calls. Every claim in an answer cites the record it came from, so each one can be opened and checked. It is read-only: it writes nothing. The endpoint requires a bearer JWT.

The assistant uses a language model. It gives no scores, ratings or predictions, and has nothing to do with raising alerts: the detectors that raise them are deterministic formulas.

Endpoints​

MethodPathDescription
POST/api/v1/assistant/askAsk a question

Ask a question​

POST /api/v1/assistant/ask

FieldTypeRequiredDescription
questionstringYesThe question (3–500 chars)
period_daysintegerNoThe period to answer from: 7, 30, 90 (default) or 365 days
machine_iduuidNoOnly this machine's records
languagestringNoThe language to answer in, as a language code (en, de, es, hu, zh; default en; any other code is answered in English)
{
"question": "Which machine stopped most last month, and why?",
"period_days": 30,
"language": "en"
}

Response: 200 OK

{
"answer": "Press 4 stopped most: 9 times, 412 minutes in all [S]. Most were hydraulic pressure losses [D2][D5], and the work order for the pump seal is still open [W1].",
"sources": [
{
"ref": "D2",
"kind": "downtime",
"id": "8a1b...",
"machine_id": "550e8400-e29b-41d4-a716-446655440000",
"machine_name": "Press 4",
"occurred_at": "2026-10-21T07:42:00Z",
"title": "Hydraulic pressure loss",
"status": "completed",
"detail": "unplanned",
"duration_minutes": 64
}
],
"totals_cited": true,
"totals": [
{
"machine_id": "550e8400-e29b-41d4-a716-446655440000",
"machine_name": "Press 4",
"alerts": 14,
"critical_alerts": 3,
"work_orders_opened": 4,
"work_orders_completed": 3,
"downtime_events": 9,
"downtime_minutes": 412,
"maintenance_events": 2
}
],
"searched": { "alert": 212, "work_order": 37, "downtime": 58, "maintenance": 19 },
"period_days": 30
}
FieldDescription
answerA short answer, up to eight sentences. null when the period holds no records to answer from; no model is asked then.
sourcesThe records the answer cites, in the order it first cites them. ref is how it cites them: A for an alert, W a work order, D downtime, M maintenance.
totals_citedWhether the answer cites the period totals ([S])
totalsExact totals per machine (the busiest 25), with a last row for all machines together (machine_id: null). A kind the caller cannot open is null, not zero.
searchedHow many records of each kind the period holds, of the kinds the caller can open

What it reads​

  • Only the kinds of record the caller's role can open, on the machines their access reaches, in the period chosen. A role that can open none of them gets 403.
  • Planned maintenance up to 30 days ahead counts as in the period, so "what is coming up?" can be answered.
  • The model is shown the records that best match the question, at most 40, never all of them. Beside them it gets exact totals counted over every record in the period, so a counting question ("which machine stopped most?") is answered from the counts, not from the sample.
  • A citation of a record it was not shown is removed before the answer is returned, so every source is a real record.

Switching it off, and your own model​

The assistant is one of the optional AI features, with the written health narratives, suggested alert thresholds and automatic tag mapping. An administrator can switch them all off in one place (Settings → AI in the portal); while they are off, this endpoint returns 403, no model is called and none of your data is sent to one. An administrator can also point them at the company's own model; if that is chosen but no address is set yet, the endpoint returns 409.

Errors​

StatusWhen
403AI features are switched off, AI Insights is not included for your company, or the caller's role can open none of the records it reads
404machine_id is not a machine the caller can see
409The company's own model is chosen but not configured
422A question outside 3–500 characters, or a period_days not offered
429More than 20 questions in 10 minutes from one person; more than 60 AI requests in 10 minutes across your company (shared with suggested alert thresholds, health narratives and automatic tag mapping); or your company has used its monthly AI allowance of Haltless's model, which renews on the first of the month. A company on its own model is not held to the allowance
502The model could not answer just now; try again