Concepts

Revision History

Every write creates a full snapshot for auditability.

Every memory_write and memory_patch creates a row in mx_revision. Reads do not create revisions; reads create access log entries instead.

What a revision stores

ColumnWhat it stores
idUnique revision ID
file_idForeign key to mx_file
physical_pathFull path at write time
operationwrite or patch
content_textFull file content after the write
reasonOptional human-readable reason
actorWho performed the write
user_idThe user whose memory changed
tool_call_idThe LLM tool call ID
created_atTimestamp

Why snapshots

Memory files are usually small. Full snapshots make point-in-time inspection simple:

  • No diff replay chain.
  • No corruption risk from broken intermediate patches.
  • Straightforward auditing in SQL and the admin UI.

Reason strings

Agents should provide a reason when writing or patching memory.

await memory.writeFile({
  path: 'user/profile.md',
  content,
  reason: 'User confirmed preference for quiet neighborhoods',
})

A good reason answers why the write was necessary at that moment.

On this page