In-Memory State Store
Ephemeral state storage for development and testing.
Usage
import { InMemoryStateStore } from '@ahzan-agentforge/core';
const store = new InMemoryStateStore();InMemoryStateStore is the default when no stateStore is configured. State is lost when the process exits.
API
const store = new InMemoryStateStore();
// Save state
await store.save(runState);
// Load state
const state = await store.load('run_abc123');
// List all runs
const runs = await store.list();
// Returns RunSummary[] — { runId, agentName, status, createdAt, updatedAt }
// Delete a run
await store.delete('run_abc123');When to Use
- Development — quick iteration, no Redis needed
- Testing — deterministic state for test assertions
- Ephemeral agents — short-lived agents that don't need persistence
Limitations
- State is lost on process restart
- Cannot resume runs after a crash
- Not suitable for production workloads
Next Steps
- Redis Store — persistent storage
- Checkpoint & Resume — recovery details