AI-powered ethics approval pipeline for UK clinical neuroscience research
Built for the Claude AI Hackathon β Track 1: Biological and Physical Health.
- Transforms a draft ethical review submission into REC-ready regulatory documents using a multi-agent AI architecture
- Dramatically accelerates a process that traditionally requires 4-8 months of researcher time.
- Cross-references 200+ pages of regulation and official Review Criteria.
Authors: Oriol Morros Vilaseca, Indigo Luksch, Marvel Manoharan, Akeel Msjeed
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Clinical neuroscience researchers in the UK face significant barriers when seeking ethics approval:
- 4-8 months timeline from study conception to NHS REC approval
- 70% of initial submissions are returned for revisions, primarily due to formatting and administrative issues
- 120-200 hours of regulatory paperwork per study, typically completed by PhD students
ERA uses 5 specialized AI agents that work sequentially to produce a complete ethics application package:
- Intake Agent β Extracts a structured study profile from your description
- Regulatory Agent β Maps the study against 14 UK and international regulatory frameworks
- Consent Agent β Generates HRA-standard Consent Forms and Participant Information Sheets
- Ethics Agent β Creates IRAS-compliant Ethics Narratives and UKRI Data Management Plans
- QA Agent β Simulates an NHS REC review with quality scores and actionable improvement suggestions
flowchart TB
subgraph Frontend["Frontend Layer (Next.js 16 + React 19)"]
UI["Study Intake Form"]
HOOK["usePipeline Hook<br/>(SSE Stream)"]
RESULTS["Results Dashboard"]
HEALTH["Health Check"]
end
subgraph Backend["Backend Layer (FastAPI + Python)"]
API_PIPELINE["POST /api/pipeline<br/>(SSE endpoint)"]
API_HEALTH["GET /api/health"]
ORCH["Orchestrator<br/>(Pipeline Coordinator)"]
subgraph Agents["AI Agents (Claude Sonnet 4.6)"]
A1["1οΈβ£ Intake Agent<br/>Profile Extraction"]
A2["2οΈβ£ Regulatory Agent<br/>Compliance Mapping"]
A3["3οΈβ£ Consent Agent<br/>PIS + Consent Forms"]
A4["4οΈβ£ Ethics Agent<br/>IRAS Narrative + DMP"]
A5["5οΈβ£ QA Agent<br/>REC Review Simulation"]
end
subgraph KB["Knowledge Bases (Static JSON)"]
REG["ποΈ 14 UK/International<br/>Regulations"]
PREC["π 8 Precedent<br/>Studies"]
REC["β
4 REC Review<br/>Checklists"]
end
end
UI -->|"Study description"| API_PIPELINE
UI -.->|"Monitor backend"| API_HEALTH
API_HEALTH -.->|"Status response"| HEALTH
API_PIPELINE --> ORCH
ORCH -->|"Real-time events"| HOOK
HOOK --> RESULTS
ORCH --> A1
A1 -->|"StudyProfile JSON"| A2
A2 -->|"RegulatoryMatrix"| A3
A2 -->|"RegulatoryMatrix"| A4
A3 -->|"Consent Package"| A5
A4 -->|"Ethics Package"| A5
A2 -.->|"Lookup tools"| REG
A4 -.->|"Search tools"| PREC
A5 -.->|"Checklist tools"| REC
style Frontend fill:#1e293b,stroke:#3b82f6,stroke-width:3px,color:#e2e8f0
style Backend fill:#1e293b,stroke:#10b981,stroke-width:3px,color:#e2e8f0
style Agents fill:#0f172a,stroke:#8b5cf6,stroke-width:2px,color:#e2e8f0
style KB fill:#0f172a,stroke:#f59e0b,stroke-width:2px,color:#e2e8f0
sequenceDiagram
participant User
participant Frontend
participant API as FastAPI Backend
participant Orch as Orchestrator
participant A1 as Intake Agent
participant A2 as Regulatory Agent
participant A3 as Consent Agent
participant A4 as Ethics Agent
participant A5 as QA Agent
participant KB as Knowledge Bases
User->>Frontend: Enter study description
Frontend->>API: POST /api/pipeline (SSE)
API->>Orch: Start pipeline
Note over Orch,A1: Stage 1: Profile Extraction
Orch->>A1: Extract structured profile
A1->>A1: Parse study details
A1-->>Orch: StudyProfile JSON
Orch-->>Frontend: SSE: stage="intake" status="complete"
Note over Orch,A2: Stage 2: Regulatory Mapping
Orch->>A2: Identify regulations
loop For each regulation
A2->>KB: lookup_regulation()
KB-->>A2: Regulation details
end
A2-->>Orch: RegulatoryMatrix (14 reqs)
Orch-->>Frontend: SSE: stage="regulatory" status="complete"
Note over Orch,A5: Stage 3 & 4: Parallel Document Generation
par Consent Package
Orch->>A3: Generate consent docs
loop Until readable
A3->>A3: check_readability()
end
A3-->>Orch: Consent Form + PIS
Orch-->>Frontend: SSE: stage="consent" status="complete"
and Ethics Package
Orch->>A4: Generate ethics docs
A4->>KB: search_precedent()
KB-->>A4: Similar studies
A4-->>Orch: Ethics Narrative + DMP
Orch-->>Frontend: SSE: stage="ethics" status="complete"
end
Note over Orch,A5: Stage 5: Quality Assurance
Orch->>A5: REC review simulation
A5->>KB: lookup_rec_checklist()
A5->>A5: cross_reference_check()<br/>(Claude Haiku)
A5->>A5: check_readability()
A5-->>Orch: QA Report + Scores
Orch-->>Frontend: SSE: stage="qa" status="complete"
Frontend-->>User: Display complete results
opt User cancels pipeline
User->>Frontend: Click cancel
Frontend->>API: Disconnect SSE
API->>Orch: Set cancel_event
Orch->>Orch: Stop execution
end
Automatically maps your study against 14 UK and international regulatory frameworks, including:
- Health Research Authority (HRA) Approval
- Integrated Research Application System (IRAS)
- NHS Research Ethics Committee (REC)
- Mental Capacity Act 2005
- UK GDPR and Data Protection Act 2018
- Caldicott Principles
- Human Tissue Act 2004
- And 7 additional relevant frameworks
Each regulation is assessed for applicability with detailed rationale and actionable requirements.
Produces 4 publication-ready documents optimized for NHS REC submission:
| Document | Standard | Contents |
|---|---|---|
| Participant Information Sheet | HRA-standard | Purpose, procedures, risks, benefits, data handling, complaints, contacts |
| Consent Form | HRA-standard | Tick-box consent items, optional sections for MCA/MRI/genetics |
| Ethics Narrative | IRAS Section A | Scientific justification, recruitment, consent process, risk assessment |
| Data Management Plan | UKRI-compliant | BIDS format, storage, security, anonymization, GDPR, archiving |
Simulates an authentic NHS Research Ethics Committee review using 4 real REC reviewer checklist variants:
- Standard full review
- Mental Capacity Act (MCA) flagged studies
- Database studies
- Tissue bank studies
The QA Agent produces:
- 6 quantitative quality scores β Overall quality, readability, completeness, consistency, regulatory alignment, and rejection risk
- Per-item checklist evaluation β Categorized as adequate, minor concerns, major concerns, or not addressed
- Prioritized fix suggestions β Actionable recommendations with severity ratings (critical, major, minor, info) and specific document locations
Server-Sent Events (SSE) technology delivers live pipeline updates with user control:
- Live stage tracking β Watch each of the 5 agents progress in real-time
- Execution timing β See how long each stage takes
- Incremental result delivery β Results appear as soon as each agent completes
- Cancel anytime β Stop long-running pipelines without waiting for completion (graceful shutdown with asyncio event coordination)
Experience the full pipeline instantly with pre-generated demo results:
- Complete Alzheimer's fMRI study scenario
- All 5 pipeline stages pre-executed
- Immediate access to regulatory mapping and generated documents
- Perfect for evaluating output quality before running your own study
| Component | Technology | Purpose |
|---|---|---|
| Frontend | Next.js 16, React 19, TypeScript | Modern React framework with Server Components and API routes |
| Styling | Tailwind CSS 4 | Utility-first CSS framework for rapid UI development |
| Backend | Python 3.8+, FastAPI | High-performance async API framework |
| Real-time | SSE-Starlette | Server-Sent Events for live progress streaming |
| AI Models | Claude Sonnet 4.6 | Primary agent reasoning and document generation |
| Claude Haiku 4.5 | Fast cross-reference validation checks | |
| Data Validation | Pydantic | Type-safe data models and request/response validation |
| Knowledge Bases | Static JSON files | 14 regulations, 8 precedent studies, 4 REC checklists |
| API Communication | REST + SSE | HTTP endpoints with event streaming for long-running tasks |
- Node.js 18+
- Python 3.8+
- An Anthropic API key
git clone https://github.com/ClaudeAI-Hackathon.git
cd ClaudeAI-HackathonCreate a .env.local file in the project root:
ANTHROPIC_API_KEY=sk-ant-your-key-here
# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Start the FastAPI backend
cd backend
python -m uvicorn main:app --host 0.0.0.0 --port 8000 --reloadThe backend will start on http://localhost:8000. The --reload flag enables auto-restart on code changes during development.
# From project root
npm install
npm run devNavigate to http://localhost:3000 in your browser.
Quick Start Options:
- Click "Load Demo Scenario" to view pre-generated results from a complete Alzheimer's fMRI study
- Enter your own study description and click "Start Pipeline" to generate a new ethics package
Health Check: You can verify the backend is running by visiting http://localhost:8000/api/health or checking the health status indicator in the UI.
The pre-loaded demo showcases a UCL fMRI study investigating working memory deficits in early-stage Alzheimer's disease, including optional APOE genotyping via blood draw. This scenario intentionally triggers maximum regulatory complexity to demonstrate ResearchFlow's comprehensive compliance mapping.
- Population: 30 participants aged 55-80 with MCI or early Alzheimer's diagnosis
- Setting: NHS Memory Clinic (UCLH) recruitment
- Procedures: fMRI scanning (3 timepoints), neuropsychological assessment, optional blood sampling
- Duration: 18 months longitudinal follow-up
- Risk Level: High (vulnerable population with intrusive procedures)
| Requirement | Rationale |
|---|---|
| Mental Capacity Act 2005 | Participants have cognitive impairment; capacity assessment required |
| NHS REC Review (MCA-flagged) | High-risk study with vulnerable participants |
| HRA Approval | NHS patients, data, and facilities involved |
| IRAS Submission | Mandatory for all NHS research |
| UK GDPR / DPA 2018 | Processing health data and special category genetic data |
| Human Tissue Act 2004 | Blood samples stored for research purposes |
| Genetic Data Regulations | APOE genotyping with result disclosure considerations |
| Caldicott Principles | NHS patient confidentiality and data access |
| MRI Safety Requirements | Neuroimaging with safety screening protocols |
| Incidental Findings Protocol | Potential unexpected scan findings in at-risk population |
| UKRI/MRC Data Sharing Policy | Funder requirement for open data deposition |
| ICH GCP | Clinical research good practice standards |
| Declaration of Helsinki | Ethical principles for medical research |
| Vulnerable Populations Protections | Enhanced safeguards for cognitively impaired participants |
The demo includes complete outputs:
- π Participant Information Sheet (5.1 grade reading level, 77.4 readability score)
- β Consent Form (6 sections, MCA capacity assessment, genetic testing options)
- π Ethics Narrative (12 sections covering IRAS requirements, 8 precedents referenced)
- πΎ Data Management Plan (BIDS-compliant, UKRI Gateway sharing)
β οΈ QA Report (REC simulation with 42/100 overall score, 21 identified issues)
- Stage 1 (Intake): 35.7 seconds
- Stage 2 (Regulatory): 120.1 seconds
- Stage 3 (Consent): 715.1 seconds (parallel)
- Stage 4 (Ethics): 715.2 seconds (parallel)
- Stage 5 (QA): 623.3 seconds
- Total: ~37 minutes
Note: Demo mode loads these pre-generated results instantly.
neuro_ethics_hack/
βββ src/ # Next.js frontend
β βββ app/
β β βββ page.tsx # Home page with study intake form
β β βββ pipeline/page.tsx # Pipeline execution and results page
β β βββ layout.tsx # Root layout with metadata
β β βββ api/
β β βββ pipeline/route.ts # Proxy to FastAPI backend
β β βββ health/route.ts # Backend health check endpoint
β βββ components/
β β βββ StudyIntakeForm.tsx # Study description input
β β βββ PipelineProgress.tsx # Real-time stage progress
β β βββ RegulatoryMap.tsx # Regulation compliance grid
β β βββ DocumentViewer.tsx # PIS, Consent, Ethics, DMP viewer
β β βββ QAReportPanel.tsx # REC simulation results
β β βββ ScoreCard.tsx # Quality score visualization
β β βββ ExportPanel.tsx # Document export functionality
β β βββ DemoScenarioButton.tsx # Load pre-generated demo
β βββ hooks/
β β βββ usePipeline.ts # SSE streaming hook
β βββ lib/
β βββ types.ts # TypeScript type definitions
β βββ pipeline-context.tsx # React Context for pipeline state
β βββ demo-scenario.ts # Demo study description
β βββ demo-completed-state.ts # Pre-generated demo results
β
βββ backend/ # Python FastAPI backend
β βββ main.py # FastAPI app + API routes
β βββ orchestrator.py # Pipeline coordination + SSE streaming
β βββ agent_runner.py # Claude tool-use loop executor
β βββ anthropic_client.py # Anthropic API client wrapper
β βββ models.py # Pydantic data models
β βββ agents/ # 5 specialized AI agents
β β βββ intake.py # Profile extraction agent
β β βββ regulatory.py # Regulation mapping agent
β β βββ consent.py # Consent + PIS generation agent
β β βββ ethics_narrative.py # Ethics + DMP generation agent
β β βββ qa.py # REC review simulation agent
β βββ tools/ # Agent tool implementations
β β βββ lookup_regulation.py # Fetch regulation details
β β βββ search_precedent.py # Search similar studies
β β βββ lookup_rec_checklist.py # Fetch REC checklists
β β βββ check_readability.py # Flesch-Kincaid scoring
β β βββ cross_reference_check.py # Document consistency validation
β βββ knowledge/ # Static knowledge bases (JSON)
β βββ regulations.py # 14 UK/international regulations
β βββ precedents.py # 8 precedent studies
β βββ rec_checklists.py # 4 REC review checklist variants
β
βββ .env.local # Environment variables (API keys)
βββ requirements.txt # Python dependencies
βββ package.json # Node.js dependencies
βββ tsconfig.json # TypeScript configuration
Regulatory matching is fundamentally deterministic β study features map directly to specific applicable regulations. The knowledge base is compact (14 regulations, 8 precedents, 4 checklists) and highly structured. Static lookups provide:
- Faster execution β No embedding generation or vector search latency
- Perfect recall β Every regulation is checked systematically
- Predictable behavior β No semantic similarity ambiguity
- Easy auditing β Clear traceability of which regulations were applied and why
The Consent Agent (Stage 3) and Ethics Agent (Stage 4) both depend only on outputs from Intake and Regulatory agents, with no inter-dependencies. Running them in parallel using asyncio.gather reduces total pipeline time by approximately 40%.
Each agent leverages Claude's native tool-use capability to interact with deterministic tools:
- Regulation lookup β Fetch complete regulatory requirements
- Precedent search β Find similar approved studies
- Readability checks β Calculate Flesch-Kincaid scores
- Checklist validation β Apply real REC reviewer criteria
Agents call a final submit tool to return structured JSON output. This architecture keeps agents grounded in verified knowledge bases rather than generating potentially inaccurate regulatory information.
SSE provides unidirectional real-time streaming from server to client with automatic reconnection, perfect for long-running pipeline updates. Unlike WebSockets, SSE works over standard HTTP and integrates seamlessly with Next.js API routes.
Running the full pipeline takes 30-40 minutes due to Claude API calls for document generation. Pre-generated demo results allow instant evaluation of:
- Output quality and formatting
- Regulatory mapping comprehensiveness
- REC simulation accuracy
- UI/UX flow
Users can explore complete results immediately before committing to a full pipeline run.
Symptom: Frontend shows "Backend not reachable" or health check fails
Solutions:
- Verify the backend is running:
curl http://localhost:8000/api/health - Check if port 8000 is available:
lsof -i :8000(macOS/Linux) ornetstat -ano | findstr :8000(Windows) - Ensure
.env.localfile exists with yourANTHROPIC_API_KEY - Check backend logs for errors in the terminal where you ran
uvicorn
Symptom: Import errors or module not found
Solutions:
- Backend:
pip install -r requirements.txt(ensure virtual environment is activated) - Frontend:
npm installfrom project root
Symptom: "401 Unauthorized" or authentication errors
Solutions:
- Verify your Anthropic API key is valid at https://console.anthropic.com/
- Ensure
.env.localcontains:ANTHROPIC_API_KEY=sk-ant-your-key-here - Restart the backend after updating
.env.local
Expected Behavior: A full pipeline run takes 30-40 minutes due to:
- Claude API calls for document generation (~10-15 minutes per document agent)
- Quality checks and readability iterations
- Regulatory lookups and precedent searches
Recommendations:
- Use the demo mode for instant results during development
- The cancel button allows stopping execution at any point
- Consider running pipeline in background and checking results later
Initiates the ethics approval pipeline with real-time SSE streaming.
Request Body:
{
"description": "string (your study description)"
}Response: Server-Sent Events stream with the following event types:
stage_updateβ Stage started or completed with timingresultβ Final pipeline results with all generated documents
Example SSE Events:
data: {"type": "stage_update", "stage": "intake", "status": "running"}
data: {"type": "stage_update", "stage": "intake", "status": "complete", "duration_ms": 35700}
data: {"type": "result", "profile": {...}, "regulatoryMatrix": {...}, ...}
Health check endpoint to verify backend connectivity.
Response:
{
"status": "ok",
"service": "researchflow"
}Next.js proxy route that forwards requests to the FastAPI backend with CORS handling.
Next.js proxy route that checks FastAPI backend health, returning:
200 OKwith backend status if reachable503 Service Unavailableif backend is down
This project was built for the Claude AI Hackathon.





