Skip to content

aondaai/trialbridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

132 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrialBridge · Elegível

License: MIT Built with Claude Code Built with Claude: Life Sciences Status: live Tests: 50+ files

Turn a clinical-trial protocol into a Brazil feasibility map in seconds — with Claude's reasoning shown for every eligibility criterion, and no patient record ever leaving the site.

Sponsors paste a ClinicalTrials.gov trial and get state-by-state eligible-population estimates from public health data; sites answer feasibility requests privately. A two-sided bridge for the market the industry is racing toward but pricing on outdated information.

Built entirely with Claude Code during the Built with Claude: Life Sciences hackathon (Builder Track), by a founder who has never written a line of code.


What this is, in one screen (for judges)

Criterion How TrialBridge earns it Verify
Impact — 25% Brazil: 214M people, and Lei 14.874/2024 cut trial approval from >12 months to ~90 business days. Our hackathon survey (N=50; 31 qualified pharma/biotech/CRO) found 70% had never heard of the law, and one paragraph about it lifted intent to run trials in Brazil +1.39 pts among buyers (p<.001). TrialBridge closes that exact gap with provable numbers, at the feasibility stage where 60% of buyers lock their country list. docs/SURVEY.md · live URLs
Claude Use — 25% Claude is in the product (parses eligibility into typed rules with per-criterion reasoning), the platform (ships as an MCP server — same query answered inside Claude), the builder (a non-programmer used Claude Code multi-agent workflows to ETL 163GB of DataSUS, write 50+ test files, run the market survey via MCP). CLAUDE_USE.md
Depth — 20% 163GB DataSUS + a 6.68M-record private base → PHI-safe aggregates; direct-standardized estimator with 95% CIs; bearer-token gating; provenance layer; 50+ test files; and a calibration finding we report against ourselves (below). estimator/ · PROVENANCE.md · tests/
Demo — 30% One unbroken flow on live infrastructure: paste NCT → Claude parses criteria with reasoning → Brazil map lights up with real DataSUS estimates → ranked site shortlist → same query answered inside Claude via MCP. 🎥 video above · live URLs

Honest limits, stated up front (a Depth signal, not a weakness). State-level coverage today is a documented placeholder, not calibration-earned. Our harness found the model calibrates almost perfectly in-distribution (ECE ≈ 0.0002) but breaks across hospital sites (ECE 0.18–0.22). We report this openly and treat cross-site calibration as the named next step — see Honest limits.


Why now — the problem

AI-driven drug discovery is flooding an already-scarce US/EU patient pool. 86% of international trials miss their recruitment target on time, and eligibility criteria have grown 58% more complex in two decades. Sponsors are pushed toward new markets; Brazil grew from 25 registered studies in 2000 to 403 in 2024. But both sides of the trade are broken: sites can't prove patient capacity fast enough to win incoming trials, and sponsors have no fast, structured way to discover which sites can actually deliver against a protocol. It's manual RFIs and weeks of waiting — in both directions.

The solution — two sides, one bridge

  • Sponsor side. Paste a ClinicalTrials.gov NCT id (or free-text criteria) → Claude parses it into typed Criterion[] with reasoning shown for every criterion → the estimator returns state-by-state eligible-population estimates from public DataSUS data, with 95% CIs and honest coverage labels → interactive Brazil map + ranked site/state shortlist. A protocol softening panel shows, live, how loosening one criterion changes the candidate pool.
  • Site side. A site runs the sponsor's criteria against its own patients, privately, and responds with a de-identified proof of capacity. The sponsor sees only aggregated cross-site counts (small cells suppressed as <5) — never row-level patient data.

