npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@agentsforge/healthkit

v0.3.1

Published

Health monitoring and cluster management for AI agents. Monitor soul drift, manage multi-agent clusters, and ensure agent identity preservation.

Downloads

53

Readme

@agentsforge/healthkit

npm version License: MIT

Health monitoring and cluster management for AI agents. Monitor soul drift, manage multi-agent clusters, and ensure agent identity preservation.

Features

  • 🧠 Soul Drift Detection — Alert when agent identity files lose weight in context
  • 🔄 Cluster Management — Deploy and manage multi-agent configurations
  • 📊 Health Monitoring — Real-time cluster health status via REST API
  • Local Mode — Validate configs without running a server
  • 🔌 Framework Agnostic — Works with OpenClaw, LangChain, AutoGen, or standalone

Installation

npm install @agentsforge/healthkit

# Optional: for YAML config support
npm install yaml

Quick Start

API Mode (with HealthKit server)

import { HealthKit, ClusterManager } from '@agentsforge/healthkit';

// Connect to HealthKit API
const kit = new HealthKit({ host: 'http://localhost:7842' });

// Check cluster health
const status = await kit.getStatus();
console.log(status);
// Output: { status: "Locked", drift_risk: "0%", header_efficiency: "94%" }

// Get soul drift metrics
const drift = await kit.getDriftRisk();
console.log(drift.soul_drift_risk); // "low" | "medium" | "high"

Local Mode (no server required)

import { ClusterManager } from '@agentsforge/healthkit';

const config = {
  cluster_id: "my-cluster",
  agents: [
    { id: "main", identity_path: "./SOUL.md", memory_buffer: 4096 },
    { id: "helper", identity_path: "./AGENTS.md", memory_buffer: 2048 }
  ],
  health_check: {
    soul_drift_threshold: 0.15
  }
};

const cluster = new ClusterManager(config, { localOnly: true });

// Validate configuration
const validation = cluster.validate();
console.log(validation);
// Output: { valid: true, errors: [], warnings: [] }

// Deploy (in local mode, this validates only)
const result = await cluster.deploy();
console.log(result.success); // true

With YAML Config

import { ClusterManager } from '@agentsforge/healthkit';
import fs from 'fs';

// Load cluster.yaml
const yamlContent = fs.readFileSync('./cluster.yaml', 'utf-8');
const cluster = new ClusterManager(yamlContent);

await cluster.deploy();
const health = await cluster.getHealthStatus();
console.log(health.status); // "Locked"

API Reference

HealthKit

REST client for the HealthKit API server.

const kit = new HealthKit({
  host: 'http://localhost:7842', // API server URL
  apiKey: 'optional-api-key',    // For authenticated endpoints
  timeout: 10000                  // Request timeout (ms)
});

// Methods
await kit.getStatus(): Promise<HealthStatus>
await kit.getDriftRisk(threshold?: number): Promise<DriftReport>
await kit.checkCluster(configPath?: string): Promise<ClusterReport>
await kit.ping(): Promise<boolean>

ClusterManager

Manages multi-agent cluster configuration and health.

const cluster = new ClusterManager(config, {
  host: 'http://localhost:7842', // API server URL
  apiKey: 'optional-api-key',    // For authenticated endpoints
  localOnly: false               // true = validation only, no API calls
});

// Methods
cluster.validate(): ValidationResult
await cluster.deploy(): Promise<DeploymentResult>
await cluster.getHealthStatus(): Promise<HealthStatus>
cluster.getConfig(): ClusterConfig
cluster.getClusterId(): string
cluster.getAgentIds(): string[]

loadCluster

Convenience function to create a ClusterManager.

import { loadCluster } from '@agentsforge/healthkit';

const cluster = loadCluster(yamlOrJsonString, { localOnly: true });

cluster.yaml Schema

cluster_id: "my-cluster"

orchestration:
  version: "2026.1-compat"
  global_anchors:
    - path: "./SOUL.md"
      priority: high
      persistence: locked

agents:
  - id: "primary"
    identity_path: "./SOUL.md"
    memory_buffer: 4096
    context_isolation: true
  
  - id: "aux"
    identity_path: "./AGENTS.md"
    memory_buffer: 2048
    context_isolation: false

sync_protocol:
  mode: "differential"          # differential | full | none
  frequency: "real-time"        # real-time | periodic | manual

health_check:
  auto_fix_overflow: true
  alert_on_soul_drift: true
  soul_drift_threshold: 0.15    # Alert if identity < 15% of context

Types

interface HealthStatus {
  status: 'Locked' | 'Warning' | 'Critical' | 'Unknown';
  drift_risk: string;           // "0%", "15%", etc.
  header_efficiency: string;    // "94%", etc.
  agents: AgentHealthStatus[];
  timestamp: string;
  cluster_id: string;
}

interface DriftReport {
  soul_drift_risk: 'low' | 'medium' | 'high';
  drift_score: number;          // 0-1, higher = more identity preserved
  identity_tokens: number;
  context_tokens: number;
  threshold: number;
  alert: boolean;
  message: string;
}

interface ValidationResult {
  valid: boolean;
  errors: string[];
  warnings: string[];
}

Soul Drift Explained

Soul drift measures how much your agent's identity files (SOUL.md, AGENTS.md) are being diluted by context accumulation (MEMORY.md, conversation history).

drift_score = identity_tokens / (identity_tokens + context_tokens)
  • drift_score ≥ 0.30: LOW risk — Identity well preserved
  • drift_score ≥ 0.15: MEDIUM risk — Monitor context growth
  • drift_score < 0.15: HIGH risk — Agent losing core identity

When drift is high, consider:

  • Trimming MEMORY.md
  • Archiving old context
  • Increasing identity file content

Python Backend

This package is a TypeScript client for the Python HealthKit API. Install the full stack:

# Install AgentForge (includes Python backend)
curl -fsSL https://agentsforge.dev/install.sh | bash

# Or manually
pip install agentforge
agentforge install

Start the API server:

agentforge start
# API available at http://localhost:7842

Requirements

  • Node.js 16+
  • Optional: yaml package for YAML config parsing
  • For API mode: Python HealthKit server running

License

MIT — Free to use, modify, and distribute.


Built by Jakebot Labs · AgentForge · GitHub