Skip to content

MessageStore

Defined in: packages/core/src/stores/types.ts:29

Persistent or in-process storage for a conversation transcript keyed by memoryScope on AgentRunInput.

Role: supplies ModelMessage[] to the model on the next agent.run. Separate from WorkflowStore (run/step observability). Do not rebuild agent memory by replaying run events.

The agent runner: load → append user / response.messages → save. On a new memoryScope, the resolved system prompt is stored as the first message; later episodes reuse that pinned text (also passed via system). context on agent.run() is not stored here.

Supported shape: one ModelMessage[] per scope, grown only by append. load returns that full list and save replaces it. Step retry writes the saved list onto the new attempt. The inspection UI attributes turns by the list’s length at each commit. A store that summarizes, drops, reorders, or is not a replaceable list is outside this contract — those models break retry restore and the transcript UI.

Configure via createAdlRuntime({ stores: { message } }) or per-agent adl.createAgent({ memory: { store } }).

readonly optional kind?: string

Defined in: packages/core/src/stores/types.ts:35

Inspector-facing backend id. Built-ins set "in-memory" or "sqlite". Custom stores may set any string; inspectMessageStoreKind reports "custom" when this is omitted.

copy(fromScope, toScope): Promise<void>

Defined in: packages/core/src/stores/types.ts:48

Copy fromScope’s saved transcript onto toScope. toScope must not already have a transcript. Same-scope is a no-op. Throws when fromScope has no saved transcript.

string

string

Promise<void>


delete(memoryScope): Promise<void>

Defined in: packages/core/src/stores/types.ts:51

Drop the transcript for this scope.

string

Promise<void>


listScopes(): Promise<string[]>

Defined in: packages/core/src/stores/types.ts:54

Memory scopes that have a saved transcript (for inspector rebuild).

Promise<string[]>


load(memoryScope): Promise<ModelMessage[]>

Defined in: packages/core/src/stores/types.ts:38

Full transcript for this scope (empty array when new).

string

Promise<ModelMessage[]>


save(memoryScope, messages): Promise<void>

Defined in: packages/core/src/stores/types.ts:41

Replace the transcript after the runner merges new messages.

string

ModelMessage[]

Promise<void>