Skip to main content

Defect Management

Persona

Role: Quality systems developer at an automotive parts manufacturer producing 50,000 units per week.

The quality engineering team manages defect reports through email and shared drives. Root cause analyses are documented in unstructured text files, and there is no systematic way to verify that resolutions actually prevent recurrence. The company needs a structured defect management system to support their continuous improvement program and customer audit requirements.

Business Problem

When a defect is reported, the investigation process is ad hoc. Engineers document findings in different formats, root cause analyses vary in rigor, and there is no feedback loop to verify that corrective actions worked. Customer audits require demonstrating a closed-loop defect management process, which currently takes weeks to compile from scattered documents. This scenario builds a defect management workflow that formalizes reporting, structures root cause analysis, and tracks resolutions through verification.

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 DefectReport, RootCauseAnalysis, and Resolution.

  • 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 Defect Management journey with complete, trusted context.
  • Required data: DefectReport context such as product, batch, description, and severity.
  • 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 Defect Management without forcing the human reviewer to assemble the case manually.
  • Required data: DefectReport state and history; RootCauseAnalysis fields such as method, findings, contributingFactors, and completedDate.
  • 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: RootCauseAnalysis execution state; Resolution fields such as action, verifiedBy, closedDate, and effective.
  • 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 DefectReport, RootCauseAnalysis, and Resolution.
  • 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 Defect Management through Object Types, tenant-scoped resources, document processing, chat workflows, and CLI verification. For this scenario, the main records are DefectReport, RootCauseAnalysis, and Resolution.

Process stepWhat EAI providesCalling pattern
Step 1. Capture demand and contextTenant-scoped intake resources for DefectReport context such as product, batch, description, and severity. 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 DefectReport records with useResources('DefectReport') or eai resources create DefectReport, and keep browser calls behind /api/eai/....
Step 2. Prepare the decisionLinked resource queries over DefectReport state and history; RootCauseAnalysis fields such as method, findings, contributingFactors, and completedDate. Search, schema checks, document classification or RAG indexing, and chat summaries turn raw context into a prepared decision.Use useResources('DefectReport') 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 RootCauseAnalysis execution state; Resolution fields such as action, verifiedBy, closedDate, and effective. 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 DefectReport, RootCauseAnalysis, and Resolution. 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 Defect Management with Object Types for DefectReport, RootCauseAnalysis, Resolution. 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
DefectReportproduct (text), batch (text), description (text), severity (select: cosmetic, minor, major, critical), reportedDate (date), status (select: open, investigating, resolved, closed)one-to-many → RootCauseAnalysis, one-to-many → ResolutionbeginInvestigation
RootCauseAnalysismethod (select: 5-why, fishbone, fmea, fault-tree), findings (text), contributingFactors (text), completedDate (date)many-to-one → DefectReport--
Resolutionaction (text), verifiedBy (text), closedDate (date), effective (boolean), status (select: planned, implemented, verified)many-to-one → DefectReportverifyResolution

CLI Workflow

  1. Scaffold the project

    eai init defect-management
  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 DefectReport, RootCauseAnalysis, and Resolution types in src/eai.config/object-types.ts (see code example below).

  4. Validate the type definitions

    eai types validate
    Tenant: defect-management
    ✔ DefectReport — 5 props, 2 links, 1 action
    ✔ RootCauseAnalysis — 4 props, 1 link, 0 actions
    ✔ Resolution — 5 props, 1 link, 1 action

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

    eai types seed
  6. Create sample resources

    eai resources create DefectReport --data '{"product": "Brake Caliper BC-400", "batch": "B-2025-0712", "description": "Surface pitting on machined face", "severity": "major", "reportedDate": "2025-07-12", "status": "open"}'
  7. Start local development

    eai dev

Code Example

