← All work

AI · Backend · Infrastructure & DevOps · 2026

AI regulatory content pipeline with expert review gates

An AI pipeline that drafts cited regulatory articles in two languages, so experts review instead of writing first drafts. Nothing publishes until an expert approves it.

  1. 01SourcesDaily ingestion with OCR; only sources from the last 45 days count.
  2. 02DraftTwo model calls per article, every claim cited.
  3. 03ChecksAutomatic gateCitations, conflicts of interest and names that must never appear.
  4. 04Expert reviewHuman gateThe workflow pauses for days; stalled reviews escalate.
  5. 05PublishApproved per article, in both languages.
How a draft moves. It can be stopped twice: by an automatic check, then by an expert.
checks passed in a production-configuration run
28/28
real mention caught by the name check on the firm's back catalogue, with no false blocks
1 of 1
unit tests, plus 16 verification scripts
~1,600

Context

A professional-services firm wanted regulatory commentary without its experts writing first drafts. Every claim needed a recent primary source, and reviews take days.

My role

Solo: architecture, code and prompts, and the deployment on Azure with Terraform.

What I built

  • Architecture: Durable Functions, with multi-day pauses, fan-out and retries built in; models, embeddings and publishing behind adapters, so a provider can be swapped.
  • Frontend: Reviewers approve topics and translations on server-rendered pages. One click opens a draft in Word for the web, and edits save back when they close it. An AI revise option rewrites a draft on request.
  • Backend: Parallel drafting, escalation of stalled reviews, duplicate-run refusal and a halt on conflicts of interest.
  • Data & AI: Daily ingestion with OCR and a 45-day freshness window; hybrid search on Azure AI Search with a domain-specialised Voyage AI embedding model, chosen for the client's material; versioned prompts.
  • Security: Signed, expiring review links, a nonce-based CSP, managed identity, and logs that refuse tokens and draft text.
  • Infrastructure & DevOps: Terraform with 55 resource definitions and 18 alert rules.
  • Testing: About 1,600 unit tests and 16 verification scripts.

Hard problems and decisions

  • Structured output is for data, not prose. My first design asked the model for the whole article inside one JSON answer, and drafts came back around 300 words. I traced it to the format, not the prompt, and split writing from structuring into two calls: the median rose to 1,084 words, enough for experts to edit rather than rewrite.
  • A prompt rule is not a control. Some company names must never appear, so a deterministic check backs the prompt rule. Tested on the firm's back catalogue, it caught the one real mention with no false blocks.
  • Measure before building. Before building spend controls for embeddings, I priced a run: they were 7–10% of cost, OCR about 90%. I fixed the real bug instead.

Outcome

Experts get cited drafts to review instead of writing them. A production-configuration run passed 28 of 28 end-to-end checks, from conflict screening to per-article approval in both languages.

Stack

TypeScript, Node.js, Azure Durable Functions, Azure AI Search, Azure OpenAI, Anthropic Claude, Voyage AI, WordPress, Terraform

Areas

Architecture, Frontend, Backend, Data, AI, Security, Infrastructure & DevOps, Testing

Period

May 2026 – present

Next caseMulti-tenant SaaS platform