Get in Touch

Tens of Thousands of Unique Product Descriptions: Generative AI at Catalog Scale 

Overview

A global online jewelry retailer, one of the largest in its segment, sells a catalog built on customization. Almost every item can be configured: the metal, the main color, the center stone, the accent stones, the chain, the material inlay. Each combination is a separate product page, and each page needs its own description, in several languages, written in a voice that fits a luxury brand.
Writing that content by hand was never realistic. The retailer partnered with Postindustria, a long-term technology partner that had already built its connected-factory data platform, to solve the problem with generative AI. The result is a template-based description generator that uses large language models to produce thousands of unique, brand-safe description templates, stores them in the client's own database, and fills them with real product values at page-render time.
The system covers 17 product types, 5 languages, and a sample catalog of more than 64,000 product variations, while keeping the cost of generation predictable and fully under the client's control.

Key Highlights

01

Template-based generation at catalog scale

Instead of one LLM call per product, the system generates reusable description templates per product option set. 223 option sets describe more than 64,000 product variations.

02

Multilingual from day one

English, British English, German, Spanish, and French, with language-specific prompt rules and post-processing.

03

Brand-safe output

Prompt engineering, style controls, and automated validation keep the tone professional and remove informal phrases that do not fit a luxury brand.

04

Predictable cost

A price estimator reports the expected spend before a single API call is made, and a token statistics table tracks the real spend per option set and per day.

05

Zero-friction integration

Descriptions are stored in MySQL and resolved through a small Python entry point that the client's PHP storefront calls directly.

The Challenge

The retailer's catalog is built on customization. A single ring design can exist in dozens of metals, colors, and stone combinations. Multiplied across rings, earrings, necklaces, bracelets, cufflinks, watch straps, and more, the number of distinct product pages reaches tens of thousands, and every one of them needs descriptive text for customers and search engines.
The project had to overcome several problems at once:
  • Volume: Tens of thousands of product variations, each needing a unique description, in five languages. Manual copywriting could not keep pace, and duplicated text hurts SEO.
  • Cost control: Calling a language model once per product variation and per language would be slow and expensive, and the cost would grow with every new product added to the store.
  • Brand voice: Early model outputs used phrases like "Hey there ladies", "badass", or "what are you waiting for". A luxury jewelry brand cannot publish that. The output had to be consistently professional without a human reviewing every text.
  • Structural reliability: The descriptions had to mention every product attribute (metal, stone, clarity, cut, carats, chain type, and so on) in the right place, so that real values could be inserted later. A model that forgets a placeholder or invents an extra one produces a broken page.
  • Operational simplicity: The client's team works in PHP and MySQL. The solution had to run on their infrastructure, be driven from their database, and be usable without machine learning expertise.

The Journey

  • Scoping the Opportunity

    Postindustria started with the client's product database. The analysis showed that although there were tens of thousands of product variations, most of them shared the same small set of customizable attributes: color, metal, center stone, accent stone, additional stones, pearl, leather, wood, ceramic, and chain. Grouping products by which attributes apply collapsed the whole catalog into a few hundred "option sets".

    This insight shaped the entire architecture. A description does not need to be generated per product. It needs to be generated per option set, with placeholders for the values, and then filled in for each product.

  • Designing the Template Approach

    The team designed a placeholder-based template format. The language model is asked to write a description for a product whose name is {product_name}, whose metal is {metal}, whose center stone is {center_stone}, and so on. The model never sees real values, so it never hallucinates them, and one generated template can serve hundreds of products. A finished template reads like "Crafted in {metal}, the {product_name} features a {center_stone} at its heart."

    Alongside each template, the system stores a mapping from attribute names to tokens. When the storefront renders a product page, it picks a random template for that product's option set and language, replaces the tokens with the actual product values, and returns a finished description. Two products with the same option set get different texts because the template is sampled at random from a pool.

  • Making the Output Reliable

    Language models are not deterministic, and the first outputs showed the typical problems: missing placeholders, invented placeholders such as {our_company}, plural forms like {carats}s, doubled product names ("Travis Ring ring"), noise before and after the text, and emojis.

    The team built a validation and decoding layer around the model:

    • Every generated text is checked for the exact number of unique tokens the prompt requested. A mismatch triggers a regeneration, with up to 30 attempts per description and a new random temperature and style each time.
    • A decoding step cleans special characters, strips stray brackets, fixes English plural artifacts, removes duplicated product-type words, and only then inserts the real values.
    • A test-generation mode produces a large sample of descriptions, and an analysis script scans them for a blacklist of informal phrases. This feedback loop was used to tune the system prompt until the tone matched the brand.
  • Scaling Up and Keeping Costs Visible

    The generation runs as a daemon that watches the option-set table in the client's database. When the client inserts or updates an option set and marks it as unprocessed, the daemon picks it up, calculates how many descriptions are still missing for each language, generates them in parallel with a thread pool, and marks the row as processed.

    Two parameters control the economics: a per-product multiplier and a hard cap per option set. Before running, the client can execute a price estimator that reports a minimum and maximum expected cost for the pending work. During the run, every API response's token usage is written to a statistics table, giving a per-day, per-option-set record of spend.

    As the project progressed, the team added support for multiple API keys with random rotation to raise throughput, and later added Azure OpenAI as a second provider so that generation could continue if one provider was rate-limited or unavailable.

  • Extending to SEO Metadata

    Once product descriptions were in place, the same approach was extended to meta titles and meta descriptions. The model was used once to produce a library of short, SEO-oriented phrases for each attribute in each language. A small PHP function, shipped as an example, then assembles a meta description under the 155-character limit from a random intro, the product name, and attribute phrases filled with real values. No API call is needed at page-render time.

