Class: InMemoryCheckpointStore
Defined in: packages/agentos/src/orchestration/checkpoint/InMemoryCheckpointStore.ts:50
In-memory ICheckpointStore implementation.
All checkpoints are stored in a Map keyed by checkpoint id. Scans are O(n) over
the number of stored checkpoints — acceptable for test workloads; a production store
should use indexed secondary keys (runId, graphId).
Example
const store = new InMemoryCheckpointStore();
await store.save(checkpoint);
const restored = await store.latest(runId);
Implements
Constructors
Constructor
new InMemoryCheckpointStore():
InMemoryCheckpointStore
Returns
InMemoryCheckpointStore
Methods
delete()
delete(
checkpointId):Promise<void>
Defined in: packages/agentos/src/orchestration/checkpoint/InMemoryCheckpointStore.ts:102
Permanently remove a checkpoint from the store.
Silently succeeds when checkpointId does not exist.
Parameters
checkpointId
string
The checkpoint to remove.
Returns
Promise<void>
Implementation of
fork()
fork(
checkpointId,patchState?):Promise<string>
Defined in: packages/agentos/src/orchestration/checkpoint/InMemoryCheckpointStore.ts:107
Create a new run branching from an existing checkpoint.
The operation deep-clones the source checkpoint, assigns a fresh runId and
checkpoint id, applies any patchState overrides, persists the new checkpoint,
and returns the new runId.
Parameters
checkpointId
string
The checkpoint to fork from.
patchState?
Partial<GraphState<unknown, unknown, unknown>>
Optional partial GraphState overrides applied after cloning.
Returns
Promise<string>
The new runId for the forked run.
Implementation of
get()
get(
checkpointId):Promise<Checkpoint|null>
Defined in: packages/agentos/src/orchestration/checkpoint/InMemoryCheckpointStore.ts:60
Load a checkpoint by its unique checkpoint identifier.
Parameters
checkpointId
string
The exact checkpoint id assigned at save-time.
Returns
Promise<Checkpoint | null>
The matching checkpoint, or null when none exists.
Implementation of
latest()
latest(
runId):Promise<Checkpoint|null>
Defined in: packages/agentos/src/orchestration/checkpoint/InMemoryCheckpointStore.ts:78
Return the most recently persisted checkpoint for a run, or null when the run
has no checkpoints.
Parameters
runId
string
The graph run identifier.
Returns
Promise<Checkpoint | null>
Implementation of
list()
list(
graphId,options?):Promise<CheckpointMetadata[]>
Defined in: packages/agentos/src/orchestration/checkpoint/InMemoryCheckpointStore.ts:83
List lightweight metadata descriptors for all checkpoints belonging to a graph.
Parameters
graphId
string
The compiled graph identifier.
options?
limit?
number
runId?
string
Returns
Promise<CheckpointMetadata[]>
Array of CheckpointMetadata, sorted by timestamp descending.
Implementation of
load()
load(
runId,nodeId?):Promise<Checkpoint|null>
Defined in: packages/agentos/src/orchestration/checkpoint/InMemoryCheckpointStore.ts:65
Load a checkpoint for the given runId.
When nodeId is supplied, returns the most recent checkpoint for that specific
node within the run. When nodeId is omitted, returns the most recent checkpoint
for the run regardless of node (equivalent to latest(runId)).
Parameters
runId
string
The graph run identifier.
nodeId?
string
Optional node filter.
Returns
Promise<Checkpoint | null>
The matching checkpoint, or null when none exists.
Implementation of
save()
save(
checkpoint):Promise<void>
Defined in: packages/agentos/src/orchestration/checkpoint/InMemoryCheckpointStore.ts:55
Persist a checkpoint snapshot.
If a checkpoint with the same id already exists it is overwritten.
Parameters
checkpoint
The snapshot to persist.
Returns
Promise<void>