╔╦╗╔═╗╔╦╗╦╔╦╗╦═╗╔═╗╔═╗╦╔═
║║║║╣ ║║║ ║ ╠╦╝╠═╣║ ╠╩╗
╩ ╩╚═╝═╩╝╩ ╩ ╩╚═╩ ╩╚═╝╩ ╩
Vector-Database AI-Powered Medical Timeline System
Healthcare records that actually follow the patient — not the hospital.
MediTrack is a full-stack, AI-powered medical timeline system that lets patients own their health history across every hospital, clinic, and specialist they visit. Every event gets semantically embedded into a vector database, so when you ask about your care history, the system understands what you mean — not just what you typed.
One patient. One ID. Every record. Everywhere.
Healthcare is fragmented. You visit City Hospital, then County Emergency, then your specialist across town. Each institution has its own siloed records. You, the patient, are left carrying printed PDFs in a folder.
MediTrack fixes this with a globally unique Patient ID (MED-XXXXXXXX) that travels with you. All events — voice-dictated notes, uploaded lab reports, typed summaries — are stored in a single semantic timeline that any authorized provider can view through a shareable read-only link.
Dictate clinical notes hands-free using the browser's Web Speech API. Real-time transcription. Zero backend processing. Works in Chrome and Edge today.
Built on Qdrant with 384-dimensional FastEmbed vectors and cosine similarity. Searching "heart problem" will surface entries for "myocardial infarction," "MI," and "cardiac event" — because it understands meaning, not just keywords.
Groq's Llama 3.3 70B (fastest inference available at ~500 tokens/sec) reads your entire timeline and produces a professional clinical summary — patterns, gaps, visit frequency — without ever making a diagnosis or treatment suggestion.
ReportLab-generated reports styled with hospital letterhead formatting. Includes a complete event table with dates, types, and content. Print-ready for specialist referrals, insurance claims, or legal documentation.
Every patient gets a public read-only URL (/patient/MED-XXXXXXXX). Share with your cardiologist before your appointment. No login required to view. No ability to edit.
Drag-and-drop lab reports, imaging results, or discharge summaries. Files persist on disk with UUID-named storage. Full download access from the timeline at any time.
Eye-friendly interface with full dark/light toggle. Designed for late-night ER nurses and 6 AM rounds.
┌─────────────────────────────────────────────────────────────┐
│ Browser (Vanilla JS + Tailwind) │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │
│ │ index.html │ │patient_view │ │ app.js │ │
│ │ (main UI) │ │ (read-only) │ │ (API client) │ │
│ └──────────────┘ └──────────────┘ └──────────────────┘ │
└─────────────────────────────┬───────────────────────────────┘
│ HTTP/REST
┌─────────────────────────────▼───────────────────────────────┐
│ Flask Backend (app.py) │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │
│ │ Auth Layer │ │ API Routes │ │ PDF Generator │ │
│ │ (bcrypt + │ │ (ingest, │ │ (ReportLab) │ │
│ │ Flask-Login)│ │ timeline, │ │ │ │
│ └──────────────┘ │ export) │ └──────────────────┘ │
│ └──────┬───────┘ │
└────────────────────────────┼────────────────────────────────┘
│
┌───────────────────┼───────────────────┐
│ │ │
┌────────▼────────┐ ┌───────▼───────┐ ┌───────▼────────┐
│ Qdrant │ │ FastEmbed │ │ Groq Llama │
│ (Vector DB) │ │ (Embeddings │ │ 3.3 70B │
│ 384-dim cosine │ │ 384-dim CPU) │ │ (AI Analysis) │
└─────────────────┘ └───────────────┘ └────────────────┘
Backend
- Flask — Python web framework
- Qdrant — Vector database (cloud or local)
- FastEmbed — CPU-only 384-dim text embeddings
- Groq — LLM inference (Llama 3.3 70B)
- ReportLab — PDF generation
- bcrypt + Flask-Login — Auth
Frontend
- Vanilla JavaScript — no framework overhead
- Tailwind CSS — utility-first styling
- Web Speech API — browser-native voice input
- Drag & Drop API — native file handling
meditrack/
├── app.py # Flask backend — all routes and business logic
├── requirements.txt # Python dependencies
├── .env # Environment variables (never commit this)
├── static/
│ ├── index.html # Main application UI
│ ├── patient_view.html # Public patient timeline (read-only)
│ └── app.js # Frontend JavaScript
├── uploads/ # Uploaded documents (auto-created on first run)
├── README.md # This file
├── CONTRIBUTING.md # How to contribute
├── SECURITY.md # Vulnerability disclosure policy
└── TROUBLESHOOTING.md # Debug guide
- Python 3.8–3.13 (3.11 recommended)
- A Qdrant account (free tier works)
- A Groq API key (free tier: 14,400 req/day)
# 1. Clone
git clone https://github.com/your-org/meditrack.git
cd meditrack
# 2. Virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# 3. Dependencies
pip install -r requirements.txt
# 4. Environment variables
cp .env.example .env
# Edit .env with your credentials (see below)
# 5. Run
python app.py
# → http://localhost:5000Create a .env file in the project root:
# Qdrant Vector Database
QDRANT_URL=https://your-cluster.cloud.qdrant.io:6333
QDRANT_API_KEY=your_qdrant_api_key
# Groq AI
GROQ_API_KEY=gsk_your_groq_api_key
# Flask session security (generate once, keep secret)
SECRET_KEY=run: python -c "import secrets; print(secrets.token_hex(32))"
⚠️ Never commit your.envfile. It's already in.gitignore.
- Open
http://localhost:5000 - Click Sign In → Create Account
- Enter your name, hospital, email, and password
- You'll receive a Patient ID like
MED-A1B2C3D4 - Start adding events — voice, text, or file upload
| Method | Endpoint | Description |
|---|---|---|
POST |
/register |
Create a new patient account |
POST |
/login |
Authenticate and start session |
POST |
/logout |
End session |
GET |
/me |
Get current user info |
POST |
/update-profile |
Update patient profile fields |
| Method | Endpoint | Description |
|---|---|---|
POST |
/ingest |
Add a text-based medical event |
POST |
/upload-document |
Upload a file with optional notes |
GET |
/download-document/<filename> |
Download an uploaded document |
POST |
/timeline-summary |
Fetch full timeline + AI analysis |
POST |
/export-pdf |
Generate and download PDF report |
| Method | Endpoint | Description |
|---|---|---|
GET |
/patient/<id> |
Read-only public timeline view |
GET |
/health |
Component health check |
GET |
/api/status |
Detailed system status |
MediTrack uses two layers of AI:
Layer 1 — Semantic Embeddings (FastEmbed) When you save a medical event, the text is converted into a 384-dimensional vector and stored in Qdrant. This enables semantic search — queries find conceptually related records, not just exact keyword matches.
Layer 2 — LLM Summary (Groq Llama 3.3 70B) When you request a timeline analysis, all your events are assembled into a structured prompt and sent to Llama 3.3 70B. The model produces a professional clinical narrative describing patterns, visit frequency, and temporal gaps.
What the AI explicitly does NOT do:
- Diagnose conditions
- Suggest treatments or medications
- Perform clinical inference between events
- Replace healthcare professionals
All outputs are clearly labeled as information summaries, not clinical recommendations.
python app.py
# → http://localhost:5000 with debug mode enabledpip install gunicorn
gunicorn app:app --bind 0.0.0.0:8000 --workers 4 --timeout 120nginx config:
server {
listen 80;
server_name yourdomain.com;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 5000
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:5000", "--workers", "4", "--timeout", "120"]docker build -t meditrack .
docker run -p 5000:5000 --env-file .env meditrack- Connect repo to Render
- Set build command:
pip install -r requirements.txt - Set start command:
gunicorn app:app - Add environment variables in Render's dashboard
- Done — live at your Render URL
| Feature | Chrome | Edge | Safari | Firefox |
|---|---|---|---|---|
| Core app | ✅ | ✅ | ✅ | ✅ |
| Voice input | ✅ | ✅ | ❌ | |
| File upload | ✅ | ✅ | ✅ | ✅ |
| PDF export | ✅ | ✅ | ✅ | ✅ |
| Dark mode | ✅ | ✅ | ✅ | ✅ |
Voice input requires HTTPS in production. Works on localhost without HTTPS for development.
The following are intentionally out of scope for the current version:
- Causal inference between events (e.g., "medication X caused lab result Y")
- Role-based access control (RBAC) and audit logging
- HIPAA/GDPR compliance layers
- Image or audio semantic embeddings (text and documents only)
- Persistent sessions across server restarts (in-memory user store)
- Patient ID revocation / link invalidation
See CONTRIBUTING.md if you want to help build any of these.
MediTrack is an information retrieval and summarization system, not a diagnostic or clinical decision-support tool. All AI-generated outputs are derived strictly from stored patient events and are intended to assist human understanding, not replace professional medical judgment.
Always consult a licensed healthcare provider for medical decisions.
MIT — free to use, modify, and distribute. See LICENSE.
Built for patients who deserve to own their own story.
Live Demo · Report a Bug · Request a Feature · Security Policy