// src/eai.config/object-types.ts
export const objectTypes = {
'defect-management': [
{
name: 'DefectReport',
displayName: 'Defect Report',
description: 'A formal defect report for a manufactured product',
properties: [
{ name: 'product', type: 'text' as const, required: true, indexed: true },
{ name: 'batch', type: 'text' as const, required: true, indexed: true },
{ name: 'description', type: 'text' as const, required: true },
{ name: 'severity', type: 'select' as const, required: true, options: [
{ label: 'Cosmetic', value: 'cosmetic' },
{ label: 'Minor', value: 'minor' },
{ label: 'Major', value: 'major' },
{ label: 'Critical', value: 'critical' },
]},
{ name: 'reportedDate', type: 'date' as const, required: true, indexed: true },
{ name: 'status', type: 'select' as const, required: true, defaultValue: 'open', options: [
{ label: 'Open', value: 'open' },
{ label: 'Investigating', value: 'investigating' },
{ label: 'Resolved', value: 'resolved' },
{ label: 'Closed', value: 'closed' },
]},
],
linkTypes: [
{ name: 'rootCauseAnalyses', targetObjectType: 'RootCauseAnalysis', cardinality: 'one-to-many' as const },
{ name: 'resolutions', targetObjectType: 'Resolution', cardinality: 'one-to-many' as const },
],
actions: [
{
name: 'beginInvestigation',
displayName: 'Begin Investigation',
description: 'Start root cause analysis on a defect report',
requiredRole: 'tenant-staff',
validationRules: { requiredFields: ['product', 'description', 'severity'], requiredStatus: 'open' },
sideEffects: [
{ type: 'set_field', field: 'status', value: 'investigating' },
],
},
],
status: 'published' as const,
},
{
name: 'RootCauseAnalysis',
displayName: 'Root Cause Analysis',
description: 'A structured root cause analysis for a defect',
properties: [
{ name: 'method', type: 'select' as const, required: true, options: [
{ label: '5-Why', value: '5-why' },
{ label: 'Fishbone', value: 'fishbone' },
{ label: 'FMEA', value: 'fmea' },
{ label: 'Fault Tree', value: 'fault-tree' },
]},
{ name: 'findings', type: 'text' as const, required: true },
{ name: 'contributingFactors', type: 'text' as const, required: true },
{ name: 'completedDate', type: 'date' as const, required: false },
],
linkTypes: [
{ name: 'defectReport', targetObjectType: 'DefectReport', cardinality: 'many-to-one' as const },
],
actions: [],
status: 'published' as const,
},
{
name: 'Resolution',
displayName: 'Resolution',
description: 'A corrective action and its verification for a defect',
properties: [
{ name: 'action', type: 'text' as const, required: true },
{ name: 'verifiedBy', type: 'text' as const, required: false },
{ name: 'closedDate', type: 'date' as const, required: false },
{ name: 'effective', type: 'boolean' as const, required: false },
{ name: 'status', type: 'select' as const, required: true, defaultValue: 'planned', options: [
{ label: 'Planned', value: 'planned' },
{ label: 'Implemented', value: 'implemented' },
{ label: 'Verified', value: 'verified' },
]},
],
linkTypes: [
{ name: 'defectReport', targetObjectType: 'DefectReport', cardinality: 'many-to-one' as const },
],
actions: [
{
name: 'verifyResolution',
displayName: 'Verify Resolution',
description: 'Verify that the corrective action effectively prevents recurrence',
requiredRole: 'tenant-staff',
validationRules: { requiredStatus: 'implemented' },
sideEffects: [
{ type: 'set_field', field: 'status', value: 'verified' },
{ type: 'set_timestamp', field: 'closedDate' },
{ type: 'set_user', field: 'verifiedBy' },
],
},
],
status: 'published' as const,
},
],
};

Key Takeaways

  • Closed-loop process: The workflow enforces a complete cycle from defect reporting through root cause analysis to verified resolution, satisfying audit requirements.
  • Structured analysis methods: Root cause analyses specify the methodology used (5-Why, Fishbone, FMEA, Fault Tree), ensuring consistent investigation rigor.
  • Verification step: Resolutions must be explicitly verified as effective before closure, preventing premature sign-off on corrective actions.
  • Batch traceability: Linking defects to specific batches and products enables trend analysis across production runs and product lines.