AWS for Industries

Reduce SMT Defects with Agentic AI: Automating Polarity Validation on AWS

Surface Mount Technology (SMT) polarity programming defines how a polarity-sensitive component feeds from tape reel or tray to the pick-and-place machine, designed to help maintain correct orientation on the Printed Circuit Board Assembly (PCBA).

Get it right, and boards run clean. Get it wrong by 180°, and downstream systems (Automated Optical Inspection (AOI), X-ray, In-Circuit Test (ICT) functional test) inherits the error silently, because they all reference the same upstream data. In automotive electronics, a single polarity defect cascades into hundreds of defective units reaching OEM customers. This is a zero-tolerance quality gate.

This post explores how a global automotive electronics manufacturer worked with AWS to build an agentic AI system that automates two critical quality gates: polarity validation and first article inspection (FAI). Within 30 days, the system is designed to help reduce defect escapes, improved first-pass yield by 18.4%, and returned over 6,320 engineer-hours back to the production floor.

Why polarity programming is SMT’s hidden quality gate

Even within this highly refined environment, one decision point remains vulnerable: polarity programming: determining and entering the correct feed direction so that a polarity-sensitive component is placed precisely the correct orientation.

It is the single most consequential data entry decision an SMT programmer makes. For a manufacturer placing over 200 million components annually, with up to 40 million being polarity-sensitive, this is a systemic risk hiding inside one of the most sophisticated manufacturing environments in the world.

Why existing tools don’t solve this

Modern lines feature AOI, X-ray verification, ICT, and functional test stations. Yet polarity errors persist because each manufacturer’s unique process variations create error entry points invisible to standard tooling. These tools catch defects after they happen. They do not prevent them.

First article inspection (FAI) sits closer to the source, but it is still a manual, reactive gate. A technician builds and inspects the first unit off the line, compares it against documentation, and flags mismatches. If a polarity error makes it into the pick-and-place machine instructions, FAI will eventually find it, but only after the line has been set up, material loaded, and a unit built. That is time, material, and throughput lost before anyone knows there is a problem.

By shifting validation upstream into the programming step itself, an agentic AI system is designed to help FAI pass on the first attempt. Polarity errors are designed to be caught before reaching the production line and corrected before a single component is placed.

The business impact: More than rework

Component orientation errors accounted for 35% of all SMT-related quality issues.


Architecture

 

Figure 1: Solution Architecture

The approach: Prevention over detection

Working with AWS Prototyping and AI Customer Engineering (PACE), a 4-week prototype shows how the manufacturer can shift from detecting polarity errors at placement to preventing them at the point of programming: extracting component data from supplier datasheets, validating it against known constraints, and delivering verified parameters to programmers before a single component touches the board.

From raw datasheets to structured data

A systems engineer receives a component datasheet from a supplier. It might be 10 pages with exactly the information that is needed, or 150 pages that bury polarity markings, mechanical dimensions, and tape-and-reel orientation across dozens of different sections. Similarly, a 30-page document might cover an entire component family rather than a single part number. The task is always the same: find the relevant data, extract it accurately, and provide it back to the programmers.

However, these datasheets are not standardized. They are full of diagrams, orthographic projections, and layouts that differ wildly between manufacturers, revisions, and component types. The variability in these datasheets called for something beyond traditional document processing. An approach that could reason the model was looking at and not just extract fields from a fixed template.

Keyword prefiltering: finding the needle

Through iterative testing, we identified domain keywords that reliably signal the presence of each data type, examples like:

  • Dimensions and mechanical data: “footprint,” “land pattern,” “pad layout”
  • Polarity: “cathode,” “anode,” “pin 1 indicator”
  • Packaging: “tape and reel,” “carrier tape,” “EIA-481”

These keywords are managed externally, such that engineers can add or remove terms without code changes as new component families arrive.

For documents over 10 pages, the pipeline performs a fast text-only scan using compiled regex patterns before any rendering occurs. Only pages matching at least one domain keyword proceed to Amazon Textract for full layout-aware extraction: bounding boxes, table structures, and spatial coordinates. A typical 30-page datasheet may contain 6–10 pages with actionable data. The remaining pages are not rendered, not sent to Amazon Textract, and do not reach downstream agents reducing both cost and execution time proportionally.

Early confidence exit: stopping when the answer is complete

Once relevant pages are identified, three specialized consumer agents: dimensions, polarity, and packaging each process their routed candidates sequentially, accumulating extracted data and passing it as context to subsequent Amazon Bedrock calls.

After each candidate is processed, the agent returns:

  1. A self-assessed confidence level (low, medium, or high)
  2. A need-more flag indicating whether additional data would meaningfully improve the result

When an agent reaches high confidence and signals that no further data is needed, it immediately stops processing and no additional LLM calls are made. Recent research work formalizes this pattern for multi-turn settings, demonstrating that sequential reasoning can halt early while maintaining coverage.

If the dimensions agent finds a complete mechanical drawing with all required measurements on the second candidate, it exits and does not process the remaining pages. Each agent’s cost is proportional to the complexity of the specific component, not the total number of pages available.

