A daily, self-curating feed of peer-bank AI moves
An LLM pipeline that gathers, filters, de-duplicates and sorts peer financial institutions' AI news into a morning briefing for a bank's AI team.
The problem
An AI team tracking how peer banks and other financial institutions use AI had no single daily view. Coverage is spread across trade press, aggregators, bank newsrooms, web search and executives' LinkedIn posts. Aggregator dates are unreliable, the same story arrives from many outlets, and most AI-tagged headlines are marketing or opinion rather than real moves.
Who uses it
An internal AI team at Emirates NBD, which reads the feed each morning to see what peer institutions did on AI and where it lands against a public bank AI-maturity index the team already reports in. The build brief plans for one or two readers; a design handoff estimates 5 to 15.
My role
Sole committer in the repository history (76 commits). Wrote the build brief, then built and documented the pipeline, all LLM passes and their prompts, schema and migrations, the server-rendered web UI, accounts, deployment and scheduling. Deliberate departures from the original brief are recorded with their reasons in the README.
How it works
Each step, and whether a person, an agent or plain code does it.
- 01 Schedule the nightly run An n8n cron (06:30 in the readers' timezone, 3 retries) calls a key-protected run endpoint. An in-repo scheduler is the fallback.
- 02 Acquire candidates Pulls RSS feeds, scraped newsrooms, Google News links (resolved to the real article), budgeted web/news searches and followed LinkedIn pages via a third-party scraping service.
- 03 Enrich and date Fetches each article page and resolves the publish date by precedence: page metadata, then feed date, then URL path. Undated or over-7-day items are dropped, never back-filled with fetch time.
- 04 Classify relevance Batched LLM call decides whether each item is a concrete AI move by a financial institution, attributes the institution, types it and writes a short factual title and summary.
- 05 Merge duplicates Deterministic rules merge obvious repeats; an LLM adjudicator judges only ambiguous pairs, so one event becomes one card listing its outlets.
- 06 Place on the index taxonomy A second LLM pass places each surviving signal on four pillars and their sub-pillars, or declines and names a free-text topic instead.
- 07 Write the briefings A third LLM pass writes a lead sentence, short paragraph and one bullet per pillar for each cohort and window, including what was absent.
- 08 Read, filter and follow Readers scan pillar sections, open per-bank and per-person pages, search history and keep a personal watchlist of institutions and people.
- 09 Curate and tune Admins retire dead sources, fix renamed profiles, edit any prompt without a deploy, and read the off-index topic page to decide whether to widen the taxonomy or tighten the classifier.
- 01 Schedule the nightly run System An n8n cron (06:30 in the readers' timezone, 3 retries) calls a key-protected run endpoint. An in-repo scheduler is the fallback.
- 02 Acquire candidates System Pulls RSS feeds, scraped newsrooms, Google News links (resolved to the real article), budgeted web/news searches and followed LinkedIn pages via a third-party scraping service.
- 03 Enrich and date System Fetches each article page and resolves the publish date by precedence: page metadata, then feed date, then URL path. Undated or over-7-day items are dropped, never back-filled with fetch time.
- 04 Classify relevance Agent Batched LLM call decides whether each item is a concrete AI move by a financial institution, attributes the institution, types it and writes a short factual title and summary.
- 05 Merge duplicates Agent Deterministic rules merge obvious repeats; an LLM adjudicator judges only ambiguous pairs, so one event becomes one card listing its outlets.
- 06 Place on the index taxonomy Agent A second LLM pass places each surviving signal on four pillars and their sub-pillars, or declines and names a free-text topic instead.
- 07 Write the briefings Agent A third LLM pass writes a lead sentence, short paragraph and one bullet per pillar for each cohort and window, including what was absent.
- 08 Read, filter and follow Human · decision Readers scan pillar sections, open per-bank and per-person pages, search history and keep a personal watchlist of institutions and people.
- 09 Curate and tune Human · decision Admins retire dead sources, fix renamed profiles, edit any prompt without a deploy, and read the off-index topic page to decide whether to widen the taxonomy or tighten the classifier.
- Human A person acts or decides
- Agent A model proposes or decides
- System Deterministic code
- Decision point A person approves, rejects or edits before the flow continues
Built for banking. Ready for any industry.
Banking lives in what the pipeline is pointed at, not in how it works. Change the sources and the companies it tracks, and the same pipeline briefs any industry.
What changes
- Sources
Feeds, news searches, web queries and LinkedIn profiles. Point them at another industry’s trade press and leaders.
- Who it tracks
An alias map of about 80 institutions. Replace it with the insurers, retailers or drug makers you watch.
- How it sorts
A fixed taxonomy, here an AI-maturity index’s pillars. Swap in the framework your team already reports against.
- What counts
The classifier and briefing prompts are editable in the app, so a domain expert decides what a real move is.
- Insurance
- Retail
- Pharma
- Energy
- Telecoms
- Public sector
Screens
Captured from the running product.
-
Huginn Feed agents, gates and de-dup
-
n8n Nightly orchestration
Eleven feeds in, one digest out.
Every item runs through two gates in parallel. Items that pass the entity gate, or pass both the topic gate and the banking-context gate, are merged, de-duplicated by URL and sent to n8n as one batch.
Why it matters for B2B commerce
The pattern is classify, de-duplicate, place on a fixed taxonomy and brief, with fail-closed merges and human-editable prompts. That maps to normalising supplier catalogue feeds onto a product taxonomy, matching duplicate SKUs across ERP sources, triaging inbound quote or order emails, and briefing account managers on what changed for their customers.
Technical detail: agents, research, design system and stack
How the agents are allowed to behave
Each agent gets its own level of autonomy, a guardrail and a planned failure mode.
- 1 Drafts for review
- 2 Acts within limits
- 1 Acts autonomously
- Relevance classifier Detailed below Autonomy: Acts autonomously. Acts autonomously Decides if an item is a concrete AI action by a financial institution, names the protagonist, assigns one of six signal types, writes title/summary, flags in-batch duplicates.
- Duplicate adjudicator Detailed below Autonomy: Acts within limits. Acts within limits Judges whether candidate pairs that deterministic token-overlap rules could not settle describe the same real-world event.
- Taxonomy mapper Autonomy: Acts within limits. Acts within limits Places each kept, non-duplicate signal on a pillar and sub-pillar of the index taxonomy, and always names a short free-text topic.
- Briefing writer Autonomy: Drafts for review. Drafts for review Writes the daily, weekly, on-demand monthly and per-bank briefing above the feed.
Autonomy is set per agent, not per product. Where an agent decides alone, the guardrail is a schema, a threshold or a fail-safe default — detailed in the cards below.
Relevance classifier
Acts autonomouslyDecides if an item is a concrete AI action by a financial institution, names the protagonist, assigns one of six signal types, writes title/summary, flags in-batch duplicates.
- Reads
- Batches of up to 25 items: title, source, author and employer hint for LinkedIn posts, publish date, first ~1500 characters.
- Writes
- One JSON object per item: relevance, institution, type, title, summary, confidence, reasoning, duplicate link.
- Guardrails
- Strict output schema; explicit rejection rules (vendor marketing, opinion, surveys, passing mentions, acronym collisions); confidence threshold 0.55; length caps enforced server-side; unknown types coerced to a valid value; a separate prompt for LinkedIn posts; employer fallback for unattributed posts from followed people.
- When it fails
- Defensive JSON recovery; one retry; an unparseable batch is split in half recursively until the bad item is isolated and discarded as classify-failed. An unreachable endpoint aborts the stage and leaves everything pending for the next cycle, after an outage once discarded 804 items.
- What that means
- Decides alone, no person in the path
Duplicate adjudicator
Acts within limitsJudges whether candidate pairs that deterministic token-overlap rules could not settle describe the same real-world event.
- Reads
- Up to 40 numbered pairs per cycle, each with institution, title, summary and outlet.
- Writes
- Per pair: same-event verdict, confidence, short reason.
- Guardrails
- Only pre-screened pairs reach it; two different named institutions never pair; confidence floor 0.70; 14-day cluster span cap; prompt tells it to say no when unsure; a kill switch reverts to deterministic-only merging.
- When it fails
- Fails closed: parse error, transport error, malformed or low-confidence verdict merges nothing, with no retry, because a wrong merge hides a story. A dry-run-by-default script re-merges history for human review before applying.
- What that means
- Decides alone inside a bounded scope
How I found out what to build
Design decisions cite small measurements on live data: twelve Google News items audited before and after link resolution; real headline pairs scored to set dedup thresholds; badge frequency used to narrow the watchlist to ten plus ten. The off-index topic page turns classifier refusals into evidence of taxonomy gaps.
The design system the AI reads
Tokens, taxonomy and prompts as guarded specs
- Prompt registry Code defaults plus stored overrides
- Taxonomy module A single machine-readable spec
- One light/dark token set Three CSS layers
Machine-readable and test-guarded, but not a reusable design system.
One light/dark token set in three CSS layers, with pytest guards that every token exists in both themes and that radius, shadow and contrast rules hold. The taxonomy module is a single machine-readable spec feeding the classifier prompt, filters and display order. Prompts are a registry with code defaults and stored overrides.
What it is made of
- Languages
-
- Python
- SQL
- HTML/Jinja
- CSS
- Frameworks
-
- FastAPI
- SQLAlchemy
- Alembic
- Jinja2
- httpx
- feedparser
- BeautifulSoup
- pytest
- Model families
-
- Local LLM via an OpenAI-compatible endpoint (llama.cpp-style server)
- Optional local embedding model
- Data stores
-
- PostgreSQL 16 (full-text search)
- pgvector (optional, for semantic re-ranking)
- Orchestration
- One run_cycle call chains fetch, LinkedIn fetch, classify, dedup, pillar mapping, embedding and summarising, each in its own transaction so a later failure keeps earlier work. Fired nightly by n8n or an in-repo scheduler sidecar; Docker Compose deploys with self-migrating entrypoint.
Scale Six source kinds; ~80 institutions in the alias map; a 20-bank watchlist; a 122-row leadership spreadsheet for bulk-following profiles; ~150-200 signals a month and ~37 a week (stated estimates); search spend capped near 220 a month; 22 migrations, 11 tables, ~846 test functions across 40 test files.