Similar names do not necessarily mean the same product

A supplier writes “M6×30 stainless steel screw, pack of 100”; the company catalogue says “DIN 912 M6x30 A2 screw, each”, while the next record describes a nearly identical 35 mm screw. A buyer sees the distinction. String search, and especially a language model, may treat it as minor. An incorrect SKU written into a purchase order or invoice can propagate to stock balances, purchase prices and later shipments.

The goal is not to have AI rewrite product names elegantly. It is to link an external line to an internal product record, retain the supplier's original wording and show why the link is justified. This is an architecture guide, not a report of results achieved by a particular company: time savings and error rates depend on the quality of your master data.

Start with identifiers and units

The first layer is exact matching. If documents contain a manufacturer part number, supplier code or GTIN, compare it with a table of approved links. GS1 defines a GTIN as a unique identifier for a trade item; packaging level still matters. A case identifier should not automatically be treated as an identifier for one piece. Your internal SKU remains your own identifier: an external code may require an explicit link to it and a conversion factor.

The minimum matching record should include the original line, supplier, supplier code, manufacturer, GTIN if present, category, size and material, unit of measure, pack quantity, internal SKU and link status. Do not discard the original text after normalization: it allows a buyer to explain a disputed decision later. Catalogue and rule versions need dates too, or processing the same document again may produce a different result without an explanation.

Normalize safe differences first: spacing, case, established unit variants and decimal separators. Do not strip dimensions, grade, capacity, pack count or other attributes that change the item itself. “10 pieces” and “100 pieces” are lexically similar but commercially different. Give each line one of three states: confirmed SKU, multiple candidates, or no suitable product. The last state calls for the normal new-item procedure, not an invented nearest substitute.

Candidate search is not authorization to post

When an exact code is missing, generate a short candidate list. In an existing PostgreSQL database, pg_trgm can score text similarity and support indexed search. For a one-off file cleanup, OpenRefine offers clustering and reconciliation; its documentation explicitly describes reconciliation as a semi-automated process requiring human review. These tools discover options, but they do not know your commercial rules.

Compare candidates within the relevant category and manufacturer, then check mandatory attributes: diameter, length, volume, material, unit and packaging. A numerical score can sort the review queue, but high string similarity cannot override a hard mismatch. A different size should block automatic acceptance regardless of how attractive the name looks. Confidence thresholds must be tuned on your own historical documents; there is no universal percentage for every catalogue.

A local language model helps when descriptions are unstructured: it can propose extracted attributes, synonyms or an explanation of differences between two records. Give it only the permitted document fragment and a constrained candidate list. Validate its response against a schema, allowed values and unit rules. The model must not create SKUs, change pack factors, post documents or silently alter prices. A small robotic intern instructed to “fix everything at once” could merge a bolt with an almost identical bolt with equal enthusiasm; a person should keep the approval button.

The boundary with the accounting or ERP system

A practical workflow is:

  • ingest the supplier file or document through an existing import channel while preserving the original;
  • identify exact matches using approved codes and display why each match was made;
  • generate candidates for the remaining lines and flag incompatible attributes;
  • show disputed lines to a responsible employee with both product records side by side;
  • record the approved supplier–external code–internal SKU–packaging–date link;
  • prepare an ERP draft and apply the write only after the system's normal access and document controls.

Access rights matter: a buyer sees their own requests, a master-data owner approves new links, and the import service has minimal permissions. An audit trail should retain the source line, proposed candidates, final choice, reviewer and time. There must be a way to reverse an error before a document is posted. If the ERP has a test environment or draft state, start there; otherwise export a checked file for its normal manual import.

A pilot does not require a separate service. An export of the catalogue, a supplier file and a matching worksheet in an approved environment may be enough. For a recurring flow, an existing database with an isolated schema or tables, separate roles and quotas may fit. Consider new infrastructure only after checking volume, data requirements and the services already available.

Economics: count exceptions, not model calls

Project cost includes master-data cleanup, rule design, integration, review of uncertain lines and ongoing maintenance of new product records. Generating a model response is only one cost component. “95% of names matched” is unhelpful if the remaining 5% cause the most expensive mistakes. Track the share matched by exact identifier, the share sent to a person, time spent on each exception and incorrect postings found before and after the pilot.

For an illustrative calculation, take 200 purchase lines in one month and manually time reconciliation on a small sample. Time the same lines through a prototype, then add hours spent fixing the catalogue and checking outputs. Translate the difference into money using the full cost of staff time; include error costs only for your own documented incidents. This is a model with stated assumptions, not a promise of staffing cuts or a universal payback period.

A small next step

Take two or three recent documents from different suppliers and 100–200 lines, keeping sensitive data within the approved environment. Label the correct SKUs and mismatch types manually. Then test how many lines exact codes solve, how many need candidate search, and where attribute extraction by a local model helps. Before connecting to the ERP, separately inspect ten high-risk pairs: close dimensions, different pack sizes, similar grades and obsolete part numbers. If the rules and a reviewer cannot explain a choice, it is too early to post that match automatically.