Skip to content
  1. Home
  2. Our work

European pharmaceutical regulator

How we built an AI compliance scanner that checks marketing assets against EU regulations in under 2 minutes

Built for a European pharmaceutical regulator, the national body that polices medicines advertising in its market. The platform scans marketing materials, including images, PDFs, and packaging, against national and EU regulations.

Industry
Pharma and life sciences
Platform
Azure AI services
Stage
In production
  • 620+

    Assets scanned in production

  • 11

    Compliance rules checked per scan

  • ~2 min

    Per asset, down from 2-3 hours

  • 100%

    Citation transparency

The challenge

Drowning in manual review

A national medicines-advertising regulator in the EU needed to fundamentally rethink how it processes compliance checks. Their reviewers were drowning.

Every marketing asset, from social media posts and retail packaging to advertisements, e-commerce images, and video scripts, had to be manually checked against a complex web of national and EU regulations, approved ingredient databases, and previously approved materials. A single review could take 2-3 hours. The backlog was growing faster than the team could clear it.

  • Reviewers manually cross-referencing each marketing claim against multiple regulatory databases, dossiers, and previously approved materials
  • No automated way to extract text from visual assets: images, packaging mockups, and designed PDFs required manual transcription
  • Inconsistent reviewer judgments, with different reviewers flagging different issues on the same material
  • Customers waiting days for compliance feedback, delaying product launches and campaign rollouts
  • Generic AI chatbots failed immediately. They could not handle regulatory language outside English, visual assets, or multi-step compliance logic
  • No audit trail connecting verdicts back to specific regulatory sources, creating accountability gaps

What we built

The AI compliance scanner

Upload an asset, get a traffic-light compliance verdict with per-rule results, evidence quotes, and fix suggestions. No manual review required for the first pass.

A self-service compliance checking platform where customers upload marketing assets and get an instant, structured regulatory verdict, complete with per-rule pass/fail results, evidence quotes, suggested fixes, and links to the exact regulatory documents that informed each finding.

Compliance verdict system

  • GREEN: Compliant

    All rules pass. Asset is cleared for use. No issues detected against applicable regulations.

  • ORANGE: Review Required

    Some rules flagged. Needs human reviewer attention. Specific issues identified with fix suggestions.

  • RED: Violations Found

    Critical compliance violations detected. Asset cannot be used as-is. Detailed remediation steps provided.

Acceptance criteria, a glimpse

The bar the system is held to

Every QueryNow build is measured against acceptance criteria agreed before we write code. A glimpse of what this scanner has to meet, every scan, in production.

CriterionWhat it means in practice
Verdict per rule, 11 rules per scanEvery asset returns a traffic-light verdict with an explicit result for each of the 11 compliance rules. No silent skips.
Evidence quote for every flagA flagged rule must quote the exact text or visual element that triggered it. No unexplained findings.
Fix suggestion on every findingEach flag comes with a concrete suggested correction, not just a rejection.
Under 2 minutes per assetFirst-pass result in roughly 2 minutes, replacing a 2-3 hour manual review.
National and EU regulations coveredChecks run against the applicable national and EU regulatory sources, cited in the result.

620+ assets have been scanned in production against this bar.

How it works

Four steps, under two minutes

Every asset passes through a structured pipeline. The system automatically adapts which stages run based on the file type and content composition selected.

  1. Upload

    Drag & drop images or PDFs, provide product context & choose content type

  2. Smart Check

    File fingerprinted. If scanned before, instant results via Replay Mode

  3. Extract

    Text & visuals extracted via GPT-4 Vision or Document Intelligence

  4. Analyse

    Claims identified, regulatory docs retrieved, 11-step compliance check run

Content-aware pipeline

Only run what you need

The processing path adapts automatically based on file type and content selection. Only the stages needed are executed, optimizing cost and speed.

