Openbtk¶
The open-source layer between biomedical data and modern AI.
Openbtk turns clinical text into model-ready, de-identified, auditable inputs — de-identification you can audit and benchmark, and run provenance every pipeline execution emits automatically. It runs on your laptop or behind your firewall, works with any LLM provider, and streams corpora far larger than memory.
Status: v0.7 — pre-1.0, real, and honestly scoped
Milestones M1–M10 and most of M11 are built, tested, and released: core
framework, de-identification, clinical text, EHR loading, providers and
retrieval, guardrails and terminology, benchmarks, LangChain interop, the CLI,
clinical-QA and groundedness evaluation, an API freeze, a security review, and
twelve further v1.0 requirements. pip install openbtk gives you 0.7.0. See
Quick start. v1.0 itself is not yet claimed -- see the
CHANGELOG
for what remains and why.
The i2b2/n2c2 benchmark has not been run
The harness exists and is tested, but that corpus is Data-Use-Agreement-restricted. The published figures are on a synthetic corpus, and the default recognizer does not detect names. See Benchmarks.
Why¶
Building a clinical RAG pipeline means weeks of undifferentiated plumbing: a note parser, a PHI de-identifier that actually catches MRNs, chunking that doesn't split the Assessment from the Plan, and an audit trail you'll be asked for later. Every team rebuilds it. Most get de-identification wrong, or pay a vendor.
Nothing open-source addresses the two things that actually gate deployment: is the PHI really gone, and can you prove what happened. Those two are what Openbtk is for.
What's built¶
- A registry-driven component framework — loaders, preprocessors,
chunkers, guardrails and more, addressed by a permanent string key
(
<category>.<scope>.<name>), config-driven rather than import-driven. - De-identification you can audit and benchmark — a rule-based recognizer plus an optional spaCy-based NER recognizer, combined by an ensemble with checked-in, measured F1 numbers (0.933 default, 0.922 with the full ensemble).
- A clinical text modality — loaders, section segmentation, and section-aware chunking that never splits mid-section.
- A streaming pipeline executor with real provenance — every run emits
a
RunManifest: per-step record counts, component identity, guardrail outcomes, and a content digest for each input source. - Streaming, not in-memory — 10,000,000 synthetic notes streamed through the full four-stage pipeline at 0.074 GB peak RSS, measured.
- EHR loading — FHIR R4 and OMOP into one
PatientRecordschema, with timelines, cohorts, and a serializer bridging EHR to clinical text. - Providers and retrieval — LLM and embedding providers behind one interface with an off-site policy guard; FAISS, Chroma and Qdrant stores; concept reranking; a RAG pipeline with source provenance.
- Guardrails and terminology — PHI-leakage, terminology, groundedness and EHR checks; a terminology service with a bundled ICD-10-CM subset.
- Evaluation and interop — reproducible benchmarks, retrieval metrics, and an optional LangChain / LangGraph adapter.
See the project README and CHANGELOG for the full, dated record of what has shipped.
Where to go next¶
- Quick start — install and run a real pipeline.
- Tutorials — eight notebooks, run offline and executed in CI.
- Guides — clinical text, de-identification, EHR, evaluation, the command line and LangChain. Every code example on them is executed by a test.
- Benchmarks — every published number, how to reproduce it, and what has not been measured.
- API reference — generated from the source docstrings, so it never claims more than what actually ships.