From Fault Code to Fix: A Troubleshooting Copilot for Robot Cells
SMART measures resilience by how fast a line recovers, and on a robotised line most recoveries start with a
technician reading a fault code. This copilot is designed for ABB robot cells. It reads the controller’s event
log, searches the manuals, and looks up how the same fault was fixed on this cell before. It proposes a
diagnosis, and it quotes safety steps word for word instead of paraphrasing them.
ContextUniversity of Skövde · SMART (KK-stiftelsen) · 2026 · system design
ResultSystem design — architecture, safety guardrails and a replay-based evaluation plan. No field results are claimed yet.
What this page is. A system design for a use case in SMART’s operational and socio-technical
resilience strands. It is not a report of a deployment at ABB or any other partner. Figures marked target
are release gates. They are not measured results.
Stakeholder engagement · problem formulation
Recovery time is mostly search time
The fix is usually known. It is somewhere in a manual, a ticket or one person’s memory.
When a robot cell stops, the controller logs an event code and a short message. The technician then has to work
out the cause from three places that do not talk to each other: the product and operating manuals, the plant’s
maintenance history for that cell, and the safety procedure for going inside the fence. On the night shift the
colleague who fixed it last time is usually not there.
In SMART’s terms this is the recovery part of the resilience curve. A shorter search is a shorter dip, and it
requires no new hardware.
Architecture · tool-calling agent
One agent, three tools, and a guardrail it cannot talk its way past
Manuals, history and safety each get the retrieval method that suits them.
The agent decides which tools to call; the guardrail and the write-back are fixed code, not model behaviour.
Manual search. Product and operating manuals, chunked by section and tagged by robot model and
controller generation. The cell’s own model is a hard filter, because the fix for one controller can be
wrong for the next.
Maintenance history. The model writes SQL against a read-only view with a whitelisted schema.
Queries are parsed and rejected unless they are single SELECT statements. It answers “how often has this
cell thrown this code this quarter, and what fixed it?”
Similar incidents. Past tickets are embedded as symptom, cause and fix, so a fault that looks
new is matched to one that was fixed eight months ago on a sister cell.
Why pgvector and not a separate vector database: the maintenance records already live in a
relational database. Keeping vectors next to them means one backup, one access model, and joins such as
“similar incidents, on this cell model, in the last year” in a single query.
Guardrails · socio-technical safety
A paraphrased lockout step is a new, untested procedure
SMART’s socio-technical strand is about people and robots sharing work safely. That applies here too.
Verbatim safety text. Any step that involves entering the cell, lockout/tagout or disabling a
safety function is copied from the plant’s approved procedure by ID, then checked by string comparison
against the source. The model can choose which procedure applies, but it never writes the text.
No actions on the robot. The copilot is read-only. It does not write to the controller, and
every step it proposes is carried out by a person.
Confidence shown, not hidden. Causes are ranked, each with its evidence. When the evidence is
weak the card says “escalate” and names who to call.
Context engineering
A shift’s worth of logs does not fit in a prompt, and should not
What the agent sees is selected on purpose.
Log windowOnly events in a time window around the stop go in, collapsed into
counts per code. The first event in the cascade is flagged, because that is usually the cause.
Compact tool resultsSQL results come back as small tables and manual hits as section IDs
with short excerpts. The agent can fetch the full section if it needs it.
Cell profileRobot model, controller version, tool, and recent changes to the cell are fixed
context that every call gets without having to ask for it.
Evaluation · ticket replay
Tested against faults that were already fixed
The historical tickets supply both the test questions and the answer key.
Closed maintenance tickets are replayed. The copilot gets the event log and the technician’s first note, and
its ranked causes are compared with the cause that was actually confirmed. To prevent leakage, a ticket’s own
resolution is removed from the index while it is being scored.
Metric
How it is measured
Release gate (target)
Root cause in top 3
Confirmed cause appears among the three ranked causes
≥ 0.75
Safety text exactness
Safety steps identical to the approved procedure, by string match
1.00 (hard gate)
SQL safety
Generated queries rejected by the parser if not read-only; red-team prompts included
0 escapes
Correct escalation
Tickets with no documented fix routed to “escalate”
≥ 0.90
Time to first card
p95, from fault code to the first ranked cause on screen
< 8 s
The metric that matters to SMART, mean time to repair, can only be measured on the line. The
replay suite is how the copilot earns a place there.
Full stack
Designed for a tablet at the fence, with gloves on
A React front end, a FastAPI back end and one database.
Front endReact + TypeScript with large touch targets, the diagnosis as one card, and
sources one tap away. It still shows the last results when the Wi-Fi drops.
Back endFastAPI running the LangGraph agent, with typed tool schemas (Pydantic) and a
step limit per request, so a confused agent cannot loop.
DataPostgreSQL with pgvector for manuals, tickets and embeddings. It is containerised with
Docker and deployed on Azure, with every agent step logged for audit.