New: Decision Runtime — closed-set judgments for Agent OS. Read the guide →
HazelJS LogoHazelJS

Agent Runtime

Agent Runtime (`AgentRuntime` in @hazeljs/agent) is the execution kernel for HazelJS Agent OS. It registers agents and tools, runs execute/streaming, graphs, policies, and durable suspend.

01How to use it

Construct AgentRuntime, register @Agent classes, call execute(name, input, options). Optional loop enables plan → execute → critique → validate. For the commercial keyword page, see AI agent runtime.

02Bootstrap

typescript
import { AgentRuntime, createMockLlmProvider } from '@hazeljs/agent';

const runtime = new AgentRuntime({
  llmProvider: createMockLlmProvider(),
  enableRetry: false,
});
runtime.registerAgent(SupportAgent);

const result = await runtime.execute('support-agent', 'Check open orders', {
  maxSteps: 8,
  loop: { maxIterations: 8, successScore: 95 },
});