File size: 2,417 Bytes
7915030
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
title: TrialPath
emoji: πŸ₯
sdk: docker
app_port: 7860
colorFrom: blue
colorTo: purple
---

# TrialPath πŸ₯

AI-powered clinical trial matching system for NSCLC (Non-Small Cell Lung Cancer) patients.

## Overview

TrialPath helps patients understand which clinical trials they may qualify for by:
- Extracting patient information from medical documents using AI
- Matching patients to relevant clinical trials from ClinicalTrials.gov
- Providing gap analysis to transform "rejection" into actionable next steps
- Offering a clear patient journey with 5 guided steps

## Features

βœ… **Multi-modal Document Upload** - Upload medical records, pathology reports, and lab results (PDF, images)
βœ… **AI-Powered Extraction** - MedGemma 4B extracts structured patient profiles from unstructured documents
βœ… **Smart Trial Matching** - Searches ClinicalTrials.gov with semantic understanding of eligibility criteria
βœ… **Gap Analysis** - Identifies what's missing for trial eligibility and suggests next steps
βœ… **Privacy-First** - No data storage, all processing in-session

## Tech Stack

- **Frontend**: Streamlit (Python)
- **AI Models**:
  - Google Gemini 3 Pro (orchestration & planning)
  - MedGemma 4B (medical document extraction)
- **Data Source**: ClinicalTrials.gov API v2
- **Workflow Engine**: Parlant (agentic framework)

## Current Status

🚧 **Proof of Concept** - Models and UI are functional with mock data. Live AI integrations in progress.

- βœ… UI: 5-page patient journey implemented
- βœ… Data Models: 5 Pydantic v2 contracts (PatientProfile, SearchAnchors, TrialCandidate, etc.)
- βœ… Services: MedGemma, Gemini, ClinicalTrials API clients ready
- 🚧 Agent: Parlant journey orchestration pending
- 🎯 Scope: NSCLC only, synthetic patients (no real PHI)

## Demo Mode

The app runs in demo mode by default with synthetic patient data. To enable full AI features:

1. Set `GEMINI_API_KEY` in Hugging Face Space secrets
2. (Optional) Set `MEDGEMMA_ENDPOINT_URL` for MedGemma extraction
3. (Optional) Set `HF_TOKEN` for Hugging Face authentication

## Local Development

```bash
# Install dependencies
pip install -r requirements.txt

# Run the app
streamlit run streamlit_app.py
```

## License

MIT License - See LICENSE file for details

## Contact

For questions or feedback, please open an issue on GitHub.

---

Built with ❀️ for patients navigating clinical trial enrollment