Metadata-Version: 2.4
Name: agent-healthkit
Version: 0.3.1
Summary: Platform-agnostic health monitoring SDK for AI agents
Author: JakebotLabs
License-Expression: MIT
Project-URL: Homepage, https://github.com/JakebotLabs/agent-healthkit
Project-URL: Repository, https://github.com/JakebotLabs/agent-healthkit
Keywords: agent,healthkit,monitoring,AI,LLM
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: system
Requires-Dist: psutil>=5.9; extra == "system"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: psutil>=5.9; extra == "dev"

# Agent HealthKit

**Agent HealthKit** is a platform-agnostic health monitoring SDK for AI agent frameworks. It provides a lightweight adapter interface that any agent system can implement to expose runtime metrics (memory usage, context size, error rates, uptime), built-in detectors for common failure modes like context bloat and resource exhaustion, and a unified `run_full_check` API that aggregates detector results into actionable health reports — all with zero required dependencies.

## Install

```bash
pip install agent-healthkit

# Optional: system resource monitoring (CPU/RAM)
pip install agent-healthkit[system]
```

## Quick Start

```python
from healthkit_sdk import GenericAdapter, run_full_check

adapter = GenericAdapter()
adapter.set_metrics(memory_mb=512, context_tokens=45000, error_rate=0.01, uptime_seconds=3600)
report = run_full_check(adapter)
print(report.status)        # "healthy" | "warning" | "critical"
print(report.issues)        # list of detected issues
```

## Built-in Detectors

| Detector | Description | Triggers When |
|---|---|---|
| `ContextBloatDetector` | Monitors token/context window usage | Context > 80% of max (warning) or > 95% (critical) |
| `SystemResourcesDetector` | Monitors CPU and RAM usage via `psutil` | RAM > 80% (warning) or CPU > 90% (critical) |

## Extending

Implement `BaseAdapter` to connect your own agent framework:

```python
from healthkit_sdk import BaseAdapter, AgentMetrics

class MyAdapter(BaseAdapter):
    def collect_metrics(self) -> AgentMetrics:
        return AgentMetrics(memory_mb=..., context_tokens=..., ...)
```

## License

MIT © JakebotLabs
