✏️Prompts

AI for Quality Control in Manufacturing: From a Messy NCR Log to a Corrective Action

A worked example that takes 90 days of nonconformance reports, turns them into a Pareto table by count and by cost, and drafts the corrective action request.

Quality inspection bench with machined parts, calipers, accept and reject bins and a bar chart on a monitor

Most plants already have the data to find their biggest quality problem. It sits in a nonconformance log that three inspectors fill in three different ways. Nobody has time to clean it up, so the weekly quality meeting talks about whatever went wrong yesterday. AI is good at the clean-up and the counting. Finding the root cause still happens at the machine.

The example plant

A 90-person job shop machines hydraulic fittings on three lines. Over the last 90 days, inspectors logged 148 nonconformance reports (NCRs). The log is an export from the quality system with no employee names: NCR number, date, line, part number, operation, a free-text defect description, quantity and disposition. All figures in this example are illustrative.

Data you'll need first

  • An NCR export for at least 90 days, with inspector and operator names removed.
  • The cost of each disposition: scrap value per part, rework minutes and your shop rate, and the cost of any customer return.
  • Your defect code list, if you have one. If you do not, the first prompt builds one.
  • A business-plan AI account approved for company data, or the AI built into your quality or ERP system. Customer drawings and specifications stay out of free tools.

Before: the raw log

Here are eight of the 148 rows as they came out of the system.

NCRDateLineOpDefect descriptionQtyDisposition
441702 Sep140burr x-drill port12Rework
442103 Sep230thd NOGO went in40Scrap
443005 Sep140deburr missed on port 28Rework
443609 Sep320OD .002 over15Scrap
444110 Sep230thread gauge fail - no-go25Scrap
445816 Sep260cert shows wrong heat #200Hold
446217 Sep350scratches from tote6Use as is
447019 Sep230Thd fail NG30Scrap

Three inspectors, four ways to write "thread gauge fail". A spreadsheet pivot on this column returns 60 categories. That is why nobody does it.

The prompt that changes it

Prompt
The attached file is our NCR log for the last 90 days. Add a "Defect category" column that groups the free-text descriptions into no more than eight categories, and show me the mapping table (original text to category) on a separate tab so I can correct it before you go further. Then, using the cost table on the "Costs" tab, add a cost column for each NCR. Build two Pareto tables with formulas: one by count of NCRs and one by cost, each with percent of total and cumulative percent. Finally, for the top two categories by cost, break them down by line and by operation. Do not change the original columns.

Check the mapping tab before anything else. If "cert shows wrong heat #" lands in "Other" instead of a paperwork category, fix the mapping and ask it to rebuild the tables.

After: the Pareto tables

By count of NCRs

Defect categoryNCRs% of totalCumulative %
Burr on cross-drilled port5235.1%35.1%
Thread gauge fail3825.7%60.8%
OD out of tolerance2416.2%77.0%
Surface scratches149.5%86.5%
Paperwork or cert error96.1%92.6%
Missed operation64.1%96.6%
Other53.4%100.0%
Total148100%

By cost

Defect categoryCost% of cost
Thread gauge fail$9,88035.7%
OD out of tolerance$7,44026.9%
Paperwork or cert error$4,50016.3%
Burr on cross-drilled port$2,86010.3%
Missed operation$1,6205.9%
Surface scratches$9803.5%
Other$4001.4%
Total$27,680100%

The two tables tell different stories. Burrs are the most frequent defect, but they are reworked at the bench for a few dollars each. Thread gauge failures are scrapped, and they cost more than three times as much. The nine paperwork errors look small by count, but one held shipment of 200 parts drove most of that $4,500. Run both tables every time. Count tells you where inspectors spend their day; cost tells you where the money goes.

In this example, the breakdown showed 29 of the 38 thread failures on Line 2 at operation 30, the thread-cutting step. That is where the team goes next, with a gauge and the tool change log, not with another prompt.

Draft the corrective action request

ISO 9001 clause 10.2 asks you to react to a nonconformity, review it and determine its causes, check whether similar problems exist or could occur, take action, review whether the action worked, and keep records. A draft that follows that order saves the quality manager an hour of formatting.

Prompt
Draft a corrective action request for thread gauge failures at Line 2, operation 30, using only the NCR data and Pareto tables above. Sections: problem statement with counts, dates and cost; containment already in place; possible causes to investigate, listed as questions for the floor (tool wear, insert change interval, gauge condition, material lot, setup); whether the same risk exists on Lines 1 and 3; the effectiveness check, such as zero no-go failures over the next 2,000 parts; and the records to keep. Mark the root cause as "to be confirmed on the floor". Do not state a root cause as fact.

Where this breaks

Where this breaks

The mapping is a judgment. AI will group "burr" and "sharp edge" together whether or not your customer sees them as the same defect. A quality engineer approves the category list.

Math. Ask for formulas, then check that the counts add to the number of rows in the export and the costs add to the total on the cost tab.

Root cause. A language model can list likely causes. It cannot see a worn insert or a gauge that was dropped. Root cause is confirmed at the machine, with evidence.

Safety-critical and customer-specific requirements. Disposition decisions, customer notifications and anything affecting product safety follow your quality system and your customer's requirements, not an AI draft.

Start with one line

  1. Pick one line and 90 days of NCRs. Run the clean-up and both Pareto tables.
  2. Bring the tables to the weekly quality meeting. Agree on the top category by cost and assign one owner.
  3. Run the same prompt every month. Keep the approved mapping tab so categories stay consistent month to month.
  4. Fix the log at the source. Once the categories are settled, add them as a drop-down in your quality system so next quarter's data arrives clean.

For other ways plants use the data they already have, see AI in manufacturing for mid-size plants.

Free buyer's guide

Quality Management System (QMS) Buyer's Guide

What your certifications require, which tools fit your plant, and how to move quality tracking off spreadsheets.

Last checked 24 November 2026 against published explanations of ISO 9001:2015 clause 10.2. This is an independent guide, and no vendor reviewed or paid for it.

Source: Auditor Training Online, "ISO 9001 clause 10.2 nonconformity and corrective action", checked 24 November 2026. Check the standard itself for exact wording. Example figures in this article are illustrative.

Related Articles