Skip to main content
MAN-02 · Manufacturing

Quality Investigation Assistant

Outcome​

Drive a quality deviation from detection to closed corrective action by linking inspection data, batch genealogy, and specifications into an evidence-backed root cause that a quality engineer approves before CAPA release.

Portfolio attributeValue
Primary personaQuality engineer
Primary aggregateQualityInvestigation
Cosmos DB containers4
Grounding datadeviations, inspections, CAPAs, specifications
Development estimateUSD 60-220 monthly dev estimate
Runtime optionsPython FastAPI and C# ASP.NET Core

Productivity hypothesis​

These measures reflect the workflow, evidence, decision boundary, and industry risk for this use case.

Impact typeMeasureConservative internal assumptionCustomer measurement
ProductivityInvestigation rework6-12% reduction(baseline repeated or corrected investigation-step rate - assisted rate) / baseline rate * 100
Quality or riskFirst-pass acceptance6-10 percentage-point improvementassisted percentage accepted without material rework - baseline percentage accepted without material rework

Important: Conservative internal pilot assumptions only; not public benchmarks, commitments, or expected customer results. Validate against a comparable baseline or matched control cohort with mandatory human review.

Rationale: Deviation and CAPA investigation workflows benefit from evidence-preserving synthesis and fewer correction loops.

Pilot guardrail: Preserve the evidence chain and require quality approval for root cause, CAPA, and disposition.

Customer validation plan​

  1. Baseline the current workflow with representative users and tasks.
  2. Run the accelerator on the same task mix with human review retained.
  3. Measure investigation rework and first-pass acceptance with the documented formulas.
  4. Replace internal assumptions with customer-observed results before a business case.

Why Azure Cosmos DB​

This AI solution needs an operational data plane, not only a vector index:

  • Hybrid vector and full-text retrieval combines semantic recall with exact identifiers, codes, names, and domain language.
  • Hierarchical partition keys and metadata predicates keep tenant and domain boundaries in the normal query path.
  • Operational JSON, source chunks, workflow and agent state, feedback, and audit records remain together for low-latency reads and governed writes.
  • Change feed reacts to source and operational updates without polling.
  • Autoscale throughput, configurable consistency, and multi-region distribution support variable demand and enterprise availability.

Domain workflow​

Domain workflow

StageActorInput → outputApproval
1. Log the deviation and classify riskQuality engineerOut-of-specification result or operator observation → QualityInvestigation with risk classificationPolicy controlled
2. Bound impact through batch genealogyGenealogy serviceAffected lot identifiers → Impacted lot and equipment set for containmentPolicy controlled
3. Assemble inspection and specification evidenceEvidence agentMeasurements and specification clauses → Evidence pack showing the breached criteriaPolicy controlled
4. Propose root cause and corrective actionsInvestigation agentEvidence pack and prior similar investigations → Ranked root cause with CAPA proposalsPolicy controlled
5. Approve CAPA and release the lot decisionQuality managerRoot cause, CAPA plan, and disposition recommendation → Approved CAPA and documented lot dispositionHuman required

Technical architecture​

Technical architecture

Cosmos DB data model​

ContainerHierarchical partition keyDocumentsSearch paths
qualityInvestigations/tenantId, /investigationIdQualityInvestigation, InspectionResult, CorrectiveActionItem/deviationVectorEmbedding, /actionVectorEmbedding, /deviationVector, /actionVector
batchGenealogy/tenantId, /lotIdBatchGenealogyNodeOperational fields only
qualitySpecificationLibrary/tenantId, /specificationIdSpecificationClause/clauseVectorEmbedding, /clauseVector
investigationPrecedentIndex/tenantId, /rootCauseCodePriorInvestigationSummary/summaryVectorEmbedding, /summaryVector

Query contract​

QueryContainerScopePurpose
Investigation evidence assemblyqualityInvestigationssingle-partitionRead the investigation, its inspection results, and its corrective actions in a single partition-aligned query. Lot genealogy is read separately from the batchGenealogy container because a lot participates in many investigations and must not be copied into each one.
Out-of-specification result scanqualityInvestigationssingle-partitionIsolate measurements that fell outside their specification limits.
Recurrence detectioninvestigationPrecedentIndexsingle-partitionKnowledge-container query against investigationPrecedentIndex (partition-aligned to /tenantId + /rootCauseCode): prove or disprove recurrence by reading the precedent index for this root cause code, which is a single partition read rather than a scan of every closed investigation.
Overdue CAPA verificationqualityInvestigationscross-partition-boundedBounded cross-partition control-plane query: list corrective actions whose effectiveness check has not been verified in time. It cannot carry the second partition key because the CAPA compliance report covers every open investigation in the quality system, so it runs as a tenant-scoped scheduled sweep off the interactive path, bounded by pending verifications due inside the current quality review period, executed with MaxItemCount paging and continuation tokens.

Python and C# services route each document type to its declared container and hierarchical partition key. ETag-based writes protect mutable aggregates, while append-only records and bounded cross-partition queries preserve scale.

Azure deployment​

Azure deployment

Clone the source repository, authenticate with Azure, and run:

Set-Location accelerators/manufacturing/quality-investigation-assistant
az login
./Deploy.ps1 -Runtime python -Location eastus2

Change python to csharp to deploy the .NET implementation.

Explore the implementation​

Return to all accelerators