@kartha-health/agent
v0.1.0
Published
Self-hosted, CMA-shaped clinical agent runtime: agents, sessions, skills, events, and a cloud-agnostic LLM loop over @kartha-health/client.
Readme
@kartha-health/agent
A self-hosted, CMA-shaped agent runtime for the Kartha Health Agent SDK —
agents, sessions, skills, and the agentic loop, running locally against a
cloud-agnostic LlmProvider. Agent YAMLs port from Anthropic's Claude Managed
Agents; the loop streams events, applies the @kartha-health/client guardrails
on every tool call, caches the prompt, and emits a full token/cost turn trace.
npm install @kartha-health/agent @kartha-health/client
# choose a provider peer dep: @anthropic-ai/sdk · @anthropic-ai/bedrock-sdk · @anthropic-ai/vertex-sdkimport { Runtime, SkillRegistry, EntitlementGate, AnthropicProvider } from "@kartha-health/agent";
const runtime = new Runtime({
mcpUrl: process.env.KARTHA_MCP_URL!,
auth: mcpAuth, // JwtAuth from @kartha-health/client
tenantId: "t_bcm",
llm: new AnthropicProvider(),
skills: new SkillRegistry(),
entitlement: EntitlementGate.fromGrant(["sepsis-qsofa"]),
cache: true,
});
const session = await runtime.createSession({ agentId, patientId: "p-123", skillId });
for await (const ev of session.sendUserMessage("Screen this patient for sepsis.")) { /* … */ }Providers are pluggable — AnthropicProvider, BedrockProvider,
VertexProvider, FoundryProvider (peer deps, optional). Read-only by default;
the entitlement gate degrades to grace, never hard-fails a clinical call.
- Runtime: ESM, Node ≥ 20 · Depends on:
@kartha-health/client - License: Apache-2.0
