Skip to main content

Clinical reasoning agent powered by OpenMedicine — fangs of the healing serpent

Project description

Fangbot

PyPI version Python 3.10+ License: MIT CI

Clinical reasoning agent powered by OpenMedicine — fangs of the healing serpent.

This is NOT a diagnostic tool — it is a research platform for validating LLM-based clinical tool orchestration.

What it does

Fangbot connects to the OpenMedicine MCP server to perform deterministic, auditable clinical calculations via a ReAct (Reasoning + Acting) loop. It supports multiple LLM providers for benchmarking.

Critical constraint: The agent always calls OpenMedicine's MCP tools for clinical calculations — it never computes scores from its own knowledge.

Install

# Recommended: install as a global CLI tool
pipx install fangbot

# Or with uv
uv tool install fangbot

# With OpenAI support
pipx install "fangbot[openai]"

Quick start

# Interactive setup — configure provider, API key, test MCP connection
fangbot init

# Start a clinical reasoning session
fangbot chat

Usage

fangbot init                          # First-time setup wizard
fangbot chat                          # Interactive clinical reasoning session
fangbot run studies/chadsvasc/config.yaml   # Batch evaluation against gold standard cases
fangbot report studies/chadsvasc/results/   # Generate cross-provider comparison report

Chat commands

Inside fangbot chat, use slash commands:

Command Description
/help Show all commands
/status Current provider, model, session info
/claude [model] Switch to Claude
/openai [model] Switch to OpenAI
/model [name] Interactive model picker
/models List all available models
/clear Clear conversation history
/history Show message count and tool calls
/compact Compress conversation history
quit End the session

Configuration

Fangbot stores config in ~/.fangbot/:

~/.fangbot/
├── .env          # API keys and settings
└── logs/         # JSONL audit trail

Environment variables (prefix FANGBOT_):

Variable Default Description
FANGBOT_PROVIDER claude LLM provider (claude, openai)
FANGBOT_MODEL claude-sonnet-4-20250514 Model to use
ANTHROPIC_API_KEY Anthropic API key
OPENAI_API_KEY OpenAI API key

Supported providers

Provider Models Status
Anthropic Claude Opus 4.6, Sonnet 4.6, Haiku 4.5, Sonnet 4, Opus 4 Supported
OpenAI GPT-5, GPT-4o, GPT-4.1, o3, o4-mini Supported
Google Gemini Planned
Ollama (local) Planned

Architecture

Gateway (CLI) → Brain (ReAct loop) → Skills (MCP tools) → Memory (audit trail)
                                                        → Evaluation (batch runner, metrics, reports)
  • Gateway — CLI interface with typer + rich
  • Brain — ReAct loop engine, LLM providers, clinical guardrails
  • Skills — MCP client connecting to OpenMedicine server via stdio
  • Memory — Session context, JSONL audit logger
  • Evaluation — Batch runner, gold standard comparison, metrics engine, Markdown report generator

Evaluation

Fangbot includes a batch evaluation framework for benchmarking LLM providers against gold standard clinical cases.

# Run all CHA2DS2-VASc cases through the agent
fangbot run studies/chadsvasc/config.yaml

# Generate a comparison report from saved results
fangbot report studies/chadsvasc/results/ --config studies/chadsvasc/config.yaml

Gold standard cases are YAML files with expected scores, risk tiers, and tool calls. The evaluation engine computes:

Metric Description
Accuracy Exact score match rate
MAE Mean absolute error
Cohen's Kappa Inter-rater reliability
Sensitivity/Specificity Per risk tier (low/moderate/high)
Protocol adherence Did the agent call the required MCP tools?
CoT quality Was reasoning auditable with chain-of-thought?

Development

See CONTRIBUTING.md for development setup and guidelines.

git clone https://github.com/RamosFBC/fangbot.git
cd fangbot
uv sync --extra dev --extra openai
uv run python -m pytest -v

License

MIT — Copyright (c) 2026 RamosFBC

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

fangbot-0.2.0.tar.gz (49.4 kB view details)

Uploaded Source

Built Distribution

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

fangbot-0.2.0-py3-none-any.whl (39.0 kB view details)

Uploaded Python 3

File details

Details for the file fangbot-0.2.0.tar.gz.

File metadata

  • Download URL: fangbot-0.2.0.tar.gz
  • Upload date:
  • Size: 49.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fangbot-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d148538f47225064961c2adf651c50b8230d7ffb5d6fc2c17b5064475fef35c1
MD5 e87e1a93e29ef6d8929b6e814cdc1be5
BLAKE2b-256 226ad827763c31aeda004bc2d36240474ddd9408211428d932cbf181131d2b3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for fangbot-0.2.0.tar.gz:

Publisher: publish.yml on RamosFBC/fangbot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fangbot-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fangbot-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 39.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fangbot-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe00ec4d805fb8a7c806c492a1d3b403b663079a5d5d42d8a0278ba12fc34525
MD5 55b1dc6e55c6f36e42ee4bea6763c476
BLAKE2b-256 adbb2a34032c9cb1bff82e256b964d8368286606b0bbbb6f5414a449f0041816

See more details on using hashes here.

Provenance

The following attestation bundles were made for fangbot-0.2.0-py3-none-any.whl:

Publisher: publish.yml on RamosFBC/fangbot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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