Intermediate~26 minHazelJS
Durable Run State vs Prompt Memory
Distinguish AgentRun checkpoints/leases from conversational memory—with store wiring examples.
- Authors
- editorial-team
- Published
- Last reviewed
Progress is stored locally in this browser.
Direct answer
| Store | Holds | Survives crash? |
|---|---|---|
| Prompt / working context | Model-visible turns this step | No (unless re-assembled) |
@hazeljs/memory | Long-term facts/conversations | Yes (if backed by persistent store) |
| Durable AgentRun store | Steps, checkpoints, HITL waits, leases | Yes — required for resume |
Guide: /guides/implement-durable-execution-and-recovery.
Worked example — durable kernel + memory flag
typescript
import {
AgentRuntime,
createDurableRunStore,
} from '@hazeljs/agent';
const store = createDurableRunStore('./.hazel/runs');
const runtime = new AgentRuntime({
llmProvider,
durableSuspend: true,
runRepository: store.runRepository,
checkpointService: store.checkpointService,
humanTaskService: store.humanTaskService,
});
// Conversational memory (optional) ≠ durable run store
await runtime.execute('support-desk', 'Start a refund for ORD-1001', {
sessionId: 'user-42',
enableMemory: true, // chat recall
maxSteps: 10,
// checkpoints live in createDurableRunStore — independent of enableMemory
});
Memory without a durable run store still loses mid-HITL progress on crash. Durable runs without memory still resume tool loops—but forget long-term preferences.
Artifact: One-pager: what lives in run store vs memory store