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.

When to use it

Use to render or inspect the conversation currently held by this agent instance.

Signature

TypeScript
getHistory(): Message[]

Result

The ordered in-memory Message[].

Behavior

Returns ordered Message objects from local memory. Raw-text ingestion and remember() do not add chat messages.

Side effects and completion

Read-only; it does not query the graph store.

Example

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