Content TypePDF ConversionVision / OCRDoc IntelligenceClaims DetectionRAG + AI Validation
Image Only·✓·✓✓
Image & Text·✓·✓✓
Text Only··✓✓✓
PDF + Image✓✓·✓✓
PDF + Text Only··✓✓✓

Cost-efficient by design

Smart replay mode (SHA-256 fingerprinting) reuses results for identical files within a configurable time window, eliminating redundant AI processing costs and delivering instant repeat results. Combined with content-aware routing that skips unnecessary pipeline stages, the system minimizes Azure OpenAI spend on every scan.

Under the hood

The full AI pipeline

Here is what happens at each stage when a new asset enters the system.

  1. Asset Upload & Classification

    User uploads an image, PDF, or text document. Selects the content composition (image only, image + text, or text only), product category (health product, medical device, etc.), and campaign type (advertisement, packaging, social media, retail folder, etc.). This metadata drives the downstream compliance rules that apply.

  2. Smart Replay Check

    The file is fingerprinted using SHA-256 hashing. If an identical file has been scanned within the configured replay window, the system returns prior results instantly, with no AI processing needed. This eliminates redundant costs when the same asset is submitted multiple times.

  3. Intelligent Text Extraction

    For visual assets (images, designed PDFs), GPT-4 Vision reads and extracts all text, including text embedded in product shots, marketing banners, and styled layouts that OCR would miss. For text-only documents, Azure Document Intelligence handles extraction. Multi-page PDFs are converted to page images for visual analysis.

  4. Claim Identification & Segmentation

    Extracted text is split into packshot lines and marketing copy. A local-language ingredient lexicon identifies nutrient and botanical claims. The system distinguishes between health claims, promotional statements, ingredient references, and retailer branding, each governed by different rules.

  5. RAG Retrieval of Regulatory Context

    A hybrid semantic + vector search pipeline retrieves relevant regulatory documents from Azure AI Search: approved health claims, on-hold claims, regulatory guidelines, training corrections from past reviews, product dossiers, and previously approved materials. This context grounds every AI decision in actual regulation.

  6. Structured 11-Step Compliance Validation

    GPT-4 runs a structured compliance check across 11 rule categories: training overrides, packshot approval, dossier matching, previous approval lookup, new text verification, banned phrase detection, imagery validation, wording deviation checks, ingredient-to-claim linkage, mandatory statement verification, and superlative claim detection. Each rule returns pass/fail with severity, evidence, and fix suggestions.

  7. Full Audit Trail & Results

    Every scan stores the complete chain: prompts sent, model parameters, raw AI responses, retrieved regulatory documents, confidence scores, and timestamps. Results display with per-rule verdicts, regulatory source citations, and a one-click "Submit for Internal Review" workflow.

The difference

Before and after

Before: Manual Review

  • 2-3 hours per asset, reviewer manually cross-referencing databases
  • Inconsistent verdicts across different reviewers
  • No structured trail linking findings to regulatory sources
  • Customers waiting days for compliance feedback
  • Text in visual assets had to be manually transcribed
  • No self-service option, every check went through the review queue
  • Scaling meant hiring more reviewers

After: AI Compliance Scanner

  • Under 2 minutes per asset with structured, repeatable results
  • Consistent 11-rule validation applied identically every time
  • Every finding cites the specific regulatory document and source
  • Customers get instant first-pass compliance feedback on upload
  • GPT-4 Vision extracts text from images, packaging, and designed PDFs
  • Self-service upload for customers; reviewer dashboard for oversight
  • Scaling means processing more assets, not hiring more people

Platform capabilities

More than a chatbot

A production platform with role-based access, a reviewer dashboard, admin configuration, and full bilingual support.

Role-Based Access

Customers upload and view their own scan results. Reviewers and admins see everything, manage settings, and audit any scan across all customers.

Reviewer Dashboard

Filterable, searchable list of all scanned assets with aggregate statistics. 620+ assets tracked with status breakdowns: compliant, review needed, rejected, pending.