The result: two layers of cost optimization working together. The keyword prefilter is designed to reduce irrelevant pages upstream. The early confidence exits stop inference the moment the answer is complete. Expensive LLM calls are applied only to pages that matter, and only until the information is sufficient.

Increasing coverage for incomplete datasheets

After splitting and extraction, a datasheet lands in one of two states: complete or incomplete. A complete datasheet has everything needed to feed directly into a pick-and-place machine setup. An incomplete one is missing something: packaging details, pin orientation, or dimensional data. Either way, it needs a path to resolution.

To close that gap, we introduced an agent built on Amazon Bedrock AgentCore. Its role is straightforward: identify what is missing, then guide the SMT programmer through supplying just enough additional context to fill the gap.

Consider a datasheet where packaging information is absent. The agent recognizes the gap and asks the programmer to upload a photo of the component seated in the reel pocket. From that image, it infers orientation needed for placement. But the agent does not blindly accept what it receives. It cross-references what it already knows about the part against what it observes in the image. If the part specification says 4 pins, but the uploaded photo shows 6, the agent rejects the input and asks the programmer to try again.

This targeted interaction, asking only the questions that matter and validating answers against known constraints, means the system reaches complete coverage on uploaded datasheets. SMT programmers do not re-enter data they have already provided or guess what the system needs from them.

Continuous learning: Improving results over time

The prototype spans weeks; however, the impacts are meant to last much longer. SMT programmers need a way to improve the system well beyond the initial deployment window. For this, we built a continuous learning loop.

The system automates the existing workflow to scan the datasheet once, store the result, and apply it repeatedly. That solves the speed problem. But polarity programming is not a static data-entry task. It is an ongoing reconciliation between three sources of truth that shift independently:

  1. Documentation — which may be incomplete, outdated, or conflicting across revisions
  2. Supply chain state — which changes each time a component is multi-sourced, a supplier is substituted, or a reel runs out mid-production
  3. Physical reality on the line — where the actual component in the actual tape pocket may differ from what any single document describes

A rule-based system breaks the moment any one of these sources shifts.

An agentic system that reasons across documents, requests missing information, and cross-references against previously validated builds is architected for exactly this kind of dynamic problem.

Today, the system validates at the point of programming: it ingests datasheets, flags low-confidence extractions and learns from engineer corrections. Those corrections are not stored as memorized values. They are distilled into procedural extraction rules; the system learns how to measure and where to gather information, not what the answer was last time. A correction on one component generalizes forward without becoming brittle the moment a new revision or alternate supplier appears.

As integration points mature, incoming inspection signals, BOM change events from ERP; Lot-level traceability data, the same agentic framework extends naturally. It can re-validate previously approved programs when upstream conditions change, recognize when a previously correct answer is no longer valid, and act before the line does.

Approaches evaluated

We created a validation set of component datasheets and manually extracted the dimensions of each SMD (Surface Mount Device) package: parameters such as pitch_x, pitch_y, and other package measurements. This validation set served as ground truth for evaluating accuracy across multiple approaches.

The core challenge became clear early: for each dimension, the agent must determine which view provides the most precise information. Some dimensions are best obtained from the top view; others only appear in the side or bottom view. A single mechanical drawing page often presents all three views in varying layouts, with no standardized arrangement.

Experiment 1: Knowledge base retrieval

Our first approach uses an Amazon Bedrock knowledge base. For each datasheet verified by a human operator, we extracted an embedding of the mechanical drawing page and stored it alongside the corresponding component dimensions in structured JSON format.

The learning loop. When the agent returned an incorrect dimension, a human operator corrected the value and when necessary, provided additional feedback about where the agent should have looked. We call these additions learning facts. A learning fact might indicate that a particular dimension should be extracted from the side view rather than the top view, or that a specific label in the drawing corresponds to a specific package parameter. Over time, the knowledge base accumulated not only verified dimension values but also extraction guidance learned from human corrections.

How retrieval worked. When processing a new datasheet, the system extracted an embedding of its mechanical drawing page and searched the knowledge base for the most similar previously verified example. The retrieved examples and their dimensions were appended to the prompt as additional context.

Why did it fall short? Mechanical drawing pages often contain multiple views of the same component arranged in different layouts. The overall visual embedding of the page did not reliably capture the information most relevant to a specific dimension. Two mechanically similar components could produce very different page embeddings due to layout differences, while visually similar pages could contain entirely different view types. Retrieval accuracy was inconsistent, and the approach did not generalize as expected.

Experiment 2: Extracting individual component views

Since the knowledge base approach struggled with full-page embeddings, we shifted focus: instead of matching entire pages, we needed to first isolate the relevant views: top, bottom, and side within each mechanical drawing.

We experimented with Grounding DINO, a vision-language object detection model that locates regions in an image based on natural-language text prompts. Using different prompt formulations, we evaluated how effectively Grounding DINO could identify each view type within complex mechanical drawings.

