Gavin Reid

2026 · Independent project

catalog_data_platform

An ELT pipeline for promotional-goods catalogue data, with product search measured on judged queries.

Architecture of catalog_data_platformAn ELT pipeline for promotional-goods catalogue data, with product search measured on judged queries. Airflow · daily DAG supplier APIs XML feeds XLSX files extractor adapters S3 raw parquet dbt · DuckDB staging · marts Streamlit Bespoke Category

What it is

A standalone ELT pipeline for promotional-goods catalogue data, built end to end on my own time so that every layer of it is mine: extraction, storage, modelling, testing, orchestration and a Streamlit front end. It handles two supplier feeds of quite different shapes, one XML over HTTP and one spreadsheet feed behind authenticated URLs. Both land as date-partitioned Parquet on S3, are modelled in dbt against DuckDB, and are browsed through the Streamlit app. An Airflow DAG orchestrates the whole run, and its last task loads the catalogue into OpenSearch for search.

The problem

Professionally I work on one part of a pipeline at a time. Building a whole one alone is the only way to find out which decisions you have been inheriting rather than making, and the awkward parts turned out to be exactly the parts I would otherwise have delegated: retention, partition scoping, testing a composite grain.

The problem inside it is genuine too. Two supplier feeds agree on almost nothing: not the transport, not the format, not the grain. One of them carries duplicate rows at the level I wanted as a primary key, which I found only by querying the landed Parquet rather than trusting a source’s own documentation.

How it works

Each supplier sits behind one extractor interface, which is the seam that matters when the shapes differ this much. It is not the only place a third supplier would touch, though: the runner’s extractor registry and the Airflow DAG both name their suppliers explicitly, so a new feed is a class plus a handful of wiring edits.

Extraction parses each feed just far enough to write flat Parquet, partitioned by supplier, entity and date. DuckDB then reads that Parquet straight out of S3 over httpfs, so there is no local copy of the raw data to drift.

dbt runs in three layers. Staging views cast types, rename, and do the light cleaning a single feed needs on its own, including deduplication and unpivoting the one feed that ships six price tiers across the row. Intermediate views normalise each supplier into a shared shape and stamp a supplier column. Marts materialise the unions as tables. The real grain is supplier, product and variant together, and dbt’s built-in uniqueness test only covers a single column, so composite keys get hand-written singular tests instead.

Each run is scoped to one date partition. Retention deletes old partitions after the upload succeeds, never before, so a failed extraction cannot destroy the last good day.

Search, and what measuring it showed

The catalogue has 5,861 products. I loaded them into OpenSearch and searched them three ways. The first is BM25 keyword matching with boosts on the name and category fields. The second is vector search over sentence embeddings. The third is a hybrid of the two, combined by an OpenSearch search pipeline that rescales both score lists to the same range and takes a weighted mean.

To find out which works best, I wrote 40 test queries of three kinds:

  • 15 that use product words, such as “laptop backpack”
  • 15 that describe a need, such as “something to keep coffee hot on the way to work”
  • 10 with typos, such as “watter botle”

For each query I took the top ten results from all three methods and graded every product from 0 to 3. That gave 719 judgements. An LLM made the first pass at the grades, and I then checked every query myself and changed 50 of them.

On the first index build, vector search scored an nDCG@10 of 0.841, hybrid 0.815 and BM25 0.685. Keyword matching fell apart on queries that describe a need, and for “watter botle” and “powerbnk” it returned nothing at all. Hybrid only came out ahead on queries that use product words. On that build I tried weightings from 20% keyword up to 80% keyword, and none of them beat vector search on its own.

Then the scores moved. Running the indexing step inside Airflow rebuilt the index with exactly the same data and embeddings, and vector search dropped to 0.802. I rebuilt it five more times to measure the spread. Across six builds, BM25 stayed at 0.685, vector ranged from 0.777 to 0.841, and hybrid from 0.767 to 0.815. Vector search here is approximate, so each build finds slightly different neighbours, and each rebuild also brings up products nobody graded. What held in every build is that vector and hybrid both beat keyword search. Vector beat hybrid in five of the six; in the sixth they were level. So I now report ranges rather than the best build.

One measurement trap is worth recording. When I changed the BM25 boosts, most of the new top-ten results were products nobody had graded. Those products count as wrong in the scores, so the scores were biased low. I added a column for the share of results that had been graded, which showed this before I reported a false loss.

The limits are real. Forty queries is a small set. The tuning runs were scored on the same queries they were tuned on. The data is a replay of supplier feeds saved in S3, because the live feeds need an account I no longer have. The indexing task has run inside Airflow, but one task at a time, not as a scheduled run.

What I’d change

The run date is today’s date unless a RUN_DATE variable overrides it. It is still not taken from Airflow’s own interval, and the DAG does not catch up. A backfill would therefore quietly read today’s partition instead of the one it was asked for. It has not bitten me because I have never needed a backfill, which is the worst reason to leave something.

The print-options mart also resolves at product level rather than variant level. That gap is recorded in the model’s own schema file rather than quietly tolerated, but it is still a real modelling shortcoming. And CI is honest about being shallow: it unit-tests extraction with I/O mocked and then parses the dbt project. It never runs a model against data, so a change that is syntactically fine and semantically wrong passes.