HazelJS
Durable AI agents inside your TypeScript backend
Same DI/HTTP app as your APIs — version agents like packages, govern writes, survive crashes. Not a chat widget bolted onto Express.
What you cannot get from LangChain alone
Packaging, durable approvals, and governed skills — inside the same Node process as your APIs.
01
DNA + Store
Version prompt and policies like libraries. Tools stay in @Tool code — DNA is not the implementation.
02
Crash-safe HITL
Refunds and freezes suspend on durable AgentRun. Restart mid-approval without losing the run.
03
Skillgate + apply
Curate REST into governed skills. Declare Definitions locally — apply does not restart Node. Kubernetes optional.
04
Agent Gatekeeper
Authorize every protected tool call before execution. Default deny, deterministic policies, and crash-safe approval — independent of the LLM.
await runtime.execute('support-desk', message, {
loop: { maxIterations: 4, successScore: 90 },
contract: { name: 'support-slo', maxLatencyMs: 30_000, fallbackAgent: 'safe-desk' },
recovery: { maxRetries: 2, fallbackAgent: 'safe-desk' },
});DNA ≠ tools · Store ≠ platform ≠ run
Three layers, one backend. Overlay never replaces your @Tool handlers with stubs.
Package identity, prompt, policies, versions, lockfile
Desired Definitions / Deployments — local control plane
Real @Tool / Skillgate execute, HITL, timelines
Pick the right command
Apply declares desired state. Your app still runs the tools. Chat is always real execute.
hazel agent runDNA smoke with stubs — not product money moves
hazel agent applyDeclare desired state — does not restart Node
npm run dev + /api/chatReal tools and HITL in your backend
Clone Meridian — see the whole Agent OS
One repo that teaches DNA vs tools, Store vs platform vs run, Skillgate, router, and HITL. Copy the pattern into your product.
01
store:sync
Publish DNA packages + lockfile
02
platform:sync
Apply Definitions / Deployments
03
npm run dev
Chat with real @Tool handlers
terminal
cd hazeljs-meridian-ops && npm i && npm run store:sync && npm run platform:sync && npm run dev