Skip to documentation
Docs navigation
Docs/getMemoryHistory()
MemoGrafterAgent

getMemoryHistory()

Inspect the lineage of a memory ID or fact key in the agent's current session.

What it does

Inspect the lineage of a memory ID or fact key in the agent's current session.

When to use it

Use to audit how a fact changed by memory ID or by the (subject, predicate) fact key.

Signature

TypeScript
getMemoryHistory(memoryId: string): Promise<MemoryHistoryResult>
getMemoryHistory(subject: string, predicate: string): Promise<MemoryHistoryResult>

Parameters

memoryId (string) — The memory record to inspect or change.

Result

The matching memory lineage, including current and superseded versions.

Behavior

Returns ordered versions, relationship edges, status labels, and the current active memory when one exists. Agent overloads are scoped to the current session.

Side effects and completion

Read-only and includes historical rows that normal recall filters out.

Example

example.ts
const history = await agent.getMemoryHistory("user", "location");