News Desk — Human-in-the-Loop Story-Discovery Agent
An automated newsroom agent that reproduces an editorial team's morning routine — harvests ~65 primary and ~75 secondary curated source pages across 17 countries for textile/apparel news, scores and de-dupes the best stories with an LLM, confirms each against its primary source, then drafts publish-ready articles. Two-phase with a human in the loop, streamed live over SSE.

- Year
- 2026
- Type
- Day job
- Role
- Solo developer · In production
- Status
- In production
What needed solving
Fibre2Fashion's news desk ran a manual morning routine — Google for textile news, visit dozens of competitor and source sites across many countries, judge what's relevant, confirm it against a primary source, then rewrite it. It was hours of repetitive triage every day, with no de-duplication across days and no consistent ranking of what actually mattered.
The solution
Built a two-phase, human-in-the-loop agent in Python + FastAPI. A fast discovery stage turns the beat plus ~40 textile, trade and macro keyword topics into date-aware queries and harvests the curated source pages, preferring each source's RSS feed with Google News as the fallback for bot-blocked or feedless sites, then an LLM judges relevance (direct vs. indirect), collapses cross-outlet duplicates, and ranks by newsworthiness + source authority + recency. The editor ticks the stories worth pursuing; only those get the expensive full-text fetch (httpx + Playwright fallback), clustering into distinct candidates, and primary-source confirmation. One click then drafts a house-style, publish-ready article from the sources — every step streamed to a live activity log.
What changed
- Turns the desk's manual morning scan into one click — a deduped shortlist of ~20–30 ready-to-draft story candidates
- Two-phase pipeline keeps cost low: discovery runs a cheap model under per-job token and URL budgets, and only editor-picked stories get the expensive full fetch and a stronger drafting model
- One config-driven UI client serves two hosts — the FastAPI SPA and the company's .NET admin portal — so a fix or feature lands once
- Production-hardened: SSRF-guarded fetching, robots.txt + rate limits, retries with backoff, per-job token/URL budgets, structured JSON logs + Prometheus metrics, a watchdog that self-heals a wedged worker, and interrupted-job recovery on restart — covered by 375 tests across 43 files
Technical highlights
Need something like this?
I take on a small number of projects each quarter. Let's talk if your idea fits.
