Inspiration
Inspiration
Industrial machines often remain in service for decades, but the people who understand their behavior change roles, retire, or leave. Machines produce enormous amounts of telemetry, yet the reasoning that connects symptoms, operating context, corrective actions, and actual results is rarely preserved.
From my experience in industrial controls, I have also seen machines degrade while remaining technically operational. Cycle time increases, quality drifts, energy consumption rises, or maintenance risk grows before a conventional PLC fault appears.
I built Machine Agent around a simple North Star: an intelligent service should create measurable value on one standalone machine—even if that machine never connects to a fleet. Broader site, fleet, enterprise, and cross-OEM learning should expand that value, not be required for it.
What it does
Machine Agent is an edge-to-cloud industrial Agent that:
- Connects directly to an industrial machine through OPC UA.
- Observes completed production cycles and learns machine-and-recipe-specific baselines.
- Detects deterministic process drift without relying on hidden simulator information.
- Retains evidence locally and continues monitoring during cloud outages.
- Sends structured drift evidence to a private Google Cloud workflow.
- Uses Gemini to separate measured facts from hypotheses and recommended checks.
- Retrieves previously validated lessons only when machine, recipe, revision, and evidence compatibility rules are satisfied.
- Presents a bounded experiment to a site engineer for approval or rejection.
- Rechecks machine identity, state, alarms, expiry, expected value, and certified limits locally.
- Applies one allowlisted OPC UA setpoint adjustment between machine cycles.
- Reads the physical value back from OPC UA.
- Evaluates the first causally valid post-write cycle to determine whether the experiment helped, hurt, had no effect, or was inconclusive.
This is an autonomous operational workflow rather than a chatbot. The Agent observes, detects, investigates, remembers, requests action, executes within explicit authority, and measures the result.
The language models never enter the machine safety path. PLC logic, engineered limits, and deterministic local checks retain final authority.
How I built it
The machine-local runtime is built with Node.js and node-opcua. It subscribes directly to OPC UA signals, normalizes machine events, aggregates process cycles, freezes baselines, detects drift, and stores events in a durable offline outbox.
For portability, I built a Node OPC UA compatibility simulator representing two industrial mixers. Each machine exposes identity, state, recipe, process measurements, heater command and feedback, quality, energy, alarms, and batch context. A Web HMI controls the demonstration and injects degradation, but the Agent cannot read the hidden fault variable or use the HMI as its data gateway.
The private cloud workflow runs on Google Cloud Run and persists operational records in Firestore. Google Genkit orchestrates the primary investigation workflow.
Google AI model responsibilities
- Gemini 3.5 Flash investigates deterministic drift evidence and produces measured facts, hypotheses, recommended checks, and a bounded experiment draft.
- gemini-embedding-001 semantically ranks validated lessons after deterministic machine and recipe compatibility filtering.
- Gemma 4 MaaS independently challenges unsupported claims, conflicts, and uncertainty in the investigation.
- Chirp 3 Speech-to-Text is implemented as an optional path for converting technician voice notes into timestamped incident evidence.
Every model has an explicit authority limit. Embedding similarity cannot bypass compatibility rules. Gemma cannot create or approve an action. A voice transcript is evidence, never approval. Gemini cannot write to OPC UA.
The site engineering portal exposes incidents, evidence, model records, experiment bounds, decisions, actions, and measured outcomes. A human can approve or reject a proposed experiment, but approval still cannot bypass the Machine Agent's final local checks.
Architecture and governance
Machine Agent separates probabilistic reasoning from deterministic machine authority:
- Models may investigate evidence and recommend checks.
- Deterministic services decide whether a lesson is compatible.
- A human approves or rejects the bounded experiment.
- The edge Agent verifies current physical conditions.
- The PLC and existing safety controls retain authority.
- Machine measurements—not the model—grade the outcome.
Every model invocation can be recorded in a model-evidence ledger with its model identifier, timestamp, latency, input provenance, output or error, fallback status, and authority limitation.
Challenges
Establishing causality
A machine cycle could begin before an action but finish after it. If I evaluated events only by arrival time, the system could falsely credit the adjustment for a cycle it did not influence.
I changed the outcome verifier so only a cycle that actually began after the physical write can grade the experiment.
Avoiding alert and incident flooding
An early workflow created a new incident and experiment for every degraded cycle. That would rapidly destroy trust in a real plant.
I replaced event-level creation with one evolving active incident per unresolved condition, occurrence enrichment, explicit lifecycle states, experiment suppression, recovery, and cooldown.
Preserving the industrial boundary
The Web HMI initially risked becoming part of the Agent's data path. I corrected the architecture so the Agent owns the OPC UA connection directly. The HMI is now only a demonstration and control surface.
Making the demonstration portable
The original industrial simulator was associated with CODESYS, but judges cannot be expected to install a proprietary controls runtime. I built a portable Node OPC UA simulator that preserves the real protocol contract while making the complete workflow reproducible on an ordinary computer.
Balancing ambition with honesty
The long-term vision extends from one machine to site, customer-fleet, enterprise, and cross-OEM learning. For the hackathon, I reduced that vision to a complete two-mixer vertical slice and clearly labeled the higher learning layers as future scope.
What I learned
The most important lesson was that industrial AI needs a trustworthy harness more than it needs one proprietary foundation model.
The defensible system is the combination of:
- machine context and semantic data contracts;
- evidence provenance;
- deterministic compatibility rules;
- explicit tools and permissions;
- offline memory and reliable delivery;
- human and machine authority boundaries;
- idempotent action execution;
- physical readback;
- and outcome-based evaluation.
Models are replaceable reasoning components inside that system. Trust comes from what they are allowed to do, which evidence they use, how they fail, and whether subsequent machine behavior supports their recommendation.
I also learned that human approval alone is not a sufficient safety mechanism. Conditions may change between approval and execution, so the edge must retain final authority and recheck the current machine state.
Accomplishments
- Built a complete evidence-to-action-to-outcome workflow.
- Connected the Agent directly to a real OPC UA server.
- Implemented offline store-and-forward behavior.
- Deployed a private Cloud Run and Firestore backend.
- Integrated Gemini, Google embeddings, and Gemma with distinct product responsibilities.
- Implemented an optional Chirp technician-evidence workflow.
- Added deterministic compatibility and action guards.
- Added physical OPC UA write readback and causal outcome verification.
- Created a portable two-machine OPC UA simulator.
- Passed 34 automated tests, including direct OPC UA integration coverage.
What's next
The next product step is partnering with an OEM around a repeatable machine family. The OEM and Machine Agent team would document machine behavior, OPC UA semantics, recipes, supported variations, faults, maintenance schedules, common replacement parts, action limits, and measures of good production.
Only after a machine package demonstrates reliable monitoring, drift detection, diagnostic value, and governed improvement in the OEM lab would it be certified for customer installation.
Future learning layers can then aggregate compatible, outcome-backed lessons across a site, a customer's fleet, an enterprise, and eventually different OEM machine families and industries—while preserving the standalone value and authority of each Machine Agent.
Important scope
This prototype is not a production safety system or a claim of autonomous factory operation. It demonstrates the architectural foundation for evidence-grounded industrial Agents: direct machine integration, deterministic governance, human-approved bounded action, and measured outcomes.
What it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for K-Saver
Built With
- 3.5
- agentic
- ai
- chirp
- codesys
- edge
- firestore
- flash
- gemini
- gemini-embedding-001
- gemma
- genkit
- javascript
- node-opcua
- node.js
- opc
- speech-to-text
- ua
- vertex
- zod
Log in or sign up for Devpost to join the conversation.