The 60-second demo (what you'll see in the video)

  1. Paste a ClinicalTrials.gov NCT id for a Phase III breast-cancer trial.
  2. Claude parses the eligibility criteria into typed rules — each with its reasoning and a confidence; low-confidence rows are flagged for a human to confirm before they count.
  3. The Brazil map lights up with eligible-population estimates per state, from real DataSUS data, each labeled with what's calibrated and what isn't.
  4. A ranked site/state shortlist appears; the softening panel shows how relaxing one criterion grows the pool.
  5. The same question, answered inside Claude via the MCP server — the governed answer, natively.

Claude Use — the part that "surprises even us"

Full writeup with commit evidence in CLAUDE_USE.md. In short:

  1. Claude in the product. claude-opus-4-8 parses protocol eligibility into typed, auditable rules via structured outputs; the LLM does the ambiguous linguistic work and is kept out of the deterministic counting path — its weakest step is the one a human checks. → src/lib/parse.ts
  2. Claude as the platform. The estimator ships as an MCP server (scripts/mcp-cohort-server.ts) so a coordinator gets the same governed answer inside Claude.
  3. Claude as the builder. A non-programmer used Claude Code multi-agent workflows to materialize 163GB of DataSUS into PHI-safe aggregates, build the governance/provenance layer, and author 50+ test files. The build itself is the proof.
  4. Claude for market evidence. A Claude Code session connected via MCP to Prolific ran and analyzed the survey below. → docs/SURVEY.md

Quick start

cd trialbridge
npm install
npm run generate-data   # 3 synthetic site datasets (seeded, reproducible)
npm run db:seed         # hero consultation + pre-seeded responded sites
npm run demo            # headless proof: prints the whole pipeline
npm run dev             # http://localhost:3000 → / /sponsor /site /scorecard
npm test                # unit tests (the matcher is the source of truth)

Estimator (Python; standard library only for the demo):

cd estimator
python3 demo.py                 # end-to-end estimator demo
python3 tests/test_estimator.py # method sanity checks

Set ANTHROPIC_API_KEY to run the live Claude parse; without a key it falls back to cached, human-verified criteria (clearly labelled) so the flow always works.


Architecture (how a query flows)

NCT id / free-text criteria
   │
   ▼  Claude (claude-opus-4-8, structured outputs) → typed Criterion[] + per-criterion reasoning
   │                                                  (low-confidence rows flagged for human review)
   ▼  Deterministic matcher ── checkable criteria run exactly; no LLM in the counting path
   │
   ▼  Estimator:  eligible[site] = Σ_strata ( DataSUS_base[site,stratum] × depth_rate[stratum] )
   │   direct-standardized to the national population · 95% CI · honest coverage labels
   ▼
Brazil choropleth + ranked shortlist ── also exposed as an MCP tool (same governed answer in Claude)

Design decisions are recorded as ADRs in docs/ (ADR-001 system architecture, ADR-002 managed-agents orchestration).


Data & rights (open-source compliance)

Detail in DATA.md and PROVENANCE.md.

  • Public & shipped: DataSUS (Brazil's unified public-health dataset) as PHI-safe, cell-suppressed aggregates; ClinicalTrials.gov protocol data (public API).
  • Local & private, never in this repo: the iHealth proprietary base. No redistribution rights, so it stays local and gitignored; served aggregates carry no proprietary-only cells.
  • License: MIT.

Honest limits — what is not yet true

We would rather you trust the numbers we publish than oversell the ones we don't.

  • State coverage is a labeled placeholder, not calibration-earned. The /query responses say so in-band. Making it defensible is our documented next track (calibration → geographic holdout → external epi benchmark → drift monitoring).
  • Calibration transfers within-distribution but breaks across sites. Measured: ECE ≈ 0.0002 in-distribution vs. 0.18–0.22 cross-site on real breast-cancer data (LOHO + k-fold). A real finding, reported against our own interest, that defines the roadmap.
  • Oncology only (v1). Breast/HER2 depth extracted; other tumor types are base-cohort only.

Repository map

trialbridge/           Next.js web app (sponsor + site flows, matcher, MCP cohort server)
  src/                 app routes, lib (ctgov intake, parse, omop, feasibility-autofill)
  scripts/             mcp-cohort-server.ts, seed + e2e drivers
  tests/               50+ test files
estimator/             Python feasibility estimator (standardized rates, CIs, softening)
docs/                  ADRs, survey results, provenance map, vocabulary mapping
CLAUDE_USE.md          how Claude built and powers this (read this for the Claude-Use criterion)
DATA.md                what is public vs. private, and why
PROVENANCE.md          data lineage for every number shown
LICENSE                MIT

TrialBridge — built with Claude Code. Better science, and access to treatments for people who could never dream of them.

About

Latin America’s clinical-trial infrastructure for the AI drug-development decade

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors