01Example architecture
User
↓
Coordinator Agent
├── Research Agent
├── Support Agent
├── Billing Agent
└── Operations Agent02How HazelJS handles the hard parts
- Identity: Agent DNA + in-process AgentRegistry
- Communication: @Delegate, supervisor routing, optional A2A
- Execution: AgentRuntime with shared durable run stores
- Authorization: Gatekeeper per tool — cross-agent does not bypass policy
- Lifecycle: AgentOS / hazeld start, pause, delete
- Failures: durable suspend, HITL resume, run cancel/resume CLI
- Observability: JSONL timelines, hazel logs, inspector
03Register and execute an agent
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 },
});