Challenge

Visual Defect & Asset Quality Agent with Mastra AI and Replicate Vision Models

Undetected physical defects on high-speed motor control assembly lines lead to expensive plant downtime and product recalls. Build a TypeScript visual inspection workflow using Mastra AI and Replicate vision inference models to detect component assembly flaws in real time. Achieve 98% defect classification accuracy with sub-500ms execution latency.

EngineeringHosted by Vera
Challenge brief

What you are building

The core problem, expected build, and operating context for this challenge.

Develop a TypeScript Mastra AI workflow that routes camera frame captures to Replicate-hosted vision models for real-time assembly line defect classification.

Delivery guide

How work is evaluated

Evaluation

Evaluates visual defect classification accuracy and inference pipeline execution speed.

Datasets

Shared data for this challenge

Review public datasets and any private uploads tied to your build.

Loading datasets...
Evaluation rubric

How submissions are scored

These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.

Dimensions
2 scoring checks
Binary
2 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

latency_check

Verifies execution latency is below 500 milliseconds limit.

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

classification_accuracy

Accuracy of defect classification across vision benchmark set. • target: 0.98 • range: 0-1

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

What you should walk away with

  • Build a Mastra AI workflow pipeline with step functions for image payload processing

  • Integrate Replicate API inference endpoints running lightweight object detection vision models

  • Classify assembly component anomalies and generate instant rejection trigger signals

Resources and assets

Reference links and supporting material

Dataset notes

Annotated factory assembly component imagery depicting common mechanical flaws like loose connections and surface scratches.

How this agent runs

Evaluates visual defect classification accuracy and inference pipeline execution speed.

Challenge input

JSON with image_url, component_id, and expected_inspection_type

Mastra AI

TypeScript agent and workflow engine

Replicate

Host for open-source visual detection models

Evaluated output

JSON containing defect_detected boolean, defect_type, confidence, and processing_time_ms

Checks for
  • Verifies execution latency is below 500 milliseconds limit.
  • Accuracy of defect classification across vision benchmark set. • target: 0.98 • range: 0-1
Proof of success
  • Benchmark: Industrial Vision Quality Inspection
  • Classification Accuracy target: 0.98
  • 1 public reference case
Runtime evidence
  • JavaScript execution harness
  • javascript sandbox (unavailable on Versalist)
View technical recipe

Configured tools

Action Space
  • Mastra AI · Required
  • Replicate · Optional
Orchestration
  • Mastra AI · Required

Evaluation contract

  • latency_check · Weight 1
  • classification_accuracy · Weight 1

Recipe state

This is a preview. The configuration can change before the evaluation recipe is locked.

Frequently Asked Questions about Visual Defect & Asset Quality Agent with Mastra AI and Replicate Vision Models