Key validation: This experiment confirmed an important hypothesis: when the agent receives the correct and relevant drawing view in isolation, it is generally capable of extracting corresponding dimensions accurately. The primary challenge was not the agent’s ability to interpret dimensions, It was reliably identifying and isolating the correct view from a multi-view drawing page.

The outcome: Grounding DINO performed reasonably well at locating different views, but the overall pipeline still depended on the LLM agent to correctly associate dimensions within each detected region. Based on these experiments, we incorporated explicit view identification into the agent’s task: before extracting any dimension, the agent must first return bounding boxes for the top view, bottom view, and side view.

By requiring the agent to identify these regions explicitly, we provide it with the correct visual context for each dimension and reduces the ambiguity caused by multiple views appearing on the same page. This became a foundational design decision in the final architecture.

Results: From hours to minutes, from guesswork to confidence

What this means for manufacturing

SMT polarity programming is a microcosm of a broader pattern in manufacturing: mature, sophisticated processes with hidden manual gaps that create disproportionate quality risk. Somewhere in the workflow, a human makes a non-validated decision that the entire downstream process trusts implicitly.

What makes this particularly challenging is that these gaps are shaped by each manufacturer’s specific processes, supplier relationships, knowledge management practices, and cross-site workflows. No off-the-shelf tool solves this because no two manufacturers operate the same way.

Agentic AI does not replace engineering judgments. It is designed to reduce the conditions that make errors possible to adapt to the specific processes of each manufacturer rather than imposing a generic solution.

For manufacturers facing similar challenges, where process maturity masks systemic vulnerability, the pattern is replicable: identify the non-validated manual decision, build an intelligent extraction and validation layer around it, and let the system learn from each human interaction.

Conclusion

This post introduced how agentic AI transforms SMT polarity programming from a non-validated manual decision into a confidence-scored, continuously learning, fully traceable quality gate which aids in reducing defect escapes, reducing decision time from hours to minutes, and improves first-pass yield. We covered the three core capabilities (intelligent document processing, conversational data completion, and continuous learning) and demonstrated how prevention-first architecture adapts to each manufacturer’s specific processes rather than imposing a generic solution.

Get started

  • Explore the agent framework: Amazon Bedrock AgentCore provides the runtime for building and deploying the specialized agents described here.
  • Extract structured data from documents: Amazon Textract delivers the layout-aware extraction (bounding boxes, table structures, spatial coordinates) at the core of the pipeline.
  • Ground your agents in your own data: Amazon Bedrock Knowledge Bases let you augment extraction with institutional knowledge.
  • Build with foundation models: Amazon Bedrock offers the model choice and inference capabilities that power the consumer agents.
Malini Sethi

Malini Sethi

Malini Sethi is a Solutions Architect based in Detroit, Michigan. She works within AWS's Automotive & Manufacturing organization, helping large automotive and industrial customers design and implement cloud-native solutions that accelerate their digital transformation and AI adoption. Prior to her current role, she worked as an AWS ProServe Consultant partnering closely with customers to turn complex technical challenges into scalable, production-ready.

Jeffrey Nadler

Jeffrey Nadler

Jeffrey Nadler is a Global Account Manager at Amazon Web Services (AWS), based in NYC and part of the Automotive & Manufacturing industry business unit. With seven years at AWS, he partners with a strategic global customer, working backwards from their toughest challenges to design solutions that deliver measurable results. Jeffrey guides customers on their journey to modernization — harnessing the power of generative and agentic AI to accelerate innovation, unlock bigger outcomes, and empower them to deliver more for their own customers.

Mona Fathollahi

Mona Fathollahi

Mona Fathollahi is a Gen AI Solutions Prototyper within the AWS Industries Prototyping and Customer Engineering (PACE) team. She holds a Ph.D. in Computer Science from the University of South Florida and has broad experience in computer vision and machine learning across multiple industries.

Sadhana Tare

Sadhana Tare

Sadhana A. Tare is a Strategic Customer Solutions Manager at Amazon Web Services (AWS). As a member of the AWS PACE Prototyping team, she accelerates customer innovation journeys and cloud adoption across industry verticals including Automotive & Manufacturing, Hi-Tech, Energy, Media & Entertainment, Healthcare and Life Sciences. Prior to AWS, she held product engineering, technology delivery and program management roles across Fortune 500 companies.

Sandy Hsieh

Sandy Hsieh

Sandy Hsieh is a Senior Data & AI Specialist within the AWS Worldwide Specialist organization supporting Automotive & Manufacturing customers in adopting generative AI, agentic AI, and Physical AI solutions. Sandy brings over 10 years of global automotive industry experience in areas of supply chain, vehicle planning, and infotainment. She holds a master's degree in Mechanical Engineering from Carnegie Mellon University.

Steven Carpenter

Steven Carpenter

Steven Carpenter is a Senior Solutions Engineer- Applied AI on the AWS Industries Prototyping and Customer Engineering (PACE) team, helping AWS customers bring innovative ideas to life through rapid prototyping on the AWS platform. He holds a master’s degree in Computer Science from Wayne State University in Detroit, Michigan.