The connector discipline behind this product feed management work is the same as in Designing a multi-brand commerce control plane: one canonical record, explicit per-channel contracts, and no silent drops.
What a feed engine does that a scheduled export does not
A scheduled export produces a file. A feed engine produces a file, explains why each item looks the way it does, and survives the next catalog change.
The difference shows up in four places:
- Rules. A feed is not a direct mapping. Titles need prefixes, some categories must be excluded, some variants need different identifiers, and some products need a manual override. Those decisions need to live somewhere reviewable.
- Identity. Every channel keys on an item ID. If the ID changes when a product is edited, the channel treats it as a new product and the history resets.
- Enrichment. Channel titles and descriptions have different requirements from storefront copy. Generating them is reasonable; generating attributes that contradict the catalog is not.
- Feedback. Channels reject items for specific reasons. A feed that cannot ingest those reasons is a file generator with no learning loop.
The retailer in this project sold through Magento and was replacing an incumbent feed platform. The work started with an RFP response and an options analysis, then moved to a custom engine design with a planned parallel cutover (from the project’s build records).
The pipeline
The design follows a straight line, with a stored snapshot at each stage so a bad output can be traced to the input that produced it.
- Pull the catalog over the Magento REST API. Page through products and variants, and store the raw response before normalising anything (Adobe Commerce REST API).
- Normalise into one product record. Stable item ID, title, description, brand, category path, price, currency, availability, images and attributes.
- Evaluate the rule set. Apply CEL expressions in a fixed order, with each match recorded against the item.
- Enrich. Generate channel copy or category suggestions where the rules call for it, and keep the generated value separate from the source value.
- Render each channel’s feed. One adapter per channel, each owning its own field names and validation.
- Validate before publish. Check required attributes, duplicate IDs, price and availability consistency, and title length.
- Publish and record the run. Store the feed version, item count, rule matches and validation failures so the next run can be compared.
The step 1 snapshot is not optional. When a channel rejects an item three days later, the only useful question is what the source looked like when the feed was built.
Why the rules belong in CEL
Product-feed rules are business logic that changes more often than the code around them.
Putting them in JavaScript means every rule change is a deploy, and every expression can do anything. Hard-coding them in the pipeline makes them invisible and untestable. CEL is a middle path: a typed expression language with no loops or arbitrary code execution, evaluated against a fixed input shape.
A rule set can be as small as a JSON document with named expressions:
{
"id": "exclude-clearance",
"when": "!('clearance' in product.tags) && product.price.amount > 0",
"action": { "exclude": true }
}
Three properties make this workable:
- Deterministic. The same product and the same rule produce the same result, so a feed can be reproduced exactly.
- Reviewable. A rule change is a small diff in a data file, not a code review of a general-purpose program.
- Testable. Each rule can be run against a fixture catalog, and the expected matches asserted.
The engine evaluates rules in a declared order and records which rule fired. Without that record, a title that suddenly gained a prefix is unexplainable three weeks later.
AI enrichment without letting the model invent attributes
Enrichment is useful for the fields where the storefront copy does not fit the channel: a short title, a plain description, a category suggestion. It is dangerous for the fields that are facts.
The design drew a line:
- Transform, do not invent. The model may rewrite an existing title or description. It may not state a material, a dimension, a compatibility or a warranty that is absent from the source attributes.
- Keep provenance. Every generated field stores the model, the prompt version and the source fields it was allowed to use, so a questionable value can be traced.
- Validate against the catalog. A generated title that contains a brand not present on the product, or a measurement that conflicts with the attribute, is rejected before the feed is built.
- Queue the uncertain ones. Category suggestions below a confidence threshold go to a review queue rather than straight into the feed.
The failure mode is fluency: generated copy reads as true. In a feed, a wrong attribute becomes a rejected item or a live listing with the wrong specification, so the validator is the control that keeps the model inside the catalog’s facts.
Where pgvector fits
Most feed work is exact matching, and a vector index is the wrong tool for exact matching. It earns its place in three narrow jobs.
Near-duplicate detection. Retail catalogs accumulate products whose titles differ by a word or a SKU. Embedding the title and description and comparing nearest neighbours surfaces candidate duplicates for review, which is much cheaper than a pairwise string comparison across the whole catalog.
Category suggestion. When a product’s category path is missing or inconsistent, the nearest labelled products in embedding space give a shortlist. The model or a person then chooses; the vector index does not decide.
Variant clustering. Products that belong to the same family but are not linked in Magento can be grouped by similarity, which helps with item-ID strategy and with channel grouping.
pgvector supports exact and approximate nearest-neighbour search, with HNSW and IVFFlat indexes. An approximate index is faster and can miss a true nearest neighbour, so use it where a miss goes to review, and exact search for small candidate sets.
Three channels, one catalog
Each channel gets its own adapter, because the differences are real and pretending otherwise produces a feed that is wrong for all three.
| Concern | Merchant Center | Microsoft | Meta |
|---|---|---|---|
| Primary contract | Product data specification | Microsoft Merchant Center product feed | Catalog product data specification |
| Item identity | Stable id per item |
Stable id per item |
Stable content ID per item |
| Category | Google product taxonomy | Google product taxonomy | Meta product category |
| Title and description | Channel-specific limits and style | Similar to Merchant Center | Often shorter, social-first |
| Availability and price | Required and validated | Required and validated | Required for commerce surfaces |
| Adapter owns | Taxonomy mapping, shipping, promotions | Feed formatting and account rules | Category mapping, item grouping |
The adapter is where a channel’s quirks live. Keeping it separate from the rule engine means a channel change does not force a rule rewrite, and a rule change does not risk breaking a channel that was already working.
Build the engine or keep the feed platform
The options analysis compared replacing the incumbent platform with a custom engine. The honest comparison is not “custom is cheaper”; it is “which kind of work do you want to own”.
| Custom engine | Feed platform | |
|---|---|---|
| Rule changes | A data change, reviewed in your repo | Configured in the vendor’s UI |
| Channel support | Only the channels you build | Broad, and maintained by the vendor |
| Debugging | Full access to snapshots and rule matches | Limited to the vendor’s diagnostics |
| Failure mode | Your on-call | Vendor support and status page |
| Ongoing cost | Engineering time | Subscription |
| Best fit | Complex catalog, unusual rules, few channels | Simple catalog, many channels, small team |
Which should you choose? Keep the platform if the catalog is simple and the channels are the main variable, because the vendor absorbs taxonomy and format churn. Build the engine if the catalog’s rules are the bottleneck, if the same product needs very different treatment per channel, or if you already run the database and the deploy pipeline. Do not build one to save a subscription; build it to own the logic.
Cutting over in parallel
The cutover is the part that decides whether any of this mattered.
The plan was to run the custom engine alongside the incumbent platform and compare outputs before switching (from the project’s build records). That comparison is not a visual diff of two CSVs. It needs:
- An item-level diff by stable ID. Items present in one feed and not the other, with a reason.
- A field-level diff. Price, availability, title and category, with tolerances where formatting legitimately differs.
- A channel-side check. The feed can be structurally valid and still be rejected or disapproved on the channel; the diagnostics are the real test.
- A canary subset. Move a category or a brand first, watch the channel’s item health, then widen.
- A rollback that does not depend on the new system. The incumbent feed stays runnable until the new one has been healthy for a full business cycle.
The status here is deliberately narrow: the engine was designed and planned in October 2026, and the cutover was planned for the end of that month. The cutover outcome is not confirmed.
What the design had to guard against
No production incident is documented for this engine, so this section covers the failure modes the design review targeted, not bugs that shipped.
Item ID churn. If the ID is derived from a mutable field, an edit creates a new item and loses its history. The stable key should be the Magento entity ID or SKU, never a mutable field, and enrichment should not be allowed to change it.
Enrichment drift. A generated title that slowly departs from the catalog’s facts is hard to notice. Provenance and a validator that checks generated values against source attributes are the guard.
Rule sprawl. Rules accumulate, overlap and contradict. Evaluating them in a fixed order and recording which one fired makes the set auditable, and a rule that never fires is a candidate for deletion.
Silent exclusions. A product that is excluded by a rule and a product that failed to load look the same in the output feed. The engine records exclusions separately from failures, so the count of “missing” items is always explainable.
Related
Frequently asked questions
What is a product feed engine?
A product feed engine reads a catalog from a commerce system, applies rules and enrichment, and renders one feed per advertising or marketplace channel. It also validates the output and records why each item looks the way it does, which is what separates it from a scheduled export.
Why use CEL for feed rules instead of JavaScript?
CEL is a typed expression language with no loops or arbitrary code execution, so a rule cannot call the network or run away. Rules become small, reviewable data changes that can be tested against a fixture catalog, instead of code that needs a deploy and a full review.
Can an LLM write product titles for a feed?
It can rewrite existing titles and descriptions, but it should not introduce facts. Allow it only to transform attributes that exist in the catalog, validate the output against those attributes, and store the model and prompt version with each generated value.
Why would a feed engine need a vector database?
It usually does not. Vectors help with near-duplicate detection, category suggestions and variant clustering, where the question is "which products are similar" rather than "which product is this". An exact database query is better for everything else, and most feed work is exact matching.
What changed with Google's Content API for Shopping?
Google shut down the Content API for Shopping in 2026, and the Merchant API is the replacement for product uploads and account management. A new engine should be built against the Merchant API rather than starting on a retired surface.
How do you cut over from an existing feed platform?
Run both feeds in parallel and compare them by stable item ID and by field, then move a canary category and watch the channel's item health. Keep the old feed runnable until the new one has been healthy for a full business cycle, and keep a rollback that does not depend on the new system.
