MemoGrafterAgent
getMemoryDiff()
Compare two memory versions.
What it does
Compare two memory versions.
When to use it
Use to compare two known memory versions field by field.
Signature
TypeScript
getMemoryDiff(fromMemoryId: string, toMemoryId: string): Promise<MemoryDiff>Parameters
fromMemoryId (string) — The earlier memory version to compare.toMemoryId (string) — The later memory version to compare.Result
A field-level comparison between the two selected memory versions.
Behavior
Returns both memories, every compared field, the changed-field subset, and update/conflict relationships between the selected versions.
Side effects and completion
Read-only.
Errors and empty results
Rejects when either selected memory cannot be loaded.
Example
example.ts
const diff = await agent.getMemoryDiff(oldId, newId);