
Back
Healthcare & Clinical
An Agentic, Six-Agent Pipeline for Deterministic Clinical Trial Eligibility Matching
How Pfactorial Technologies is building TrialMatch AI, a multi-agent system that screens patients against trial eligibility criteria in minutes instead of days - with every decision source-attributed and every run bit-identically reproducible.
August 21, 2026
Share
ENGAGEMENT SNAPSHOT

Figure 1 - Key figures from this engagement, at a glance.
EXECUTIVE SUMMARY
In oncology trial recruitment, manual cohort screening against eligibility criteria takes 3-5 days per query - and against aggressive malignancies with narrow progression windows, that lag means patients can advance beyond eligibility before they're even identified as candidates.
A monolithic matching algorithm can't be trusted with this decision on its own: clinicians need to know exactly which lab result or clinical note triggered a match, and a system whose output can vary between identical runs can't clear the reproducibility bar clinical research actually requires.
Pfactorial is building TrialMatch AI around a six-agent pipeline - Protocol, Cohort, Genomics, Timeline, Notes, and Eligibility agents - each operating with minimal blast radius on its own data domain, converging on a per-criterion, source-attributed eligibility verdict that's deterministic and audit-ready by design.
Why this engagement is representative This engagement demonstrates Pfactorial's ability to design AI systems for domains where explainability and reproducibility aren't nice-to-haves but hard regulatory and clinical trust requirements - architecting for that from the start rather than retrofitting it onto a black-box model.
THE CHALLENGE
Moving clinical trial screening from days to minutes, without sacrificing clinical trust, required solving four distinct problems.
1. Manual screening timelines don't match disease progression timelines
A 3-5 day lag per cohort query means aggressive malignancies with 90-day progression windows can put patients past eligibility before manual review even identifies them as candidates.
2. A black-box match can't earn clinical trust
Monolithic matching algorithms don't explain themselves - clinicians need to see exactly which lab result, note, or criterion triggered a given eligibility decision, not just a match score.
3. Critical eligibility signals live outside structured data
Genomic variant data and narrative clinical notes - ECOG performance scores, brain metastasis status - routinely determine eligibility but aren't reliably captured in structured EHR fields alone.
4. Non-deterministic outputs can't clear the regulatory bar
A system that produces different results on different runs against the same protocol and data snapshot cannot satisfy 21 CFR Part 11's reproducibility and audit-trail requirements.
The real brief Not “build a faster matching algorithm” but “build a matching system whose every decision a clinician can trace, and whose every run a regulator can reproduce.”
THE SOLUTION
Pfactorial is architecting TrialMatch AI as a strict topological DAG of six specialized agents, each isolated to its own domain, converging on a synthesized, per-criterion eligibility report with explicit source attribution.

Figure 2 - Six specialized agents converge on one auditable, per-criterion eligibility verdict.
Architectural principles
- Minimal blast radius by design - Six agents - Protocol, Cohort, Genomics, Timeline, Notes, Eligibility - operate as a strict DAG, so a failure or ambiguity in one domain (say, a complex genomic variant) cannot corrupt the outputs of the Cohort or Timeline agents.
- Explainability down to the source - The Eligibility agent, as synthesizer, produces a per-criterion Pass/Fail/Uncertain report with explicit source attribution, letting clinicians audit the exact lab result or note that triggered a match.
- Privacy by design, not by policy - Raw patient data - observation facts, note text, genomic files - never crosses agent boundaries; the Notes agent processes narrative text in a hardware-attested secure enclave and emits only structured results like an ECOG integer or confidence score.
- Determinism as a launch requirement - The system targets bit-identical outputs for any given protocol version and data snapshot - reproducibility treated as a core design requirement, not an operational nice-to-have.
CAPABILITIES DELIVERED
Each agent owns a distinct data domain, with capabilities scoped to what that domain requires.
CAPABILITY | WHAT IT DOES |
|---|---|
Protocol Agent | Ingests trial PDFs/DOCX and maps natural language to versioned boolean logic trees using institutional synonym expansion (ICD-10/SNOMED-CT). |
Cohort Agent | Executes read-only SQL against the i2b2 warehouse with ICD parent-code expansion, ensuring no candidates are missed in structured data. |
Genomics Agent | Validates biomarker criteria against VEP/SnpEff tables, handling SNVs, CNVs and indels with recency-window-aware boolean flags. |
Timeline Agent | Performs temporal window evaluation from i2b2 event sequences, enforcing requirements like "progression within 90 days." |
Notes Agent | Extracts unstructured narrative facts (ECOG scores, brain metastasis status) within a hardware-attested secure enclave. |
Eligibility Agent | Synthesizes all upstream outputs into a per-criterion Pass/Fail/Uncertain report with explicit source attribution. |

