Metadata-Version: 2.4
Name: openmed-agent
Version: 0.0.1
Summary: OpenMed Agent — AI-powered medical assistant with TUI, agentic workflows, and remote NLP inference.
Author: Maziyar Panahi
License: Apache-2.0
License-File: LICENSE
Keywords: AI assistant,LLM,MCP,TUI,agent,clinical,healthcare,medical
Requires-Python: >=3.10
Provides-Extra: agent
Requires-Dist: httpx>=0.27; extra == 'agent'
Requires-Dist: openai>=1.0.0; extra == 'agent'
Requires-Dist: reportlab>=4.0; extra == 'agent'
Provides-Extra: all
Requires-Dist: flake8>=7.0; extra == 'all'
Requires-Dist: httpx>=0.27; extra == 'all'
Requires-Dist: openai>=1.0.0; extra == 'all'
Requires-Dist: pytest-asyncio>=1.0; extra == 'all'
Requires-Dist: pytest-cov>=4.0; extra == 'all'
Requires-Dist: pytest>=7.0; extra == 'all'
Requires-Dist: reportlab>=4.0; extra == 'all'
Requires-Dist: rich>=13.9; extra == 'all'
Requires-Dist: textual>=0.89; extra == 'all'
Requires-Dist: typer>=0.12; extra == 'all'
Provides-Extra: build
Requires-Dist: nuitka>=2.6; extra == 'build'
Requires-Dist: ordered-set>=4.1; extra == 'build'
Provides-Extra: cli
Requires-Dist: rich>=13.9; extra == 'cli'
Requires-Dist: typer>=0.12; extra == 'cli'
Provides-Extra: dev
Requires-Dist: flake8>=7.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=1.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Provides-Extra: tui
Requires-Dist: rich>=13.9; extra == 'tui'
Requires-Dist: textual>=0.89; extra == 'tui'
Description-Content-Type: text/markdown

# OpenMed Agent

> **AI-powered medical assistant with interactive TUI, agentic workflows, and remote NLP inference**

OpenMed Agent provides an intelligent terminal interface for clinical workflows — entity extraction, PII de-identification, and medical reasoning — powered by LLMs and remote NLP inference.

[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)

---

## Quick Start

### Installation

```bash
# Recommended: install the latest binary release
curl -fsSL https://github.com/openmed-labs/openmed-agent/releases/latest/download/install.sh | bash

# Install a pinned binary release
VERSION=0.0.1
curl -fsSL "https://github.com/openmed-labs/openmed-agent/releases/download/v${VERSION}/install.sh" | bash -s -- "${VERSION}"
```

### Python Installation

```bash
# Install with TUI support
pip install openmed-agent[tui]

# Or install everything
pip install openmed-agent[all]
```

### Launch the Agent TUI

```bash
openmed            # Launch interactive agent TUI
openmed agent      # Explicit agent command
```

### Authenticate (for Codex models)

```bash
openmed login      # OAuth flow for Codex authentication
```

---

## Features

- **Interactive Agent TUI** — Rich terminal interface for clinical analysis and medical reasoning
- **Remote NLP Inference** — NER and PII tools connect to remote inference endpoints via Docker
- **MCP Server Integration** — Connect to medical data sources (PubMed, ICD-10, NPI, CMS)
- **Agentic Workflows** — Plan-based execution with skill-driven task automation
- **Configuration Profiles** — `dev`/`prod`/`test`/`fast` presets with flexible overrides
- **PHI Handling Modes** — `full`, `deid`, `strict` modes for HIPAA-aware workflows

---

## CLI Commands

```bash
openmed                    # Launch agent TUI (default)
openmed agent              # Launch agent TUI with options
openmed config show        # Show current configuration
openmed config profiles    # List available profiles
openmed mcp list           # List MCP server configuration
openmed mcp enable         # Enable MCP servers
openmed mcp doctor         # Check MCP server connectivity
openmed login              # Authenticate via OAuth
openmed oauth status       # Check authentication status
```

---

## Remote Inference

NER and PII tools require a remote inference endpoint. Set the environment variable:

```bash
export OPENMED_INFERENCE_URL=http://localhost:8000
```

See `services/inference/` for the Docker-based inference server.

---

## Binary Releases

Standalone release archives are built by [binary-release.yml](.github/workflows/binary-release.yml) and published with:

- platform tarballs such as `openmed-0.0.1-darwin-arm64.tar.gz`
- `openmed-manifest.json` for `install.sh`
- `openmed-checksums.txt` for manual verification

To build a release artifact locally:

```bash
uv sync --extra all --extra build
uv run --no-sync python scripts/release/build_binary.py
```

---

## Contributing

We welcome contributions! Whether it's bug reports, feature requests, or pull requests.

---

## License

OpenMed is released under the [Apache-2.0 License](LICENSE).

---

## Citation

If you use OpenMed in your research, please cite:

```bibtex
@misc{panahi2025openmedneropensourcedomainadapted,
      title={OpenMed NER: Open-Source, Domain-Adapted State-of-the-Art Transformers for Biomedical NER Across 12 Public Datasets},
      author={Maziyar Panahi},
      year={2025},
      eprint={2508.01630},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2508.01630},
}
```
