AI assistant
Ask about production data and review actions before confirming them.
Ask the built-in assistant about production data. Your role needs ai-chat.use; each tool also checks its own permissions. Read actions run immediately, while changes require your explicit confirmation.
AI assistant
What you see
A button with a star icon (Sparkles) labeled "Ask the AI assistant…" in the
top navigation bar, in the spot where the global search (GlobalSearch)
used to be. The button is visible only to an operator with the ai-chat.use
permission.
Clicking it opens a floating chat panel (not a separate desktop window, but a float on top of the interface):
- A header with an icon and a close button.
- A message area: operator and assistant messages alternate like an ordinary chat. The assistant's reply is typed out as a stream, as it is generated ("Thinking…" text is shown until the first tokens arrive).
- Inside the assistant's replies, specific Vyrab objects (parts, orders, nonconformities, etc.) are rendered as named links: clicking one opens that object's card in the object inspector (Getting started), without leaving the current screen. The assistant is not allowed to print raw Markdown links, URLs, or IDs — the interface itself turns names known from tool results into clickable links, so no stray or invented address can appear in the text.
- Every read-tool call is shown as a separate "chip" line (for example, "🔍 search"); if the tool returned a specific object, the chip has a button with that object's type and number — it also opens the card in the inspector.
- An input field at the bottom and a send button. While a reply is being generated, or while there is text typed into the field, the panel does not close either on an outside click or on Escape — an accidental loss of focus does not interrupt the conversation.
Typical scenarios
A question about data (no changes):
- The operator opens the panel and types a question in natural language — for example, "which materials are short for order #145" or "show me customer orders that are at risk of missing their deadline this coming week."
- The assistant decides for itself which read tool to call (search over parts/orders, production order status, material shortage, customer order readiness, warehouse stock, place workload, QC/defects summary, part cost — the full list is below), runs it immediately (no confirmation needed), and formulates an answer from the result.
- If the operator lacks permission for the needed tool, the assistant does not pretend the data doesn't exist — it names the specific missing permission.
An action requiring confirmation:
- The operator asks something like "create customer order #2026-14 for customer OOO Romashka" or "raise the priority of order X to 5."
- Before changing any data, the assistant briefly describes in the text what it is about to do, then calls the write tool.
- A pending action card appears in the chat: a title (a human-readable
operation name, if the interface recognizes it — otherwise the tool's
name as-is), a description from the model, and a list of the specific
call parameters (
dlwith all the fields passed). Two buttons — "Cancel" and "Confirm." - Until the card is resolved, further chat input is not sent on to perform the action by itself — the conversation waits for the operator's decision on that specific card.
- On "Confirm" the action is executed the same way as an ordinary REST request (reusing the existing router's code), and the result is added to the chat. On "Cancel" the assistant is told "Rejected by the operator" — it does not try to repeat the action itself.
Assistant tools
Read tools (run immediately, each guarded by its own permission): search for objects by name/number/part number; list of parts; list and detailed status of production orders; material shortage (across the whole active plan or for one order); a full customer order; customer order readiness (supply/production/reservation/shipment); orders at risk of missing their deadline; warehouse stock and movements for a part; overloaded places by shift assignments; QC summary (defect Pareto, open nonconformities); material and labor cost of a part.
Write tools (always require confirmation): create a customer order (draft); add a line to a customer order; create a supplier order to cover a shortage; create a draft production order; change a production order's priority; assign/unassign an operation's performer; recompute and save the production plan (scheduler). The set is deliberately small — this is not general-purpose data entry, but a short, explicitly enumerated list of operations.
Notes and limitations
- The assistant is unavailable without an OpenAI key configured on the
server (
OPENAI_API_KEY) — if the key is not set, the chat shows an error message, "AI assistant is not configured…". This is an administrator setting, not an operator one. - Conversation history lives only in the browser: closing the tab or reloading the page resets the chat. The server does not store the correspondence.
- There is a cap on the number of automatic steps within a single reply (no more than 8 consecutive tool calls) — a safeguard against the model looping; if exceeded, the conversation ends with an error rather than waiting forever.
- The
ai-chat.usepermission is a general on/off switch for the feature; it does not replace the permission check on each individual tool. An operator withai-chat.usebut without, say,cost.view, will not get cost figures from the assistant — the tool returns a permission denial, not invented numbers. - The assistant is explicitly forbidden from converting units without recalculating and from inventing names of objects that were not present in tool results — these rules are set by the system prompt rather than enforced by code; this limits, but does not fully eliminate, model mistakes.
- The confirmation card's title is human-readable for only two write tools (creating a customer order and adding a line); for the rest, the tool's technical name is shown.