Skip to main content

Evidence-Based Clinical Reasoning for AI Agents — deterministic calculators, clinical guidelines, and MCP tools backed by DOI-traceable evidence.

Project description

Open Medicine

Evidence-Based Clinical Reasoning for AI Agents

PyPI Python License: MIT

Open Medicine is an open-source Python library that provides deterministic, DOI-traceable clinical reasoning for AI agents. Every calculator, score, and guideline returns its scientific source — eliminating hallucinated clinical advice.

Install

pip install open-medicine

Quick Start

Clinical Calculators

from open_medicine.mcp.calculators.chadsvasc import calculate_chadsvasc, CHADSVAScParams

result = calculate_chadsvasc(CHADSVAScParams(
    age=72,
    hypertension=True,
    diabetes=False,
    congestive_heart_failure=False,
    stroke_tia_thromboembolism=True,
    vascular_disease=False,
    female_sex=False
))

print(result.value)             # 4
print(result.interpretation)    # "CHA2DS2-VASc score is 4. High risk..."
print(result.evidence.source_doi)  # "10.1161/CIR.0000000000001193"

Guideline Retrieval

from open_medicine.mcp.guideline_engine import search_guidelines, retrieve_guideline

# Search by topic
matches = search_guidelines("atrial fibrillation anticoagulation")
# → [{"guideline_id": "acc_aha_af_2023", "title": "...", "doi": "...", ...}]

# Retrieve specific section
result = retrieve_guideline("acc_aha_af_2023", "anticoagulation")
print(result.interpretation)     # Full curated guideline text
print(result.evidence.source_doi)  # "10.1161/CIR.0000000000001193"

MCP Server (for AI Agents)

open-medicine-mcp

Exposes 4 meta-tools via the Model Context Protocol:

Tool Purpose
search_clinical_calculators Find calculators by keyword
execute_clinical_calculator Run a calculator with validated parameters
search_guidelines Find guideline sections by topic
retrieve_guideline Retrieve curated guideline content

Available Calculators

Calculator Clinical Use Evidence
CHA₂DS₂-VASc AF stroke risk ACC/AHA 2023
HAS-BLED AF bleeding risk Pisters 2010
ASCVD 10-year CV risk ACC/AHA 2013
SOFA Organ failure (ICU) Vincent 1996
CURB-65 Pneumonia severity Lim 2003
GCS Brain injury severity Teasdale 1974
CKD-EPI Kidney function (eGFR) NEJM 2021
Cockcroft-Gault Creatinine clearance Cockcroft 1976
Rivaroxaban Dosing Renal dose adjustment FDA Label
Enoxaparin Dosing Renal dose adjustment FDA Label

Available Guidelines

Guideline Sections DOI
ACC/AHA AF 2023 anticoagulation, rate_control, rhythm_control 10.1161/CIR.0000000000001193
KDIGO CKD 2024 evaluation, staging, referral 10.1016/j.kint.2023.10.018
BTS CAP 2009 severity_assessment, antibiotic_therapy, discharge 10.1136/thx.2009.121434

Design Principles

  • Deterministic: Same input → same output. No LLM calls, no randomness.
  • Evidence-Backed: Every ClinicalResult includes a source_doi and evidence level.
  • FHIR-Compatible: Outputs include LOINC codes for direct integration with EHR systems.
  • Strictly Typed: Pydantic models validate all clinical inputs at the boundary.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open_medicine-0.1.0.tar.gz (105.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_medicine-0.1.0-py3-none-any.whl (36.5 kB view details)

Uploaded Python 3

File details

Details for the file open_medicine-0.1.0.tar.gz.

File metadata

  • Download URL: open_medicine-0.1.0.tar.gz
  • Upload date:
  • Size: 105.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.17

File hashes

Hashes for open_medicine-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fe24441f88ce59327da46e59d3535468416eb31ca9c1f4bf15fc27b2f206378f
MD5 fb43e9fbc4e8c0c77f8b878b6adcbdc5
BLAKE2b-256 f4fa40ef93c689f8966fd5938e0f5e6f3f8b2a9271e4d1ac7262afe40feef3f8

See more details on using hashes here.

File details

Details for the file open_medicine-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for open_medicine-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa249821374df57e5142b991ca609165f5fd9025f57f7ad21f5c50461dcf78e7
MD5 d5378e9367e04a25a7958469319299e1
BLAKE2b-256 f9c04834d9349722ff1c1c5495662af1371a390d304e62fc1141884f1b0db356

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page