Agent OS — durable agents in your TypeScript backend. Start with Meridian →
HazelJS LogoHazelJS

HazelJS

Agent OS · Apache 2.0 · TypeScript

Agent OS for TypeScript — durable agents in your backend

An Agent OS is the production lifecycle for AI agents — durable runs, packaging, governance, and recovery — not a bootable host OS. HazelJS runs that lifecycle inside your TypeScript / Node app, in the same DI process as your APIs.

What is unique

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.

05

Agent VM

Effect-typed tools (@Pure, @Read, @Reversible, @Irreversible) — speculative branches, transactional undo, automatic compensation on losing paths.

support-desk.ts
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' },
});
Mental model

DNA ≠ tools · Store ≠ platform ≠ run

Three layers, one backend. Overlay never replaces your @Tool handlers with stubs.

1DNA / Store

Package identity, prompt, policies, versions, lockfile

2Platform apply

Desired Definitions / Deployments — local control plane

3App runtime

Real @Tool / Skillgate execute, HITL, timelines

Anti-confusion

Pick the right command

Apply declares desired state. Your app still runs the tools. Chat is always real execute.

hazel agent run

DNA smoke with stubs — not product money moves

hazel agent apply

Declare desired state — does not restart Node

npm run dev + /api/chat

Real tools and HITL in your backend

Flagship

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
FAQ

Agent OS, explained

Short answers for the search query — then clone Meridian or read the guide.

What is an Agent OS?+

An Agent OS is the production lifecycle for AI-native agents: durable runs, packaging, governance, recovery, and CI — not a bootable host operating system. HazelJS Agent OS runs that lifecycle inside your TypeScript / Node backend, in the same DI app as your APIs. Read What is an Agent OS?

What is HazelJS Agent OS?+

HazelJS Agent OS is durable AI agents inside your TypeScript backend: DNA packages, crash-safe HITL, Skillgate, Gatekeeper authorization, and local apply/reconcile. It is not a bare-metal OS and not a Python-only kernel.

Is DNA the same as tool implementation?+

No. DNA owns identity, prompt, tool names, and policies. Real side effects stay in TypeScript @Tool handlers or Skillgate. Overlay never replaces tools with stubs.

Does apply restart my Node app?+

No. apply writes desired state. Your app overlays prompt/policies on boot (or explicit reload). Chat is always AgentRuntime execute with real tools.

Can I undo agent side effects or speculate across plans?+

Yes — with @hazeljs/agent-vm. Tools declare effect classes (@Pure, @Read, @Reversible, @Irreversible). @Speculate forks K reasoning branches; the winner commits and losers roll back via @Compensate handlers. @Atomic enables transactional undo of entire runs.

What is an Agentic Organism?+

With @hazeljs/organism you deploy a mission, genes, and constitution — not a fixed agent graph. Environment signals drive spawn, reuse, specialization, survival, and a resource economy under hard safety limits. Embed with createOpsOrganism and OrganismHostRegistry; a durable OrganismRepository hydrates the same organism across process replicas.

Do I need Cloud or Kubernetes?+

No. Local registry and local backend are enough. Hosted registry and K8s are optional.