ACAgentic Craft

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

StoreHoldsSurvives crash?
Prompt / working contextModel-visible turns this stepNo (unless re-assembled)
@hazeljs/memoryLong-term facts/conversationsYes (if backed by persistent store)
Durable AgentRun storeSteps, checkpoints, HITL waits, leasesYes — 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

Sources

Related