Michael Schmuklermann
← All cases

Alpha Signal · MarketAlerts

Asset matching across financial data providers, with an agent on call

A financial data platform that merges assets from many providers into one internal asset per company. One agent resolves ambiguous matches in the ETL, and an event-driven ops agent triages pipeline errors, opens GitLab merge requests for clear fixes, and sends engineers a summary for everything else.

OrchestrationOpenAI Agents SDK · event-driven handoffs
StackOpenAI Agents SDK · Airflow · FastAPI · PostgreSQL · GitLab API · Cloud Logging · GCP
How it runs

In short

MarketAlerts combines signals about companies from many financial data providers, such as prices, filings, insider trades, and news. Each provider names assets differently, so Apple might appear several times with different tickers, exchanges, and ISINs. I built the asset matcher, an ETL and service on GCP, Airflow, and PostgreSQL that maps every external asset to one internal asset. Strict rules match first, because a false merge of two companies is worse than a missing one. For the cases rules cannot decide, a matching agent compares candidates with tools for ISIN lookup, exchange and country checks, and name normalisation. It returns a structured verdict that is applied only when its confidence is high. The second agent works on operations. Pipeline failures in Cloud Logging and Airflow trigger it. A triage agent classifies the error and hands off to a fixer agent or a reporter agent. The fixer reads the code, writes a small patch with a test, and opens a merge request in GitLab for a human to review. It never merges. The reporter writes a short summary for the developers in Slack, with the failing task, the likely cause, and links to the logs. I used the OpenAI Agents SDK with handoffs here because the work splits into roles with clear boundaries.

One Apple, many tickers: asset matching and an agent that reads the error logs

MarketAlerts shows users one asset per company. Behind that one asset sit many: the same company from every data provider, each with its own name, ticker, exchange code, and metadata. Apple from one provider is Apple Inc, AAPL, NASDAQ, US. From another it is two rows, apple, US0378331005, AAPL on two exchanges. The product only works if all of these land on one internal asset, and only if Apple never gets merged with something that is not Apple.

The matching problem

The asset matcher has four hard parts:

  1. No false merges. Mapping two different companies together silently mixes their signals. Rules have to be strict.
  2. Metadata hierarchy. Once many external assets map to one internal asset, which one decides the country or the market cap? There is a ranking per field.
  3. Asset types. One company has common stock, ETFs, funds, and more. They are grouped into common and other.
  4. Update frequency. Name and ISIN rarely change. Market cap and release dates change daily.

Rules handle the bulk: exact ISIN matches, ticker plus exchange, banned pairs. They run in the Airflow pipeline, write to PostgreSQL, and only process new records, which mattered once some DAGs ran many times a day.

The matching agent

Rules leave a remainder: assets without an ISIN, names that differ after a merger, tickers reused on different exchanges. Before, these waited for manual adjustments.

The matching agent takes one unresolved external asset and a short list of internal candidates. Its tools:

It returns a structured verdict: match, no match, or needs review, with confidence and the evidence it used. Only high-confidence matches are applied automatically, and each one is logged as an adjustment so it can be recreated or undone. Everything else goes into the review list. The agent can never override the banned list or merge two internal assets. Those stay human decisions.

The ops agent: on call for the pipelines

The platform runs many jobs: crawlers, provider APIs, price aggregation, insider trades. Some failures repeat: a provider changes a field, memory runs out on a big day, a materialised view is rebuilt while an endpoint reads it.

The ops agent is event-driven. A Cloud Logging sink and Airflow failure callbacks send the error event, with task name, stack trace, and recent log lines. Then three agents hand off:

  1. Triage classifies the error: data issue from a provider, code bug, infrastructure, or flaky and transient. It also checks whether the same error was already reported.
  2. Fixer, only for code bugs with a clear cause. It reads the relevant files through the GitLab API, writes a minimal patch and a test that reproduces the failure, and opens a merge request on a new branch. It never pushes to main and never merges. The MR description explains the cause and links the logs.
  3. Reporter, for everything. It posts a short summary to the developer channel: what failed, since when, likely cause, what was done (MR link or "needs a human"), and how to reproduce.

I used the OpenAI Agents SDK with handoffs because these are separate roles with separate tools. Triage cannot write code. The fixer cannot post messages. The reporter cannot touch the repo. Each role gets only the permissions it needs.

Guardrails

What I learned

The value was not that the agent fixes code. Most errors still need a human. The value was that the human starts with a clear summary, a reproduction, and often a draft fix, instead of a stack trace in a log viewer. For matching, the lesson was the reverse: the agent is useful only because the rules around it are strict. It works the remainder, never the core.

More cases