# Autonomous Bill of Materials (BOM) Engineering Agent

> A custom-engineered multi-stage AI agent built from scratch to synthesize, normalize, and deterministically verify multi-tier manufacturing Bills of Materials from heterogeneous engineering specs and drawings—deployed on isolated infrastructure where visual low-code wrappers break down.

In manufacturing and hardware engineering, producing an accurate Bill of Materials (BOM) requires reconciling multi-page spec sheets, assembly callouts, fastener tolerances, unit mismatches, and parent-child sub-assembly rollups across dozens of documents. Visual flow tools like Dify fail unpredictably on arbitrary hierarchical recursion, arithmetic rollups, and strict ERP schema compliance.

### Stage 01: Heterogeneous Spec & Drawing Ingestion

Extracts component tables, title blocks, callout annotations, and revision notes from multi-format engineering PDFs and CAD exports while preserving exact page and table coordinates.

- **Why Low-Code Wrappers Break Here:** Standard RAG chunking splits table headers from part rows across pages and strips parent assembly context.
- **Checks:** TABLE_CONTINUITY (PASS), COORDINATE_PROVENANCE (VERIFIED)

### Stage 02: Multi-Tier Part & Hierarchy Resolution

Recursively resolves sub-assembly hierarchies (Level 0 → Level N), normalizes vendor part numbers and material grades against internal engineering catalogs, and merges duplicate references.

- **Why Low-Code Wrappers Break Here:** Visual DAG builders cannot cleanly express arbitrary-depth recursive tree assembly or deterministic catalog matching with rollback.
- **Checks:** HIERARCHY_DEPTH_4 (PASS), UOM_NORMALIZATION (VERIFIED)

### Stage 03: Deterministic Rule & Constraint Verification

Runs strict Python verification passes over the assembled BOM graph—checking for cyclic assembly references, missing material/finish fields, quantity rollup arithmetic, and invalid supplier statuses.

- **Why Low-Code Wrappers Break Here:** Prompt-based self-checks hallucinate arithmetic agreement and lack graph-cycle or engineering constraint invariants.
- **Checks:** ACYCLIC_DAG (PASS), ROLLUP_INVARIANT (PASS)

### Stage 04: ERP-Ready BOM Emission & Audit Trail

Emits schema-validated CSV, JSON, and Excel/ERP import payloads alongside a targeted open-issues log so human engineers review only flagged ambiguities rather than auditing every row manually.

- **Why Low-Code Wrappers Break Here:** Unstructured chat markdown requires manual copy-pasting and offers zero cell-level audit trace to source drawings.
- **Checks:** ERP_SCHEMA_V2_4 (PASS), FULL_PROVENANCE (VERIFIED)

### Deterministic Verification Rules

| Rule | Mechanism | Operational Impact |
| :--- | :--- | :--- |
| Acyclic Assembly Topology | Topological sort in code ensures no sub-assembly references itself or an ancestor. | Prevents infinite ERP explosion loops. |
| Unit & Material Normalization | Deterministic parser standardizes metric/imperial tolerances and alloy designations. | Eliminates duplicate procurement SKUs. |
| Parent-Child Quantity Rollup | Exact integer/float invariant verification across multi-tier assembly multipliers. | Prevents LLM arithmetic drift on bulk hardware counts. |
| Source Coordinate Provenance | Every emitted line item retains document filename, page number, and table cell ID. | Reduces human sign-off verification from hours to targeted exception review. |