MedKit is a high-performance, unified SDK that transforms fragmented medical APIs into a single, programmable platform. It provides a clean interface for OpenFDA, PubMed, and ClinicalTrials.gov, augmented with a clinical intelligence layer and relationship mapping.
Important
v2.0.0 Release: This version introduces a fully asynchronous architecture, robust ClinicalTrials.gov v2 integration with automatic curl fallback, and enhanced clinical synthesis precision.
import asyncio
from medkit import AsyncMedKit
async def main():
async with AsyncMedKit() as med:
# Unified search across all providers in parallel
results = await med.search("pembrolizumab")
print(f"Drugs found: {len(results.drugs)}")
print(f"Clinical Trials: {len(results.trials)}")
# Get a synthesized conclusion
conclusion = await med.ask("What is the clinical status of Pembrolizumab for NSCLC?")
print(f"Summary: {conclusion.summary}")
print(f"Confidence: {conclusion.confidence_score}")
asyncio.run(main())| Feature | Without MedKit | With MedKit |
|---|---|---|
| Integrations | 3 separate APIs / SDKs | Unified Sync/Async Client |
| Resilience | 403 blocks from gov APIs | Auto-Fallback (Curl/v2 API) |
| Synthesis | Alphabetical/Noisy lists | Frequency-Ranked Intervals |
| Logic | Manual data correlation | Native knowledge graphs |
| Speed | Sequential network calls | Parallel Async Orchestration |
MedKit abstracts complexity through a high-performance orchestration layer:
Developer / User
│
▼
┌───────────────────┐
│ MedKit / Async │ (Unified Interface)
└─────────┬─────────┘
│
┌─────────┴─────────────────────┐
│ Intelligence Layer │
│ ├─ Ask Engine (Extraction) │
│ ├─ Graph Engine (Context) │
│ ├─ Interaction Engine │
│ └─ Synthesis Engine (Ranked) │
└─────────┬─────────────────────┘
│
┌─────────┴─────────────────────┐
│ Providers Layer │
│ ├─ OpenFDA (Drug Label) │
│ ├─ PubMed (Research) │
│ └─ ClinTrials (v2 + Fallback)│
└───────────────────────────────┘
- Robust Connectivity (NEW): Automatic
curlfallback for ClinicalTrials.gov bypasses TLS fingerprinting blocks, ensuring 100% data availability. - Async-First Orchestration: Parallel health checks and search execution eliminate latency bottlenecks and perceived "hangs."
- Precision Evidence Synthesis: Automated clinical verdicts with frequency-ranked interventions and filtered therapeutic agents (Drugs/Biologicals).
- High-Performance CLI: Interactive, list-based visualization for trials and research papers, optimized for all terminal sizes.
- Natural Language Extraction: Robust regex-based term extraction handles typos and complex query structures (e.g., "clinial status of...").
- Unified Caching: Enhanced Disk and Memory caching (with Pydantic support) for high-performance repeat queries.
pip install medkit-sdk$ medkit ask "pembrolizumab for lung cancer"
Clinical Conclusion
Summary: Highly-validated therapeutic landscape with multi-modal evidence.
Confidence: ████████████████████ 1.00
Top Interventions: Pembrolizumab, Bevacizumab, Carboplatin, Cisplatin$ medkit trials "melanoma" --limit 5
Clinical Trials for 'melanoma'
- NCT01234567: RECRUITING - Study of Pembrolizumab in Advanced Melanoma
- NCT07654321: COMPLETED - Comparison of B-Raf Inhibitors- v1.0.0: Foundation medical mesh and provider integration.
- v2.0.0: Async architecture, v2 API support, and synthesis precision.
- v2.1.0: Advanced pharmacogenomics (SNP) provider integration.
- v3.0.0: Local GraphQL medical mesh endpoint.
MIT License - see LICENSE for details.
