Inspiration

Clinical trials are the bedrock of medical advancement, yet the infrastructure powering them is fundamentally broken. Over 80% of clinical trials fail to meet enrollment deadlines, and 1 in 5 are terminated prematurely simply because they cannot recruit enough participants.

The root cause? A massive disconnect between complex patient data and rigid trial protocols. Clinicians are forced to manually comb through extensive registries and parse dense inclusion/exclusion criteria, while overly strict parameters unnecessarily disqualify viable candidates. We wanted to build a solution that transforms this manual, error-prone matching process into an automated, data-driven engine. By leveraging a multi-agent AI architecture, we realized we could not only match patients to trials with high precision but also simulate and optimize the trial protocols themselves to supercharge recruitment rates.

What it does

ClinAgentX (featuring the Criteria-AI engine) is an intelligent, multi-agent LLM platform designed to solve the two biggest bottlenecks in clinical development:

  1. Clinical Trial Matching Engine: Instead of relying on rigid keyword filters, the system uses specialized AI agents to evaluate complex patient profiles against real-world trial registries fetched directly from ClinicalTrials.gov. It reasons over intricate inclusion/exclusion logic to provide actionable Match/No-Match statuses alongside clear clinical justifications and required changes for qualification.
  2. Protocol Optimization Simulator: The platform allows trial designers to simulate the impact of adjusting trial parameters. It analyzes historical data to calculate exactly how relaxing specific criteria—like expanding an age range or adjusting a biomarker threshold—would expand the eligible patient pool without compromising clinical validity.

The final output translates messy, raw clinical documentation into structured, explainable, and highly actionable quantitative insights.

How we built it

We engineered ClinAgentX using a modular, multi-agent architecture to ensure separation of concerns and high-fidelity reasoning:

  • The Orchestration & Agent Framework: Built using a supervisor-agent topology.
  • Agent 1 (Patient Eligibility Match) handles the core semantic cross-referencing between patient data and trial criteria.
  • Agent 2 (Tavily Web Search Agent) acts as an information enricher, pulling real-time data on sponsors, enrollment trends, side effects, and monitoring requirements.
  • Agents 3 & 4 (Age Gap & Biomarker Optimization Agents) run independent simulation models to calculate the percentage increase in eligible patients if protocols are adjusted.
  • Agent 5 (Supervisor Summary Agent) acts as the cognitive layer that synthesizes individual agent outputs into a unified, executive optimization report.

  • Database & Backend: We utilized AppWrite to securely store and fetch patient info and historical records.

  • Data Sources & Search Integrations: We integrated the ClinicalTrials.gov API for live trial metadata and utilized Tavily Search to crawl over 60+ specialized medical trial sources simultaneously.

Challenges we ran into

  • Semantic Reasoning Over Exclusion Logic: Parsing inclusion criteria is straightforward, but exclusion criteria often involve double negatives and complex medical jargon. Training our matching agent to accurately reason through what disqualifies a patient required meticulous prompt engineering and structured few-shot examples.
  • Synthesizing Conflicting Agent Insights: The Age Optimization Agent and Biomarker Agent would occasionally suggest conflicting shifts in protocol. Building the Supervisor Summary Agent to act as an objective mediator that balances clinical safety with statistical enrollment gains was a significant engineering hurdle.
  • Data Harmonization: Merging unstructured text data from live web searches via Tavily with highly structured JSON payloads from ClinicalTrials.gov and AppWrite required building robust data-cleaning pipelines before passing contexts to the LLMs.

Accomplishments that we're proud of

  • True Multi-Agent Collaboration: We successfully moved beyond basic single-prompt chains. Seeing the individual optimization agents calculate distinct metrics and hand them off seamlessly to a Supervisor Agent to generate a cohesive report felt like watching a real clinical advisory board at work.
  • Explainable AI (XAI) in Healthcare: We didn't just build a black-box matching tool. ClinAgentX provides exact clinical rationales, quantitative estimates (e.g., "% increase in eligible patients"), and actionable recommendations that clinicians can actually trust.
  • Live Integration: Building a working pipeline that queries live, real-world data from ClinicalTrials.gov and processes it in near real-time.

What we learned

  • The Power of Multi-Agent Specialization: Breaking down complex tasks (like protocol optimization) into smaller, hyper-focused agent roles drastically reduces hallucination rates and increases the analytical depth of the final output.
  • Context is King in Bio-Medicine: Keyword searching completely fails when navigating complex patient histories. Semantic understanding and LLM-driven reasoning are non-negotiable requirements for modern digital health tools.
  • Simulations Save Time: Giving researchers a "sandbox" to simulate protocol adjustments before filing amendments can save millions of dollars and months of delays in the real world.

What's next for ClinAgentX

  • Expanding the Agent Roster: We plan to introduce specialized agents to handle ECOG Performance Status analysis, Histology mapping, and a Geographic/Location Agent to optimize trials based on regional patient densities.
  • Deepening Historical Evidence: Further leverage Tavily and medical databases to fetch deep-dive historical data on similar past clinical trials, allowing the system to predict trial success probability based on historical precedents.
  • FHIR & EMR Integrations: Build native integrations with electronic medical record (EMR) systems using FHIR standards to allow hospitals to securely pull patient profiles automatically.

Built With

  • ai-native
  • medical
  • multi-agent
  • startup/research
Share this project:

Updates