KLIQ|Developers

Machine Assessment (MachineScan)

This recipe walks through evaluating a CNC machining center using the MachineScan vertical: from catalog lookup to an ASA equipment condition report with ISO 4628 coating grades and maintenance recommendations.

What you will build

An industrial equipment assessment workflow that locates a CNC machine in the catalog, creates an inspection with the ASA equipment condition schema, uploads nameplate and damage-area photos, and delivers a 6-tier ASA grade alongside ISO 4628 coating scores and a prioritised maintenance recommendation.

1. Set up the client

import { KliqClient } from '@kliq-ai/sdk';

const kliq = new KliqClient({ apiKey: process.env.KLIQ_API_KEY! });
const tenant = kliq.forTenant('t_abc123');

2. Browse the catalog for CNC machines

// Browse equipment types in the MachineScan catalog
const types = await kliq.catalog.types.list({ verticalSlug: 'machine-scan' });

console.log(types.map(t => t.slug));
// ["cnc-machining-centers", "cnc-lathes", "injection-molding",
//  "presses-stamping", "compressors-pumps"]

// Look up the specific machine by catalog slug
const machine = await kliq.catalog.items.get('haas-vf4-vmc');

console.log(machine.name);
// "Haas VF-4 Vertical Machining Center"

console.log(machine.attributes);
// { make: 'Haas', model: 'VF-4', type: 'VMC',
//   tableSize: '1067 × 508 mm', spindleSpeed: '8100 rpm', year: 2018 }

console.log(machine.type.gradingSchemaSlug);
// "asa-equipment-condition"

3. Create the inspection

const inspection = await tenant.inspections.create({
  catalogItemSlug: machine.slug,
  gradingSchemaSlug: machine.type.gradingSchemaSlug,
  notes: 'Pre-sale asset assessment. Machine in current production use.',
  metadata: { plant: 'facility-chicago-02', assetTag: 'CHI-CNC-0041' },
});

console.log(inspection.id); // "insp_mac001"

4. Upload photos

ASA assessments require a nameplate photo for model verification, a full-machine overview, and close-ups of any damage or wear areas.

const photoAngles = [
  { file: nameplateImage,  angle: 'nameplate',  notes: 'Serial number and model verification' },
  { file: overallImage,    angle: 'overall',    notes: 'Full machine from operator side' },
  { file: spindleImage,    angle: 'spindle',    notes: 'Spindle head and tool changer' },
  { file: tableImage,      angle: 'table',      notes: 'Work table surface and T-slots' },
  { file: controlImage,    angle: 'control',    notes: 'CNC control panel condition' },
  { file: damageImage,     angle: 'damage',     notes: 'Coolant manifold corrosion — left side' },
];

const observations = await Promise.all(
  photoAngles.map(async ({ file, angle, notes }) => {
    const { uploadUrl, imageUrl } = await tenant.observations.getUploadUrl({
      filename: `haas-vf4-${angle}.jpg`,
      contentType: 'image/jpeg',
    });

    await fetch(uploadUrl, {
      method: 'PUT',
      body: file,
      headers: { 'Content-Type': 'image/jpeg' },
    });

    return tenant.observations.create({
      locationId: 'loc_chicago_02_floor',
      imageUrl,
      metadata: { inspectionId: inspection.id, angle, notes },
    });
  })
);

console.log(`Uploaded ${observations.length} photos`);

5. Trigger AI grading

await tenant.inspections.grade(inspection.id);

The platform loads ASA equipment condition descriptors for cnc-machining-centers and runs ISO 4628 coating analysis alongside the structural assessment.

6. Poll for results

let result = await tenant.inspections.get(inspection.id);

while (result.status === 'grading') {
  await new Promise(r => setTimeout(r, 3000));
  result = await tenant.inspections.get(inspection.id);
}

console.log('AI grades:', result.aiGrades);
// {
//   mechanical:       'Good',       // Tier 2 — no visible structural damage
//   electrical:       'Good',       // Tier 2 — control panel intact
//   cosmetic:         'Fair',       // Tier 3 — paint chips and coolant staining
//   coating_rust:     'Ri2',        // ISO 4628-3: slight rusting (<0.5% area)
//   coating_blistering: 'B(S)2',   // ISO 4628-2: slight blistering, size 2
//   overall:          'Good',       // ASA Tier 2
//   maintenancePriority: 'medium'
// }

ASA Equipment Condition Tiers

TierLabelDescription
1ExcellentLike-new; minimal wear; no repairs needed
2GoodNormal wear; fully operational; minor cosmetics
3FairModerate wear; operational with minor repairs needed
4PoorHeavy wear; requires repairs before reliable use
5Needs RepairNot operational; significant repair required
6SalvageBeyond economic repair; parts value only

7. Human review and override

// Field engineer confirms grades after physical checks
const finalized = await tenant.inspections.submitHumanGrades(inspection.id, {
  grades: {
    mechanical:          'Good',
    electrical:          'Good',
    cosmetic:            'Fair',   // confirmed — coolant manifold needs replacement
    coating_rust:        'Ri2',    // confirmed
    coating_blistering:  'B(S)2',  // confirmed
    overall:             'Good',
    maintenancePriority: 'medium',
  },
  notes: 'Coolant manifold shows active corrosion. Schedule replacement within 90 days. Spindle hours: 6,240.',
});

console.log('Final grade:', finalized.finalGrades.overall); // "Good"
console.log('Status:', finalized.status); // "completed"

8. Read the final report

const report = await tenant.inspections.get(inspection.id);

console.log(`Machine: ${report.catalogItem.name}`);
console.log(`Schema: ${report.gradingSchema.name}`);
console.log(`Overall: ASA ${report.finalGrades.overall}`);
console.log(`Coating rust: ${report.finalGrades.coating_rust} (ISO 4628-3)`);
console.log(`Maintenance priority: ${report.finalGrades.maintenancePriority}`);
console.log(`Human reviewed: ${report.humanReviewed}`);
console.log(`Completed: ${report.completedAt}`);

// Machine: Haas VF-4 Vertical Machining Center
// Schema: ASA Equipment Condition Standard
// Overall: ASA Good
// Coating rust: Ri2 (ISO 4628-3)
// Maintenance priority: medium
// Human reviewed: true
// Completed: 2026-04-28T18:00:00Z

Next steps