Skip to documentation
Docs navigation
Docs/getHistory()
MemoGrafterAgent

getHistory()

Read the agent's in-memory conversation.

What it does

Read the agent's in-memory conversation.

The operation is scoped to the agent’s current session, so callers do not pass a session identifier on every call.

Signature

TypeScript
getHistory(): Message[]

Result

The ordered in-memory Message[].

Example

example.ts
const messages = agent.getHistory();