Skip to content

ShowcasedPath oneResearch, science & evidence

TrialMatch

Matches cancer patients to recruiting clinical trials using fixed GROQ filters, for clinicians and families searching ClinicalTrials.gov.

by Abhishek Khanra

Precision on 10 test profiles, versus 60% for keyword search and 0% for a bare LLM
100%
Safety violations from keyword search on the same profiles, versus 0 for TrialMatch
153
Trial IDs invented by an ungrounded LLM across the 10 profiles; none exist
21

What it does

A clinician pastes a patient note and sees only trials the patient fits.

A clinician or family member enters a clinical note or picks one of eight preset cases. One column lists recruiting trials that pass every protocol filter, with biomarker targets, matching hospital sites and the exact GROQ query that ran.

The other column shows what plain keyword search returns for the same note, with a red banner on each trial the patient would be excluded from, such as for prior chemotherapy or liver metastases.

The problem

Chatbots invent trial IDs, and keyword search ignores exclusion clauses.

Eligibility for cancer trials depends on exact mutations, prior drug lines and washout periods, often buried in PDF attachments. When the builder tested two chatbots on a real lung cancer case, both returned trial IDs that do not exist. Keyword search returned 69 studies, 31 of which excluded patients with prior chemotherapy, and confused the EGFR mutation with the eGFR kidney test.

What they built

Trial protocols split into typed biomarker, therapy and site fields.

100 oncology trial protocols ingested from the ClinicalTrials.gov API v2, plus interpretation rules in a Knowledge Base.

  • clinicalTrial

    One trial: NCT ID, title, recruitment status, condition, target biomarkers, prior therapy rules and site locations.

  • protocolRule

    One rule for edge cases such as washout periods, with category, priority, summary and clinical rationale.

The stack

Two Context endpoints: GROQ filters and protocol rules.

  • Sanity Context MCP
  • Knowledge Base
  • Content Lake
  • GROQ
  • Sanity Studio
  • Next.js 16
  • Claude Haiku 4.5
  • ClinicalTrials.gov API
  • Vercel

The hard part

The model only extracts four parameters; fixed GROQ does the matching.

Letting a model write queries led to dropped exclusion criteria and loose OR clauses. Instead, Claude Haiku pulls condition, biomarker, chemotherapy status and location from the note, and those values are bound into a fixed GROQ query.

Because prior chemotherapy is a schema field with set values, trials that forbid it are filtered out in the query itself. Typed biomarker values also stop kidney eGFR trials from matching EGFR lung cancer cases.

Open the 3-arm benchmark ↗

More from path one

See the full showcase