DocTalk helps patients and caregivers understand medical notes in calmer, clearer language. Users can paste a note, see highlighted terms in context, and read a plain-English summary.
Medical notes are often dense and stressful to read. DocTalk is designed to reduce cognitive load, especially for older adults and caregivers preparing for appointments or follow-up calls.
- Detect medical terms from a seeded glossary and aliases
- Detect acronym mentions and mark ambiguous acronym cases
- Detect common units/measurements in note text
- Mark likely negated findings (e.g., "no mention of pneumonia")
- Produce a deterministic plain-English summary
- Optionally improve summary wording via OpenRouter LLM (safely gated, fallback-first)
- Frontend tuned for accessibility-first reading and low-stress interaction
web/- Next.js frontend (/main experience)api/- FastAPI backend (/api/v1/*routes).github/workflows/ci.yml- basic API + web CI checksMakefile- optional shortcuts (make help)
- Python 3.10+ (3.11 recommended)
- Node 20+
- Postgres (local) for dictionary-backed detection data
cd api
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -e .Create .env from the example:
cp .env.example .envInitialize and seed the dictionary data:
python -m app.db.repo init
python -m app.db.repo seedRun API:
uvicorn app.main:app --reload --port 8000cd web
npm install
npm run devFrontend runs on http://localhost:3000 and calls API at http://localhost:8000.
Backend env variables (api/.env):
DATABASE_URL- required for dictionary reads/seedsCORS_ORIGINS- allowed frontend origin(s), default local devLOG_LEVEL- logging verbosityOPENROUTER_API_KEY- optional, only used when LLM is enabledOPENROUTER_MODEL- optional model overrideDOCTALK_ENABLE_LLM- optional feature gate for LLM summary (true/false)
/api/v1/simplify is always deterministic-first:
- Build deterministic baseline summary
- If
DOCTALK_ENABLE_LLM=trueand API key exists, attempt OpenRouter summary - Validate LLM output (fail closed on unsafe/meta output)
- Fallback to deterministic baseline on any failure
This keeps the endpoint reliable and schema-compatible.
Backend tests (contract + quality eval + LLM safety):
cd api
python -m pytest -qFrom the repo root you can also run make api-test (see make help).
Quality eval docs:
api/tests/README_quality_eval.md
GET /api/v1/healthPOST /api/v1/detectPOST /api/v1/simplify
- Detection quality depends on seeded glossary/acronym/unit dictionaries
- Negation handling is heuristic (rule-based, not full clinical NLP)
- Optional LLM output quality depends on provider/model and is intentionally guarded by fallback logic
- Start API on port
8000(e.g.make api-runafter setup) - Start web app on port
3000(e.g.make web-run) - Paste sample medical text in the UI
- Verify:
- highlights + term explanations
- plain-English summary
- copy/download actions
- Run
python -m pytest -qinapi/for regression checks