Figure 3 - Privacy by design: raw PHI never crosses an agent boundary.
Design note Traditional i2b2-only screening leaves a real gap in unstructured narratives and variant-level genomic data. Adding dedicated Notes and Genomics agents specifically bridges that gap - integrating clinical nuance that previously required hours of manual chart review, without compromising the structured-data path's speed.
ENGINEERING FOR SCALE AND RELIABILITY
Five architectural decisions carry the system toward a regulatory and clinical trust bar most matching algorithms never attempt to clear.
Strict DAG topology
Agent dependencies form a directed acyclic graph specifically to enforce isolation - no agent's failure mode can cascade into a domain it doesn't own.
ICD parent-code expansion
The Cohort agent expands parent ICD codes into their child-level concepts (e.g. ICD10:E08-E13) specifically to avoid missing candidates who are coded at a more specific level than the protocol's literal criteria.
Hardware-attested secure enclave processing
Raw narrative text is processed in-place within the Notes agent's secure enclave, with hardware attestation ensuring only structured results - never raw PHI - are emitted across the boundary.
Append-only, immutable audit trail
Every screening run is logged in a way that satisfies 21 CFR Part 11 requirements, supporting the bit-identical reproducibility target the system is designed around.
Gold-standard validation gate before production
Before any production release, results are compared against expert manual review under explicit launch criteria - a false negative rate under 2% and false positive rate under 5% - rather than shipping on internal confidence alone.
DELIVERY APPROACH
The engagement is building the pipeline agent by agent, with the privacy and determinism architecture established before the eligibility synthesis layer.
1. Protocol ingestion & logic mapping - trial document parsing and institutional synonym expansion into versioned boolean logic trees.
2. Cohort agent - read-only i2b2 SQL execution with ICD parent-code expansion.
3. Genomics & Timeline agents - biomarker validation and temporal window evaluation, operating independently in parallel.
4. Notes agent - secure-enclave narrative extraction for unstructured clinical facts.
5. Eligibility synthesis - per-criterion report generation with explicit source attribution.
6. Validation against gold-standard review - accuracy and reproducibility testing against expert manual chart review before production release.
RESULTS AND IMPACT

Figure 4 - Key outcomes from this engagement.
The architecture targets reducing cohort screening from 3-5 days of manual work to under 30 minutes of automated processing per protocol, aimed specifically at capturing near-miss candidates before they age out of eligibility.
The per-criterion, source-attributed output format gives clinicians an auditable basis for trusting - and verifying - every match, rather than a black-box score.
What it enabled commercially
If the platform reaches its 12-month adoption target of 80% of eligible institutional trials, it would shift research sites from reactive, point-in-time manual searches to continuous, proactive surveillance - directly improving the ROI of clinical research recruitment.
WHY PFACTORIAL
This engagement reflects Pfactorial's ability to architect AI systems for domains where explainability and reproducibility are hard requirements, not optional extras - building the privacy and audit architecture in from the start rather than retrofitting it onto a black-box model.

Figure 5 - Service lines this engagement draws on.
Engagement enquiries Pfactorial Technologies works with research institutions and life-sciences organizations that need AI systems built to a clinical and regulatory trust bar. If you're evaluating a clinical trial matching or research informatics initiative, we're happy to give you an honest read on scope and risk before anyone commits to anything. · pfactorial.ai
APPENDIX A - TECHNOLOGY STACK
The technology stack underpinning the system, grouped by the layer it serves.

© 2026 Pfactorial Technologies. Client identity and product-specific implementation detail are withheld or generalized; no client data, credentials, source code, or infrastructure detail is included in this document.
Result and Analysis
ENGAGEMENT SNAPSHOT
How Pfactorial Technologies is building TrialMatch AI, a multi-agent system that screens patients against trial eligibility criteria in minutes instead of days - with every decision source-attributed and every run bit-identically reproducible.
CASE STUDIES
You might also like...

Recruiting & HR TechRAG & Semantic Search
Aug 21, 20267 min readRead

RAG & Semantic SearchFinance & Payments
Architecting an AI-Native Financial Context Engine for Creators
Aug 21, 20269 min readRead

RAG & Semantic Search
Designing a Shared Agentic Knowledge Infrastructure Across Slack, Notion, and Meetings
Aug 21, 20269 min readRead

RAG & Semantic Search
Improving Clinical Trial Matching Accuracy with a Blended Retrieval Pipeline
Aug 21, 20266 min readRead

Multi-Agent & Agentic Systems
Matching Surgical Instrument Inquiries to Catalog Items by Meaning, Not Keywords
Aug 21, 20268 min readRead

RAG & Semantic SearchAutomotive & Vehicle
A Botpress-Built AI Sales & Service Assistant That Qualifies Automotive Leads 24/7
Aug 21, 20267 min readRead





