TrialMatchAI¶
TrialMatchAI matches patients to the clinical trials they're eligible for. Give it a patient — clinical notes, FHIR, Phenopacket, or OMOP — and it returns a ranked shortlist of trials, each with a transparent, criterion-by-criterion explanation of why the patient does or doesn't qualify. Everything runs on your own infrastructure: hybrid retrieval over a local LanceDB index paired with chain-of-thought LLM reasoning served by vLLM on a single GPU, so sensitive patient data never leaves your environment.
Research and informational use only
TrialMatchAI is not medical advice, not a medical device, and must not replace review by qualified healthcare professionals.
Install¶
uv pip install "trialmatchai[llm,gpu,entity]" # full model-backed runtime (GPU host)
# or, lightweight (CLI + base deps only):
uv pip install trialmatchai
The two halves¶
TrialMatchAI runs in two halves — build the system once, then match patients many times — and both are idempotent: finished work is never redone.
trialmatchai bootstrap-data # fetch the prepared corpus + adapters (Zenodo)
trialmatchai build --concepts # prepare + index + concept store (resumable)
trialmatchai e2e --input patient.txt # ingest + match one patient
# -> results/<patient_id>/ranked_trials.json + a self-contained results/index.html
One pipeline, maximally modular¶
Under the hood everything is a slice of a single, ordered pipeline of idempotent stages. Run the whole thing, or any subset:
trialmatchai pipeline # run every stage (skipping what's done)
trialmatchai pipeline --only match # just (re)match
trialmatchai pipeline --to index # the build half
trialmatchai pipeline --skip expand # ablation: no query expansion
trialmatchai pipeline --force match # redo a stage even if done
See Pipeline & CLI for the stage list and flag scheme, Architecture for how it fits together, and the API reference for the Python API.
Cite¶
Abdallah, M. et al. TrialMatchAI: an end-to-end AI-powered clinical trial recommendation system to streamline patient-to-trial matching. Nature Communications 17, 4472 (2026). https://doi.org/10.1038/s41467-026-70509-w