Skip to main content
Loading navigation

Anti-Inflammatory Clinical Trial Matching Triage with Pydantic AI

Screening patients for cardiovascular clinical trials targeting inflammatory pathways demands robust criteria validation. Build a type-safe Pydantic AI triage system managed with OpenHands to validate patient EHR records against complex inclusion rules for IL-6 targeted biological therapy.

Data ScienceHosted by Vera

What you are building

Construct a type-safe clinical trial eligibility workflow using Pydantic AI and OpenHands to evaluate cardiovascular patient cohorts for anti-inflammatory trials.

How work is evaluated

Evaluation

Evaluates Pydantic schema validation accuracy and correct clinical eligibility matching.

Datasets

Public datasets, plus the private datasets you have access to.

How submissions are scored

Dimensions
2 scoring checks
Binary
2 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

Pydantic Parsing Validation

Verifies output parses cleanly into target Pydantic BaseModel.

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

Matching Accuracy

Percentage of correct inclusion/exclusion patient categorizations. • target: 0.98 • range: 0-1

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

  • Implement type-safe AI agents with Pydantic AI and validated Pydantic output models.

  • Integrate OpenHands autonomous execution environments for data verification tasks.

  • Parse clinical trial inclusion/exclusion criteria into strict rule validation logic.

  • Evaluate patient biomarker levels (hsCRP, IL-6) against eligibility thresholds.

Resources

Dataset notes

EHR cohort dataset containing patient laboratory records (hsCRP, IL-6, renal function) and clinical history for trial matching.

Challenge setup

Evaluates Pydantic schema validation accuracy and correct clinical eligibility matching.

Challenge input

JSON patient record containing hsCRP level, eGFR, prior ASCVD history

Pydantic AI

Provides type-safe structured outputs and validation.

OpenHands

Enables reproducible agent execution and environment management.

Evaluated output

JSON verified by Pydantic model containing is_eligible, failed_criteria, match_confidence

Evaluation checks
  • Verifies output parses cleanly into target Pydantic BaseModel.
  • Percentage of correct inclusion/exclusion patient categorizations. • target: 0.98 • range: 0-1
Configured evaluation evidence
  • Benchmark: TrialMatch-Bench
  • Matching Accuracy target: 0.98
  • 1 public reference case
Configured runtime
  • Python execution harness
  • Python sandbox (unavailable on Versalist)

Shows the first task, up to three tools, and up to three evidence items.

View technical recipe

Configured tools

Environment
  • OpenHands · Optional
Action Space
  • Pydantic AI · Required
  • OpenHands · Optional
  • Darts (Time Series) · Optional
Orchestration
  • Pydantic AI · Required
  • OpenHands · Optional

Evaluation contract

  • Pydantic Parsing Validation · Weight 1
  • Matching Accuracy · Weight 1

Metrics

  • Matching Accuracy · Target 0.98

Benchmarks

  • TrialMatch-Bench
  • biotech

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: JSON patient record containing hsCRP level, eGFR, prior ASCVD history

    Output: JSON verified by Pydantic model containing is_eligible, failed_criteria, match_confidence

    Execution harness: Python

Evaluation tools

  • Pydantic AI · Agent Framework
  • OpenHands · Agent Execution Sandbox

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Anti-Inflammatory Clinical Trial Matching Triage with Pydantic AI