Smart Replay

Identical files (matched by SHA-256 fingerprint) automatically reuse prior results within a configurable time window. Saves processing cost and returns results instantly.

Multi-Format Processing

Images, multi-page PDFs, and text documents. Visual assets use GPT-4 Vision; text-heavy documents use Azure Document Intelligence. The system auto-detects and routes.

Regulatory Source Citations

Every finding links to the specific regulatory document that informed it, complete with source URLs, document names, and applicable rule references.

Full Bilingual Support

Complete English and local-language translations throughout the entire UI. Regulatory rules, campaign types, product categories, and system messages all available in both languages.

Admin Configuration

Settings panel for Azure OpenAI endpoints, AI Search indexes, Document Intelligence, replay windows, citation display, compliance rules, product categories, and user management.

Complete Audit Trail

Every scan stores prompts, model parameters, raw AI responses, retrieved documents, and timestamps. Full traceability from verdict back to source data.

One-Click Workflows

Submit for Internal Review, Copy Full Report, and Upload Another Asset, all accessible directly from the results page. Designed for speed, not clicks.

“We went from a process that took hours per asset and still produced inconsistent results, to a system where customers get structured compliance feedback in under two minutes. The citation transparency changed everything. Every finding traces back to the exact regulation.”

Head of Digital Operations, a European pharmaceutical regulator

Key lessons

What we learned building compliance AI

  1. Vision models unlock compliance for visual marketing

    The majority of marketing assets in this domain are images, not text documents. Without GPT-4 Vision, the system could not read packaging mockups, social media designs, or retail displays. This one capability is what makes self-service compliance checking possible.

  2. Structured validation beats open-ended analysis

    Running a single prompt that says "check this for compliance" produces vague, inconsistent results. Breaking the check into 11 specific rule categories, each with its own pass/fail logic, evidence requirements, and fix suggestions, produces results reviewers actually trust.

  3. RAG context must include institutional memory

    Regulations alone are not enough. The system also retrieves previously approved materials, product dossiers, and training corrections from past reviews. This institutional memory is what makes the AI behave like an experienced reviewer, not a rule-reading machine.

  4. Regulatory source citations are the trust mechanism

    Without linking every finding back to the specific regulatory document, the system is just another AI opinion. With citations, it is a defensible compliance tool. This single feature drove adoption more than anything else.

  5. The reviewer does not go away, they get elevated

    The AI handles the first pass. Human reviewers focus on edge cases, training corrections, and judgment calls. The result is faster throughput and better consistency, not fewer experts.

Tech stack

Built for production in regulated environments

Built on Azure AI services with a modern React frontend and Supabase backend. Every component chosen for production reliability in a regulated environment.

Frontend

  • React
  • TypeScript
  • Tailwind CSS

Backend

  • Supabase
  • Edge Functions
  • PostgreSQL

AI Services

  • Azure OpenAI GPT-4
  • GPT-4 Vision
  • Custom Embeddings

Search & Retrieval

  • Azure AI Search
  • Hybrid Semantic
  • Vector Retrieval

Doc Processing

  • Azure Doc Intelligence
  • PDF → Image
  • OCR Extraction

Auth & Storage

  • Supabase Auth
  • Role-Based Access
  • Blob Storage

Topics

  • Medicines-Advertising Compliance
  • EU Regulatory
  • Production AI
  • GPT-4 Vision + RAG

Research paper

Compliance-grade RAG: Retrieval systems a regulator can audit

How to build retrieval that a regulated reviewer can trust and audit.

Read the paper
Get the designed PDF

Building compliance AI for your regulated industry?

Every engagement starts with one scoped workflow and a written definition of done. Commercial terms are set in the statement of work.

  • Built to SOC 2, HIPAA and GDPR standards
  • EU AI Act-aligned delivery
  • Microsoft Solutions Partner