Back to docs

Documentation

Agent Harness

Modular toolkit for building health AI agents — tool loop engine, skill format, and health memory standard.

A modular, composable toolkit for building health AI agents. Agent Harness provides three independent npm packages that can be used alone or together — a tool loop engine, a skill format and loader, and a health memory standard.

Perfect for: Health AI agents, conversational health assistants, clinical decision support tools.

Packages

Agent Core

Tool loop engine, LLM provider abstraction, mode routing, and context building. The foundation for any agentic workflow.

Skill Kit

Unified skill format using Markdown + YAML frontmatter. Load, filter, and assemble skill prompts with multi-language support.

Health Memory

Open standard for health agent memory. Schemas, store interface, and reference implementation for persistent health context.


Getting Started

Agent Core

npm install @eir-open/agent-core

Skill Kit

npm install @eir-open/skill-kit

Health Memory

npm install @eir-open/health-memory

All packages require Node.js 18+ and have a single shared dependency: zod for schema validation.


How They Compose

A typical health agent combines all three packages:

import { executeToolLoop, OpenAICompatibleProvider, KeywordModeRouter, buildSystemContent, buildModeToolInstruction } from '@eir-open/agent-core';
import { loadSkillDirectory, getSkillsForMode, buildSkillPrompt } from '@eir-open/skill-kit';
import { InMemoryHealthMemoryStore, formatMemoryContext } from '@eir-open/health-memory';
// 1. Load skills from disk
const skills = await loadSkillDirectory('./skills');
// 2. Route user message to a mode
const router = new KeywordModeRouter(routerConfig);
const decision = router.resolve({ message: userMessage });
// 3. Build system prompt from skills + mode + memory
const modeSkills = getSkillsForMode(skills, decision.mode);
const memoryItems = await memoryStore.getAll();
const system = buildSystemContent([
buildSkillPrompt(modeSkills),
buildModeToolInstruction({ mode: decision.mode, toolNames: decision.allowedTools }),
formatMemoryContext(memoryItems),
]);
// 4. Run the tool loop
const result = await executeToolLoop({
provider: new OpenAICompatibleProvider(openaiClient),
model: 'gpt-4o',
messages: [{ role: 'system', content: system }, { role: 'user', content: userMessage }],
tools: toolDefinitions,
toolHandlers: handlers,
allowedToolNames: new Set(decision.allowedTools),
});

Key Design Principles

SDK-Agnostic

Works with any OpenAI-compatible LLM provider — OpenAI, Groq, Together, Mistral, and more.

Composable

Use one package or all three. No forced coupling between tool execution, skills, and memory.

Lifecycle Hooks

Intercept tool calls, handle errors, and control loop behavior with optional hook callbacks.

Mode Routing

Route messages to different modes with distinct tool sets and skill configurations. Safety modes can disable tools entirely.

Health-Aware Memory

Purpose-built memory model for health data with confidence scoring, deduplication, and “untrusted snippet” framing.

Markdown Skills

Define skills as readable Markdown files with YAML frontmatter — no JSON schemas or code required.


Learn More