Cleaning a Product Catalogue Before You Put AI On It: What an Audit of Over 300,000 Items Found
A field case: how we audited attributes, duplicates, taxonomy and ownership in a 300,000-item retail catalogue before any AI enrichment, and what we found.
To get product catalogue data good enough for AI and e-commerce, measure it before you generate anything: audit how attributes are named and filled, separate real duplicates from look-alikes, check whether the data actually reaches the store, and give every field one owner and one rule set. When we did this for a Portuguese agri-food and retail group with over 300,000 items in its ERP, the biggest finding was that most of the missing online content already existed internally. The problem was propagation, not creation.
This is the field record of that engagement: a fixed-scope Clarity phase on the product catalogue, what we did each week, what the queries said, and where we got it wrong.
What was the starting situation?
The group runs farm, garden, DIY and pet retail stores, plus two online shops. The client's view, from the first conversation, was that there is no AI without data quality first. Our job was to find out exactly where the quality broke.
The funnel shows why. Of about 81,000 active items, about 57,000 had sold in the previous year, about 20,000 had an e-commerce record, and about 11,000 were published. Nearly three quarters of the full item master was already discontinued: those items need a decision, not content.
The ERP is the source of truth, a SQL Server middleware reshapes the data, and a once-a-day job pushes items to the e-commerce platform. We mapped more than 15 systems and around 120 pipelines, and read over 900 code objects in the middleware.
The catalogue clean-up process we followed, from workshops to twin rules
What did the workshops reveal that the data could not?
Business sessions came first and the technical session at the end of week one, so we arrived at architecture with questions born from data. The sessions covered sourcing (who creates items), e-commerce (who publishes them), data management (who keys them into the ERP) and a technical deep-dive on systems and lineage. One planned session, with the team behind the second online shop, failed twice on scheduling and never happened, a gap we recorded rather than papered over.
The sourcing session explained the root of most text problems. Items are created from a supplier-filled Excel input file, by hand, with description rules that lived in people's heads. The short name is limited to 30 characters without accents because it prints on the shelf label. That same name later becomes the website title.
The data management session gave us the single most useful fact of the engagement: every change to the ERP passes through one small team. One place to enforce rules. It also exposed the bottleneck: bulk imports run through a Microsoft Access tool that lets one person create items at a time.
The technical deep-dive found the root cause of duplicates. They cluster in products without a manufacturer barcode, such as fruit, live animals, plants and small local producers. The group assigns those barcodes itself, so nothing stops two codes for the same banana. With a manufacturer barcode, the ERP blocks the duplicate. The second cause was search: an item created with heavy abbreviations cannot be found, so someone assumes it does not exist and requests it again.
How do you audit product attributes?
We loaded a local Postgres mirror of the middleware and profiled every attribute name and value with Python and SQL. Three findings shaped the recommendation.
First, three attribute models coexisted. A coded, translatable standard model in the ERP was unused. A custom free-text table held the real data. A denormalised copy in the item master matched it on 99.96% of values, except that it dropped slot 0, the most used slot, with about 28,500 attribute pairs. Anyone migrating from the copy would lose each item's main characteristic.
Second, coverage was low: only 9.0% of items had any characteristics at all.
Third, free text had fractured the vocabulary. About 3,900 distinct attribute names collapsed to about 3,300 after normalising case, accents, punctuation and plurals. One name in six (16.4%) was a variant of another. On the live site, "power" was written ten different ways, so the store treated it as ten attributes and none worked as a filter. Site-wide, about 1,400 labels reduce to about 1,100: some 140 concepts spelled more than one way, touching about 5,200 published products.
Before and after: one attribute written ten ways, normalised into a name, a value and a unit
The trap is the order of operations. Two of the variants, "power (kW)" and "power (W)", both had items with the value 10. Merge the names first and you mix watts with kilowatts, a thousandfold error. The unit has to move out of the label and into the value before the labels are merged.
There was good news too. The pet area already ran a disciplined family-level model: about 300 attribute names across some 7,600 items, with closed value lists. Garden used about 1,800 names for some 4,800 items, 46.7% of them used once. So the recommendation became "extend the model you already have", far easier to sell internally than one brought in from outside.
How do you find real duplicates in a product catalogue?
Exact name matching gave about 5,900 groups covering some 14,200 items. That is a floor, not an answer. We built a normalised signature that strips accents and punctuation, expands the catalogue's own abbreviations, standardises units and sorts the words, because the order someone typed them in carries no meaning:
def signature(name: str) -> str:
s = strip_accents(name).upper()
s = UNIT.sub(join_number_and_unit, s) # "15 KG", "15KG" -> "15KG"; "1,5L" -> "1.5L"
s = NON_ALNUM.sub(" ", s)
words = [ABBREVIATIONS.get(w, w) for w in s.split()]
return " ".join(sorted(words))
The signature raised the count to about 7,400 groups and 17,500 items, 23% more. Then the surprise. Plotting name lengths showed counts climbing every character up to 30 and stopping dead: about 57,000 items (18%) sat exactly at 30 characters and none above. That is the fingerprint of truncation, not of naturally long names. The middleware column holds 80 characters; the cut happens upstream in the ERP field, so widening the column fixes nothing.
Item names pile up against a 30-character wall, the signature of truncation
This changed our own numbers. 27% of the exact-name "duplicates" were at the 30-character limit: different screws whose distinguishing size had been cut off. The strongest duplicate signal turned out to be the barcode. About 2,600 barcodes were shared by some 5,200 items, despite the common belief that the ERP did not allow it. Fewer than 200 of those were published: the actionable subset.
Is the taxonomy the problem?
Not in the way the brief assumed. The hierarchy was effectively complete: two dozen areas, about 260 families and about 1,500 subfamilies, almost no empty values. The gap was granularity. Around 60 subfamilies held 39% of the catalogue; one held nearly 8,000 items with no further subdivision and no attribute filters. About 140 subfamilies had a single item.
A dedicated online taxonomy existed in the ERP. Of about 13,000 published items, zero used it. The store navigated on the ERP's statistical grouping instead.
Who should own product data?
Ownership came out of the sessions, not the data, and the best answer came from the client. In week three, their view was that the per-website product record should give way to one item record with common fields, owned by sourcing, including the fields each channel needs. Each site would then use its own subset of the same fields.
That mattered because corrections were not propagating. Fixes applied in one channel record in the spring were missing from the others.
The middleware already had a quality gate: it checked about 48 fields for emptiness before publishing. Three checks (description, long description and barcode) had been commented out in late 2025, for a legitimate reason: some products genuinely had no description and still needed to go live. The side effect was that it became easier to publish without a description than to write one. Seven in ten online items opened without a line of description.
The recommendation was to fix the content first and switch the gate on second. Reversed, it blocks everything that is already missing a description.
The point we kept pressing with their technical team: the rules applied retroactively to the backlog must be exactly the rules the PIM enforces at entry. So we wrote each rule once, in a single Python module, and generated the SQL checks from it, never editing the SQL by hand. Run against the catalogue, more than half of the fields in the input file (47 of 83) had no demonstrable destination in any of the four system layers, and 89% of web titles were a literal copy of the 30-character shelf-label name. The descriptions were not bad. They had never been written.
One field traced from the supplier input file through the ERP and middleware to the website, with each hop marked proven, linked by name or unreadable. Anonymised from the project lineage deliverable.
Where does AI fit once the catalogue is clean?
Late, and in a specific order: link what exists, extract from the name, look up by barcode, structure attributes, and only then generate.
Each step lowers risk for the next. A promotional description longer than the published one already existed for about 55,000 items. 39.4% of item names contained a measure with a unit, which is extraction, not invention. 97.4% of items had a well-formed 13-digit barcode, an anchor for fetching manufacturer specifications. For the best-selling barbecue on the site, six of the nine attributes we proposed were already in the ERP. The first three steps involve no generative AI and carry no hallucination risk.
What went wrong?
We miscounted. An early crawl reported the characteristics block as empty on product pages. Our parser counted list items inside the wrong element: the block's title sat in one container and the items in a sibling list. We caught it in week four, re-measured live on 250 pages, and the real picture was 50% with genuine characteristics, 46% showing only the barcode and 4% with nothing. The client could have disproved our version by opening one page.
A suspicion did not hold. We expected stock mismatches between the store and the ERP. Measured properly, they agreed in 88.6% of cases, and the fewer than 100 items shown as sold out with stock were shelf remnants, nine in ten of them with five units or fewer.
The calendar slipped. A three-week phase got its main system access in week two, behind a firewall change outside the client's control, and closed around week five. We now propose catalogue phases with a start condition on access, not a start date.
The sourcing input-file rules run against the full catalogue, field by field, with the largest failures broken down by rule. Recreated from the project deliverable, counts rounded.
If your product data has to carry an AI or e-commerce ambition, start where we did: workshops, then an honest measurement of what already exists. That is what Clarity does, and the AI Readiness Diagnostic tells you in about three minutes whether it is your starting point.
Written by
Alexandre Ferreira
Data Engineer
Eleven years building data platforms in digital marketing, e-commerce, aviation and gaming. Has designed an end-to-end platform on Airflow, dbt and Looker and led a Redshift-to-Snowflake migration. Builds the pipelines and quality checks that make product and analytics data trustworthy.
LINKEDIN →FAQ
Common questions
Can we just use AI to write product descriptions for the whole catalogue?
You can, but it should be the last step, not the first. In this audit, 39% of item names already contained a measurable size or weight and richer descriptions existed in the ERP for tens of thousands of items, so linking and extracting came before generating anything.
How long does a catalogue clarity assessment take?
This one was scoped at three weeks and ran closer to five, because access to internal systems arrived in week two. We now start the clock only once system access is validated.
Do we need a new PIM before cleaning the catalogue?
No. A PIM governs new products; it does not repair the existing catalogue. What matters is that the rules used to clean the backlog are exactly the rules the PIM enforces at entry, or the data drifts apart again.
See how Clarity works
Clarity maps where your data breaks, names owners and installs the rules, in weeks, before you invest in AI.
Explore Clarity