Personal medical corpus pipeline: install → add PDFs → parse → enrich.
Not medical advice. Organizes your documents locally. Does not diagnose or prescribe.
- Package: install as
medbots-corefrom this repo; CLI command ismedbots. - PDF parsers: built for Russian lab layouts — EMIAS, Medsi, Gemotest. Other vendors need a new parser (docs/ARCHITECTURE.md).
- No OCR: scanned PDFs without a text layer are not parsed unless you add external OCR or optional private LLM ingest.
- OpenClaw / Telegram Q&A: optional VPS deploy (deploy/RUNBOOK.md); not required for local corpus use.
- Try without your PDFs: examples/demo-instance (synthetic
pdf_textonly).
git clone https://github.com/apodobe/biohackbot.git
cd biohackbot
python3 -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .
medbots --helpCreate a private folder for your data (outside this public repo):
medbots init ~/my-healthThis creates:
~/my-health/
├── bot_config.json
├── sources/emias/ ← drop PDFs here
├── sources/medsi/
├── sources/gemotest/
├── sources/apple_health/ ← optional: archived export.zip
└── structured_database/
├── manifest.json
├── PATIENT_PROFILE.json ← set your DOB
├── pdf_text/
├── doc_text/
└── fitness/ ← Apple Health import
Edit PATIENT_PROFILE.json:
{"dob": "1985-06-15", "full_name_ru": "John Smith", "country": "USA"}Copy lab PDFs from EMIAS, Medsi, or Gemotest into the matching sources/ subfolder.
Register them in the manifest:
medbots scan --bot-root ~/my-health
# optional: --source emias --source medsiTwo steps: extract raw text, then parse into structured doc_text/ and lab rows.
medbots extract-text --bot-root ~/my-health
medbots structure --bot-root ~/my-health
# re-parse everything: add --force
# one vendor only: --source emiasSupported vendors: EMIAS, Medsi, Gemotest (Russian lab layouts).
Export from iPhone: Health app → profile → Export All Health Data → export.zip
medbots import-apple-health --zip ~/Downloads/export.zip --bot-root ~/my-health --copy-zip
medbots validate-apple-health --corpus ~/my-health/structured_databaseWrites structured_database/fitness/BODY_METRICS.json, WORKOUTS.json, APPLE_HEALTH_SUMMARY.md. Raw export.xml is not stored — only aggregated JSON.
Normalize labs, apply LOINC map, deduplicate, build indexes:
medbots pipeline --bot-root ~/my-health
medbots validate --corpus ~/my-health/structured_databaseOutput includes LABS_NORMALIZED.json, DISCREPANCIES.json, CORPUS_INDEX.json, and markdown summaries in structured_database/.
Sync text + JSON to a server for a private Q&A bot (no PDF binaries):
export VPS=root@YOUR_HOST
export CORPUS=~/my-health/structured_database
cd deploy && ./02-rsync-corpus.shDetails: deploy/RUNBOOK.md
| Command | Purpose |
|---|---|
medbots init PATH |
Scaffold instance directory |
medbots scan --bot-root PATH |
Add new PDFs from sources/ to manifest |
medbots extract-text --bot-root PATH |
PDF → pdf_text/*.txt |
medbots import-apple-health --zip FILE --bot-root PATH |
Apple Health → fitness/ |
medbots structure --bot-root PATH |
Parse text → doc_text/, lab rows |
medbots pipeline --bot-root PATH |
Merge labs, LOINC, dedup, index |
medbots validate --corpus PATH |
Integrity check |
medbots validate-apple-health --corpus PATH |
Apple Health fitness check |
medbots structure --bot-root examples/demo-instance
medbots pipeline --bot-root examples/demo-instanceSee examples/README.md.
- Keep
~/my-health/local or in a private git repo. - Never commit patient data to this public repository.
- See SECURITY.md.
- Architecture
- Parser guide — how to use every ingest step · RU
- LLM usage — when models are needed, tiers, OpenClaw · RU
- Corpus file schema
- License — MIT, Copyright (c) 2026 Alexey Podobedov
Author: Alexey Podobedov