Parse PDF clinical documents into structured timelines, frequency maps, and AI-labelled clinical entities.
TectoniQ ingests a PDF clinical document (discharge summaries, progress notes, assessments) and runs it through a 3-worker pipeline:
| Worker | Purpose |
|---|---|
| Worker 1 | Extracts text, splits by section headers, tallies term frequency |
| Worker 2 | Maps each term onto a 1D page/section timeline |
| Worker 3 | Pipes top terms through the Gemini API for semantic clinical entity recognition |
The result is rendered in a dark-mode dashboard with:
- Discovery Timeline — terms plotted across document sections
- Keyword Tree — searchable grid of all clinical entities with badges
- Export — structured JSON or XML download
TectoniQ/
├── index.html ← Frontend entry point (open directly in browser)
├── style.css ← Dark glassmorphism design system
├── app.js ← Frontend controller
├── demo/
│ └── sample_patient.json ← Demo fixture (no PDF needed)
├── README.md
├── README_WORKERS.md ← Worker pipeline deep-dive
└── backend/
├── app.py ← Flask server (localhost:5000)
├── requirements.txt
├── .env.example
└── workers/
├── worker1_frequency.py
├── worker2_timeline.py
└── worker3_gemini_ner.py
- Python 3.10+
- A modern browser (Chrome, Firefox, Safari, Edge)
- A Gemini API key (optional — Worker 3 degrades gracefully without one)
git clone <your-repo-url>
cd TectoniQcd backend
# Create and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate # macOS / Linux
# .venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txtcp .env.example .envOpen .env and add your Gemini API key:
GEMINI_API_KEY=your_key_here
Worker 3 will skip Gemini NER and mark terms as
"unreviewed"if the key is missing — the rest of the pipeline still works.
python app.py
# → TectoniQ backend starting on http://localhost:5000Open index.html directly in your browser (no build step required):
open ../index.html # macOS
start ../index.html # Windows
xdg-open ../index.html # LinuxThe sidebar status indicator will turn green once the frontend connects to the backend.
- Upload — drag and drop a PDF, or click Browse
- Timeline — explore terms plotted across sections; click any node for details
- Keywords — search and filter all extracted clinical entities
- Export — toggle JSON / XML, preview the output, download
Click "Load Demo Patient" on the upload screen to see the app populated with a synthetic heart-failure patient case.
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/health |
Backend status + Gemini key check |
POST |
/api/parse |
Upload a PDF; returns structured JSON |
curl -X POST http://localhost:5000/api/parse \
-F "file=@/path/to/your_document.pdf"See README_WORKERS.md for the full output schema and worker contracts.
The frontend is static HTML/CSS/JS — Vercel can serve it directly.
- Push the repo to GitHub
- Connect the repo to Vercel
- Set the Root Directory to
/(or whereverindex.htmllives) - Set Output Directory to
.(no build step) - Update
BACKEND_URLinapp.jsto point to your deployed Python backend URL
The Python backend needs a separate host (e.g., Railway, Render, or Fly.io).
MIT