Find clinical trials that match your health profile.
TrialBridge helps volunteers and patients discover experimental treatments and clinical trials suited to their medical condition, age, location, and health history. Using AI-powered semantic search and eligibility reasoning, TrialBridge matches you with relevant clinical trials from ClinicalTrials.gov in seconds.
- You describe your condition, age, sex, location, and clinical notes
- AI searches 10,000+ clinical trials using semantic embeddings
- AI reasons about your eligibility using language models
- You get ranked trial matches with fit scores and eligibility explanations
- FastAPI — REST API server with CORS support
- FAISS — Vector similarity search (HNSW index with L2 distance)
- Qwen Embeddings — Semantic text embeddings (Qwen/Qwen3-Embedding-8B)
- Gemma LLM — Eligibility reasoning & scoring (google/gemma-3-27b-it)
- React — Component-based UI
- Vite — Fast build tool and dev server
- ClinicalTrials.gov API — Live clinical trial data
- JSONL — Streaming data format for efficient processing
- Text chunking & normalization — Prepare trials for embedding
- Uvicorn — ASGI server for FastAPI
- backend/main.py — FastAPI
/matchendpoint - backend/matching_engine.py — FAISS vector search over embeddings
- backend/reasoning.py — Qwen embeddings + Gemma eligibility reasoning
- data/Fetch_Clinic_Data.py — Fetch trials from ClinicalTrials.gov API
- data/Normalize_Data.py — Normalize, chunk, embed, and build FAISS index
- frontend/react — Vite/React UI with responsive design
- tests/test_api.py — API testing harness
- Python env
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
- Environment (.env at repo root)
Configure .env based on .env.example template to include API keys and other settings
- Data prep
cd data
python Fetch_Clinic_Data.py # writes trials.jsonl
python Normalize_Data.py # builds data/cache/index.faiss + metadata.jsonl
- Run backend
uvicorn backend.main:app --reload --port 8000
- Run frontend (new shell)
cd frontend/react
npm install
npm run dev
- POST
/match?top_k=5&nearby_only=false&proximity_boost=0
Payload:
{
"condition": "Type 2 Diabetes",
"age": 55,
"sex": "M",
"notes": "HbA1c 8.1, on metformin",
"location": "Boston, Massachusetts, United States"
}
Response: { "results": [ { nct_id, title, status, locations, fit_score, eligibility, explanation } ] }
- Use
127.0.0.1instead oflocalhostif you hit hostname issues. - Ensure
.envis loaded; missing keys fall back to a neutral “Possibly eligible” response. - Re-run
Normalize_Data.pyif you refresh trials data or embeddings.