The Technology

  • Large language models: OpenAI GPT-3.5 Turbo and text-davinci-003, plus the same chat model deployed through Azure OpenAI. The engine is selected at random per request from the configured providers, which spreads load and reduces dependency on a single vendor.
  • Prompt engineering: A system prompt enforces a professional tone and forbids unnecessary adjectives. The user prompt lists the product's attributes as tokens and asks the model to keep every token. Styles ("luxurious", "formal", "professional") and temperature are randomized to increase variety across templates. British English has its own prompt rules and spelling instructions.
  • Python generation service: A long-running daemon with a thread pool, configurable worker count, per-key rotation, automatic retries, and structured logging of generation time, attempts, and the key used.
  • MySQL as the system of record: An option-set table with a unique constraint per option set and database triggers that protect the invariants (for example, a new row cannot start as processed, and attribute columns cannot be changed after insert). A template table holds the placeholder texts and their mappings. A statistics table records token spend. A language table drives which languages are generated.
  • Decoding and validation layer: Regular-expression based cleaning and token replacement, with language-specific rules for English.
  • Storefront integration: A command-line entry point that takes an option ID, a locale code, and a JSON object of product values, and returns the finished description as JSON. The PHP storefront calls it directly, so no extra service or API layer is needed.
  • Cost tooling: A price estimator based on average tokens per description and provider pricing, with a worst-case bound that accounts for regeneration attempts.

The Results

01

Catalog-wide coverage

The sample dataset delivered with the project covers 223 option sets across 17 product types and more than 64,000 product variations, with roughly 3,500 ready-to-use templates generated as a starting pool.

02

Five languages, one pipeline

English, British English, German, Spanish, and French are generated from the same code path, with per-language prompts and post-processing.

03

Unique text per product page

Random template sampling means two products with the same attributes receive different descriptions, which avoids duplicate content penalties in search engines.

04

Cost known in advance

The client can estimate the cost of any batch before running it and audit real token spend afterwards, per option set and per day.

05

Hands-off operation

The client adds rows to one table and the daemon does the rest. Adding more descriptions for an existing option set only requires changing two values and resetting a flag.

06

Brand-safe by default

Prompt tuning driven by automated phrase analysis removed informal language from the output without manual review of every text.

07

Resilient generation

Multiple API keys and two providers (OpenAI and Azure OpenAI) keep generation running under rate limits and provider outages.

Conclusion

The retailer's catalog made manual copywriting impossible and naive per-product AI generation too expensive. Postindustria's answer was to change the unit of work: generate reusable, tokenized templates per option set, validate them automatically, and let the client's own database and storefront do the rest.
The project shows how generative AI can be put into production for a large e-commerce catalog without giving up control over tone, cost, or infrastructure. The model does the creative work. The surrounding system, from database constraints and validation loops to cost estimation and provider redundancy, makes that work reliable enough to publish.

Key Takeaways:

  • Generate templates, not products: Grouping products by option set reduced the generation workload by orders of magnitude and keeps cost flat as the catalog grows.
  • Validate everything the model returns: Token counting, regeneration, and decoding rules turned non-deterministic LLM output into structurally reliable content.
  • Keep the client in control: Database-driven workflow, cost estimation before spending, token accounting after, and a plain PHP integration meant the client's team could operate the system without ML expertise.