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.
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.
How work is evaluated
Evaluates visual defect classification accuracy and inference pipeline execution speed.
Shared data for this challenge
Review public datasets and any private uploads tied to your build.
How submissions are scored
These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.
latency_check
Verifies execution latency is below 500 milliseconds limit.
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
classification_accuracy
Accuracy of defect classification across vision benchmark set. • target: 0.98 • range: 0-1
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
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
Reference links and supporting material
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
- Verifies execution latency is below 500 milliseconds limit.
- Accuracy of defect classification across vision benchmark set. • target: 0.98 • range: 0-1
- Benchmark: Industrial Vision Quality Inspection
- Classification Accuracy target: 0.98
- 1 public reference case
- JavaScript execution harness
- javascript sandbox (unavailable on Versalist)
View technical recipe
Configured tools
- Mastra AI · Required
- Replicate · Optional
- 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.