HazelJS Blog
Stateful vs Stateless AI Agents
HazelJS Team
10/21/2026
General
← Back to Blog
When agents need durable run state, HITL suspend, and recovery — and when a stateless request/response loop is enough.
A stateless agent treats each request as independent: prompt in, answer out. That is enough for many read-only assistants.
A stateful / durable agent keeps run state across turns, failures, and human waits. You need that when:
- A tool call requires human approval mid-flight
- Work spans minutes or hours
- The process may crash and must resume
HazelJS Agent OS stores durable runs (DurableRunStore), supports worker leases, and resumes HITL after restart when durable suspend is enabled. That composition is what we call the durable kernel — not a separate npm package.
Avoid:
while (true) {
await agent.run();
}
…unless you accept losing in-memory state on every crash.