Hybrid Matching Architecture is a clinical trial screening system design that fuses deterministic rule-based filtering with probabilistic semantic matching to evaluate patient eligibility. It applies strict logical criteria for hard constraints while using vector embeddings to rank patients by semantic similarity to complex, unstructured protocol requirements.
Glossary
Hybrid Matching Architecture

What is Hybrid Matching Architecture?
A system design that combines deterministic rule-based filtering with probabilistic semantic matching to maximize both precision and recall in patient-trial matching.
This architecture mitigates the brittleness of purely rule-based systems and the opacity of purely neural approaches. A rule engine enforces non-negotiable criteria like lab values, while a semantic model scores narrative criteria, producing a ranked cohort with both high precision and high recall.
Key Features of Hybrid Matching Architecture
A clinical trial screening system design that combines deterministic rule-based filtering with probabilistic semantic matching to maximize both precision and recall.
Deterministic Rule Engine
The first-pass filter that applies hard constraints with absolute certainty. This layer handles binary inclusion/exclusion criteria such as:
- Age ranges and sex assignments
- Lab value thresholds (e.g., platelet count > 100,000/μL)
- Concomitant medication exclusions
- Prior therapy washout periods
Rules are compiled from structured eligibility criteria parsing output and executed against normalized patient data. This layer guarantees 100% precision on explicitly defined criteria and eliminates patients who definitively do not qualify before more expensive semantic processing occurs.
Semantic Similarity Matching
The second-pass layer that handles ambiguous or narrative criteria where exact matching fails. This component:
- Converts patient records and trial criteria into dense vector embeddings using domain-adapted language models
- Computes cosine similarity between patient profiles and eligibility requirements
- Identifies patients with conditions that are clinically similar but not identically phrased (e.g., 'renal insufficiency' vs. 'CKD stage 3')
This layer dramatically improves recall by surfacing candidates that a pure rule-based system would miss due to terminology gaps or implicit clinical relationships.
Confidence Scoring & Thresholding
A unified scoring layer that combines outputs from both matching passes into a single, interpretable eligibility score per patient-trial pair. The mechanism:
- Assigns binary pass/fail weights to deterministic rule results
- Converts semantic similarity scores into probabilistic confidence values
- Applies criteria weighting where critical inclusion criteria carry higher importance
- Produces a ranked candidate list with explainable score breakdowns
Thresholds are configurable per trial, allowing study teams to balance precision vs. recall based on recruitment urgency and screen failure tolerance.
Temporal Reasoning Module
A specialized sub-engine that validates time-dependent criteria against longitudinal patient records. This module:
- Reconstructs patient timelines from timestamped clinical events
- Evaluates sequence constraints (e.g., 'progression after platinum-based chemotherapy')
- Validates washout windows and recency requirements
- Handles relative time expressions like 'within 6 months of screening'
Integrates with both deterministic rules for exact date math and semantic matching for fuzzy temporal expressions found in unstructured criteria text.
Ontology-Backed Normalization Layer
A preprocessing pipeline that harmonizes disparate clinical terminologies before matching occurs. This layer:
- Maps local lab codes to LOINC standards
- Normalizes drug names to RxNorm concepts
- Aligns diagnoses across ICD-10-CM and SNOMED CT
- Resolves unit-of-measure discrepancies (e.g., mg/dL vs. mmol/L)
By normalizing both patient data and parsed trial criteria to common ontologies, the architecture eliminates false negatives caused by coding system mismatches and enables cross-institutional screening across heterogeneous EHR systems.
Protocol Amendment Adaptation
An automated monitoring system that detects and integrates protocol amendments into the active screening logic without manual reconfiguration. Capabilities include:
- Version comparison of structured eligibility criteria
- Identification of added, removed, or modified constraints
- Automatic recompilation of rule sets and re-indexing of semantic embeddings
- Flagging of previously screened patients for re-evaluation under amended criteria
This ensures screening accuracy persists across the trial lifecycle, preventing the common problem of sites using outdated eligibility logic after protocol revisions.
Frequently Asked Questions
Explore the core concepts behind clinical trial screening systems that combine deterministic rule-based filtering with probabilistic semantic matching to maximize both precision and recall in patient recruitment.
A Hybrid Matching Architecture is a clinical trial screening system design that combines two distinct computational approaches: deterministic rule-based filtering and probabilistic semantic matching. The rule-based component applies strict, Boolean logic to structured data fields—such as lab values, demographics, and coded diagnoses—to enforce absolute inclusion and exclusion criteria with 100% precision. The semantic component uses vector embeddings and natural language processing to evaluate unstructured clinical narratives against free-text eligibility criteria, identifying patients whose records contain conceptually similar but not identically worded conditions. This dual-layer approach ensures that no eligible patient is missed due to rigid keyword matching while maintaining the regulatory compliance required for protocol adherence. The architecture typically routes a patient profile through the deterministic filter first to eliminate clear non-matches, then applies the semantic layer to rank remaining candidates by relevance score.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
The hybrid matching architecture relies on a stack of specialized components to transform raw patient data and trial criteria into an actionable eligibility decision. Each term below represents a critical module in this pipeline.
Deterministic Rule Engine
The rule-based filtering layer that applies hard constraints to eliminate patients who definitively fail binary criteria. This engine evaluates structured data against explicit thresholds—such as lab values, age ranges, or genomic markers—with zero ambiguity.
- Operates on structured, normalized data from FHIR resources or OMOP CDM
- Executes Boolean logic (AND/OR/NOT) against atomic criteria
- Guarantees 100% precision on exclusionary rules
- Handles concomitant medication checking and allergy cross-referencing
- Typically implemented via Drools, Red Hat Decision Manager, or custom SQL-based evaluators
Semantic Vector Matching
The probabilistic layer that computes similarity between a patient's clinical narrative and trial criteria using dense vector embeddings. This component handles the ambiguity of natural language, matching concepts like 'uncontrolled hypertension' to specific blood pressure patterns in unstructured notes.
- Uses transformer-based encoders (e.g., ClinicalBERT, PubMedBERT) to generate embeddings
- Performs cosine similarity or dot-product scoring between patient and criteria vectors
- Enables fuzzy matching for synonymous conditions and gradable findings
- Powers patient vector embedding for nearest-neighbor search across trial databases
- Typically backed by vector databases like Pinecone, Weaviate, or pgvector
Criteria Decomposition Pipeline
The preprocessing stage that breaks complex free-text eligibility criteria into atomic, machine-evaluable units. A single paragraph like 'Patients must have failed at least 2 prior lines of therapy, with ECOG 0-1, and no active CNS metastases' becomes multiple discrete logical clauses.
- Combines medical NER with syntactic dependency parsing
- Identifies temporal constraints (e.g., 'within 28 days of enrollment')
- Classifies each atomic criterion as inclusion or exclusion
- Routes binary criteria to the rule engine and narrative criteria to the semantic matcher
- Outputs a structured criteria graph for downstream execution
Confidence-Weighted Fusion Layer
The decision integration module that combines outputs from the deterministic and probabilistic paths into a single eligibility score. This layer applies calibrated weights based on each component's confidence, ensuring that a high semantic match does not override a hard exclusion.
- Implements a weighted scoring function:
FinalScore = (w1 × RuleScore) + (w2 × SemanticScore) - Applies hard override logic for deterministic failures regardless of semantic score
- Uses calibrated confidence thresholds to flag borderline cases for human review
- Generates explainable audit trails showing which criteria contributed to the final decision
- Enables human-in-the-loop review for cases falling in the uncertainty band
Temporal Reasoning Engine
The specialized module that validates time-dependent constraints against a patient's longitudinal record. This engine interprets criteria like 'no chemotherapy within 4 weeks of enrollment' by reconstructing the patient's clinical timeline and checking event sequencing.
- Performs clinical event sequencing from timestamped EHR data
- Validates washout periods, disease progression timelines, and recency requirements
- Handles relative time expressions (e.g., 'within 6 months of diagnosis')
- Integrates with patient timeline reconstruction pipelines
- Uses Allen's interval algebra for complex temporal logic resolution
Criteria-to-Query Translator
The bridge component that converts structured eligibility criteria into executable database queries against clinical data warehouses. This translator generates FHIR API calls, SQL statements, or OMOP CDM queries to retrieve candidate patient cohorts.
- Maps parsed criteria to standardized terminologies (SNOMED CT, LOINC, RxNorm)
- Generates parameterized queries for EHR and claims databases
- Supports bulk FHIR export and CDS Hooks integration patterns
- Enables site feasibility assessment by executing queries across multiple data sources
- Implements query optimization for large-scale patient repositories

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us