Inspiration

Clinical trial recruitment is broken in a specific, measurable way: online recruiting is roughly 3x cheaper per enrollee than clinic referral ($72 vs $199, per a JMIR meta-analysis), but it converts far worse — because sites drown in unqualified leads. Somewhere right now, a research coordinator is twenty minutes into a phone screen with someone who was never going to qualify, because nobody checked before they picked up. We built the missing step.

What it does

Trialme is a voice-AI pre-screening line for clinical trials, backed by a candidate portal and a coordinator dashboard.

A candidate browses real paid studies at trialme-seven.vercel.app, then calls +1 (929) 799-8746. The agent recognizes returning callers by phone number, runs the study's actual eligibility criteria as a conversation, answers questions about the study (duration, compensation, site) grounded only in listing-stated facts, and books a real coordinator callback slot inside the call. If a call drops mid-screening, the system calls back and resumes at the exact question. The coordinator dashboard mirrors a real research worklist: referral queue, eligibility checklists with quoted protocol text, full transcripts with per-turn latency, enrollment tracking with week-by-week progress, and check-in scheduling.

Two design theses run through everything:

  1. The LLM never decides eligibility.** Claude only extracts structured answers from speech; deterministic Python compares them to registry-verified criteria. The model cannot hallucinate someone into a trial.
  2. The state machine is the script.** Real pre-screens legally run from IRB-approved verbatim scripts (45 CFR 46.116(g)). Every sentence our agent speaks is a fixed, code-owned template — the same property, in executable form.

How we built it

  • Telephony: Twilio ConversationRelay (managed STT/TTS, barge-in) over a FastAPI websocket on Railway; Twilio Verify for phone-OTP login; guarded outbound recall for dropped calls
  • Agent framework: an explicit conversation state machine (disclosure and consent, routing, screening, contact capture, scheduling) with a fail-closed consent gate, emergency-language escalation tiers (911 medical / 988 crisis), and cross-trial offers that remember prior rejections
  • Knowledge base: 12 real recruiting trials compiled from ClinicalTrials.gov by an LLM-drafts, deterministic-validation-gates pipeline, then adversarially re-verified against the live registry. 7 carry officially published compensation with citation links; the rest say so honestly — no invented numbers anywhere
  • Data: Supabase Postgres as the single sync fabric between the call server and the Next.js portal on Vercel; every conversation turn persisted with latency; call answers are authoritative over portal answers
  • Privacy: unknown callers who screen ineligible never have their phone number written to storage — the agent's spoken privacy promise is architecturally true. Candidates get self-serve data deletion

Challenges we ran into

Live phone calls found bugs no test suite did: a cross-trial offer that hung up on "yes," a re-offer loop that suggested a study that had just rejected the caller, and a recall leg that misread Twilio's direction field and politely interviewed a voicemail. Each was fixed with regression tests within minutes. Carrier A2P rules silently block plain SMS from local numbers, so login moved to the Verify API. macOS echo cancellation ate our first demo recording.

Accomplishments and what we learned

A full 7-criterion screening call runs about 2 minutes against a 20-minute manual benchmark, with agent replies averaging 500-870ms. The presenter was correctly rejected from a 55-85 study at age 26 on criterion one — the fail-fast guardrail working live. We learned that honesty is a feature: every compensation figure on the feed links to the official page that states it, and judges can check.

What's next

Adherence check-in calls on the same state machine (retention is where trials bleed), answering-machine detection for recall, branded caller ID, an A2P campaign for SMS, Redis-backed live-call state, and a clinician sign-off queue for newly compiled trials.

Try it

Portal: https://trialme-seven.vercel.app — Screening line: +1 (929) 799-8746

Built With

Share this project:

Updates

Submission history