Skip to main content

Equipment Maintenance

Persona

Role: Industrial IoT developer at a plastics manufacturer operating 80+ machines across two plants.

Maintenance is entirely reactive -- machines break, technicians scramble to fix them, and the same failures repeat because there is no preventive maintenance schedule. Repair history lives in technicians' memories, spare parts usage is untracked, and downtime costs are estimated rather than measured. The company wants to shift from reactive to preventive maintenance.

Business Problem

Unplanned downtime is the most expensive problem on the factory floor. Without maintenance schedules, equipment runs until failure. Without repair logs, the same issues are diagnosed from scratch each time. Without parts tracking, critical spares run out at the worst moments. This scenario builds an equipment maintenance system that schedules preventive maintenance, logs every repair with parts and duration, and provides a complete service history for each machine.

Four-Step Application

This scenario works best as a four-step, human-in-the-loop application. The existing object model already gives this scenario a strong delivery backbone through Equipment, MaintenanceSchedule, and RepairLog.

  • Mission metric focus: higher throughput, lower defect rates, and stronger operational resilience.
  • Human + AI pattern: Each step combines structured workflow data with chat assistance, background generation, document understanding, and accessible interaction patterns when they improve the experience.

Step 1. Capture demand and context

  • Goal: Make it easy for the user to start the Equipment Maintenance journey with complete, trusted context.
  • Required data: Equipment context such as name, type, location, and lastService.
  • AI support: Use chat to guide intake, generate clearer prompts, create accessible summaries, and assist with voice or vision-led capture when a form alone is not the best experience. EAI can support structured intake, chat workflows, and document-centred capture today; richer native multimodal capture may still need workflow extensions or connected services.
  • Business impact: Improve completion rate, reduce first-touch effort, and raise customer or staff confidence in the UX from the very first interaction.
  • EAI delivery: Model the intake as tenant-isolated object types and resources, then use actions, chat workflows, and document indexing or classification to keep the initial record complete and usable.

Step 2. Prepare the decision

  • Goal: Turn the captured context into the next best action for Equipment Maintenance without forcing the human reviewer to assemble the case manually.
  • Required data: Equipment state and history; MaintenanceSchedule fields such as frequency, nextDue, description, and status.
  • AI support: Run background summarisation, extraction, classification, recommendation drafting, and answer generation so a reviewer sees a prepared case instead of raw fragments. EAI delivers the structured records and AI workflow hooks for this today; specialised scoring engines, external rules, or advanced reasoning controls may still need integration work.
  • Business impact: Reduce cycle time, improve quality and consistency, and protect the mission-critical metric before the case moves into execution.
  • EAI delivery: Link records across the scenario, persist decision state as resources, and use workflow actions plus chat assistance to keep humans in control while AI prepares the work.

Step 3. Execute and collaborate

  • Goal: Coordinate the actual work, handoffs, approvals, and user updates needed to deliver the service or outcome.
  • Required data: MaintenanceSchedule actions such as completeMaintenance; RepairLog fields such as issue, technician, duration, and parts.
  • AI support: Draft replies, produce work packets, monitor exceptions in the background, and surface the next action for each operator. EAI can orchestrate tenant-isolated records, actions, chats, and document workflows today; deeper system-to-system automation may require additional connectors or workflow capability.
  • Business impact: Increase operator productivity, reduce rework across handoffs, and improve service consistency across the application journey.
  • EAI delivery: Use linked object types, actions, resource updates, and workflow-triggered AI assistance so the team can execute in one model instead of splitting work across disconnected tools.

Step 4. Resolve, explain, and improve

  • Goal: Close the loop with a clear outcome, an understandable explanation, and feedback that improves the next case.
  • Required data: final status, outcome, audit history, and follow-up signals across Equipment, MaintenanceSchedule, and RepairLog.
  • AI support: Generate outcome summaries, customer-friendly answers, compliance-ready notes, management insights, and accessible follow-up content. EAI can store outcome records and support answer generation today, while richer proactive agents, advanced analytics, or channel-specific accessibility features may need additional product capability.
  • Business impact: Increase trust, quality, and measurable business value through higher throughput, lower defect rates, and stronger operational resilience.
  • EAI delivery: Keep the full audit trail in structured resources, use AI workflows to explain outcomes, and feed the resulting signals into future product, service, and operational improvement work.

EAI Platform Support By Step

EAI provides the safe service boundary for Equipment Maintenance through Object Types, tenant-scoped resources, document processing, chat workflows, and CLI verification. For this scenario, the main records are Equipment, MaintenanceSchedule, and RepairLog.

Process stepWhat EAI providesCalling pattern
Step 1. Capture demand and contextTenant-scoped intake resources for Equipment context such as name, type, location, and lastService. Object Type validation, starter forms, optional document intake, and chat-guided capture keep the first record complete.Define fields in src/eai.config/object-types.ts, run eai types validate and eai types seed, create initial Equipment records with useResources('Equipment') or eai resources create Equipment, and keep browser calls behind /api/eai/....
Step 2. Prepare the decisionLinked resource queries over Equipment state and history; MaintenanceSchedule fields such as frequency, nextDue, description, and status. Search, schema checks, document classification or RAG indexing, and chat summaries turn raw context into a prepared decision.Use useResources('Equipment') list/query/search patterns, verify shape with eai resources schema, use useDocuments().upload/classify/ragIndex, eai docs upload, eai docs classify, and eai docs index where supporting material exists, and send decision-support prompts through useChat(workflowId, 'chat') or eai chat send.
Step 3. Execute and collaborateResource updates and actions for MaintenanceSchedule actions such as completeMaintenance; RepairLog fields such as issue, technician, duration, and parts. Status changes, assignments, notes, generated work packets, and chat support keep humans in control during execution.Model actions in the Object Type code, call client.resources.executeAction(type, id, action) or the app hook equivalent, update records through the app service layer, and verify with eai resources get/list/query.
Step 4. Resolve, explain, and improveOutcome resources for final status, outcome, audit history, and follow-up signals across Equipment, MaintenanceSchedule, and RepairLog. Audit-friendly links, indexed final documents, reporting snapshots, and answer generation make the result explainable and reusable.Persist outcomes as resources, index final material with eai docs index or useDocuments().ragIndex, send explanation prompts with useChat or eai chat stream, and use eai resources aggregate/search for reporting checks.

Prompt, Code, And Service Pattern Mapping

The Object Type code example on this page is the implementation contract for the EAI platform services. eai-gofer should read that code as the source of truth for which resource, document, and chat calls belong in the app.

Use this prompt shape when asking eai-gofer or another coding agent to implement the scenario:

Use the EAI App Template. Model Equipment Maintenance with Object Types for Equipment, MaintenanceSchedule, RepairLog. Use useResources for records and actions, useDocuments for uploads/classification/RAG where documents appear, useChat for workflow assistance, and verify with eai types/resources/docs/chat commands. Use eai publicapi only when no named command covers the required platform call.
Scenario artifactHow it maps to EAI service calls
Four-step processStep 1 becomes resource creation, Step 2 becomes resource query/search plus optional document or chat preparation, Step 3 becomes resource update/action calls, and Step 4 becomes outcome persistence plus explanation/reporting calls.
Object Type definitionseai types validate, eai types seed, and eai resources schema make the model available and checkable before UI work starts.
Properties and indexesFields become useResources payloads, filters, list views, and eai resources create/list/query/search checks. Indexed fields should support lookup and triage, not duplicate canonical records.
Links between Object TypesRelationships become linked-resource UI, timeline context, and audit trails that app code loads through resource queries rather than separate bespoke stores.
Actions and status fieldsWorkflow buttons and operator transitions call resource action/update helpers, then verify state with eai resources get/list/query.
Document and chat promptsPrompts should call the platform documents and chat patterns: useDocuments().upload/classify/ragIndex, eai docs upload, eai docs classify, and eai docs index for documents, and useChat, eai chat send, or eai chat stream for conversational assistance.

Object Types

NameKey PropertiesLinksActions
Equipmentname (text), type (text), location (text), lastService (date), status (select: operational, maintenance, offline)one-to-many → MaintenanceSchedule, one-to-many → RepairLog--
MaintenanceSchedulefrequency (select: daily, weekly, monthly, quarterly, annual), nextDue (date), description (text), status (select: active, paused)many-to-one → EquipmentcompleteMaintenance
RepairLogissue (text), technician (text), duration (number), parts (text), cost (number), repairedDate (date)many-to-one → Equipment--

CLI Workflow

  1. Scaffold the project

    eai init equipment-maintenance
  2. Authenticate and pull environment

    eai login
    eai env pull --include-secrets
    If you are an external developer, see [Configuration](/docs/configuration) for login and local environment setup.
  3. Define your Object Types

    Create the Equipment, MaintenanceSchedule, and RepairLog types in src/eai.config/object-types.ts (see code example below).

  4. Validate the type definitions

    eai types validate
    Tenant: equipment-maintenance
    ✔ Equipment — 5 props, 2 links, 0 actions
    ✔ MaintenanceSchedule — 4 props, 1 link, 1 action
    ✔ RepairLog — 6 props, 1 link, 0 actions

    ✔ All Object Types are valid
  5. Seed types to the platform

    eai types seed
  6. Create sample resources

    eai resources create Equipment --data '{"name": "Injection Molder #7", "type": "Injection Molding Machine", "location": "Plant A, Bay 3", "lastService": "2025-06-01", "status": "operational"}'
  7. Start local development

    eai dev

Code Example

// src/eai.config/object-types.ts
export const objectTypes = {
'equipment-maintenance': [
{
name: 'Equipment',
displayName: 'Equipment',
description: 'A piece of manufacturing equipment or machinery',
properties: [
{ name: 'name', type: 'text' as const, required: true, indexed: true },
{ name: 'type', type: 'text' as const, required: true },
{ name: 'location', type: 'text' as const, required: true, indexed: true },
{ name: 'lastService', type: 'date' as const, required: false },
{ name: 'status', type: 'select' as const, required: true, defaultValue: 'operational', options: [
{ label: 'Operational', value: 'operational' },
{ label: 'Maintenance', value: 'maintenance' },
{ label: 'Offline', value: 'offline' },
]},
],
linkTypes: [
{ name: 'maintenanceSchedules', targetObjectType: 'MaintenanceSchedule', cardinality: 'one-to-many' as const },
{ name: 'repairLogs', targetObjectType: 'RepairLog', cardinality: 'one-to-many' as const },
],
actions: [],
status: 'published' as const,
},
{
name: 'MaintenanceSchedule',
displayName: 'Maintenance Schedule',
description: 'A recurring preventive maintenance schedule for equipment',
properties: [
{ name: 'frequency', type: 'select' as const, required: true, options: [
{ label: 'Daily', value: 'daily' },
{ label: 'Weekly', value: 'weekly' },
{ label: 'Monthly', value: 'monthly' },
{ label: 'Quarterly', value: 'quarterly' },
{ label: 'Annual', value: 'annual' },
]},
{ name: 'nextDue', type: 'date' as const, required: true, indexed: true },
{ name: 'description', type: 'text' as const, required: true },
{ name: 'status', type: 'select' as const, required: true, defaultValue: 'active', options: [
{ label: 'Active', value: 'active' },
{ label: 'Paused', value: 'paused' },
]},
],
linkTypes: [
{ name: 'equipment', targetObjectType: 'Equipment', cardinality: 'many-to-one' as const },
],
actions: [
{
name: 'completeMaintenance',
displayName: 'Complete Maintenance',
description: 'Record completion of a scheduled maintenance task',
requiredRole: 'tenant-user',
validationRules: { requiredStatus: 'active' },
sideEffects: [
{ type: 'set_timestamp', field: 'nextDue' },
],
},
],
status: 'published' as const,
},
{
name: 'RepairLog',
displayName: 'Repair Log',
description: 'A record of a repair performed on equipment',
properties: [
{ name: 'issue', type: 'text' as const, required: true },
{ name: 'technician', type: 'text' as const, required: true },
{ name: 'duration', type: 'number' as const, required: true },
{ name: 'parts', type: 'text' as const, required: false },
{ name: 'cost', type: 'number' as const, required: false },
{ name: 'repairedDate', type: 'date' as const, required: true, indexed: true },
],
linkTypes: [
{ name: 'equipment', targetObjectType: 'Equipment', cardinality: 'many-to-one' as const },
],
actions: [],
status: 'published' as const,
},
],
};

Key Takeaways

  • Preventive over reactive: Scheduled maintenance with configurable frequencies shifts the plant from costly breakdowns to planned service windows.
  • Repair history: A complete log of every repair, including parts used and time spent, enables pattern recognition for recurring failures.
  • Cost visibility: Tracking repair costs and duration per machine helps justify equipment replacement decisions with hard data.
  • Machine-level profiles: Linking schedules and repair logs to individual equipment creates a service history that follows each machine throughout its lifecycle.