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

AI Agent Runtime for TypeScript

An AI agent runtime executes agent steps against models and tools. HazelJS AgentRuntime is the TypeScript kernel: register @Agent classes, call execute(), optionally run a confidence loop of plan → execute → critique → validate.

01Lifecycle (confidence loop)

Plan
 ↓
Execute
 ↓
Critique
 ↓
Validate
 ↓
(next iteration or COMPLETED / FAILED)

Those stage names match confidence-loop.ts. There is no Continue/Finish stage — the loop breaks when validate/critique scores pass successScore or maxIterations is exhausted. Optional stage: observe.

02Product deep dive

For the HazelJS-specific entity page, see Agent Runtime in Agent OS.

03AgentRuntime with loop options

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 },
});