v46

latestOpenAPI 3.1.0raw.githubusercontent.com2026-04-253903.6 MB
Content Management

Update a memory (creates new version)

Update a memory by creating a new version. The original memory is preserved with isLatest=false.

patch/v4/memories

Request body

idstring

ID of the memory entry to operate on

contentstring

Exact content match of the memory entry to operate on. Use this when you don't have the ID.

containerTagstring required

Container tag / space identifier. Required to scope the operation.

newContentstring required

The new content that will replace the existing memory

metadataobject

Optional metadata. If not provided, inherits from the previous version.

forgetAfterstring datetime nullable

ISO 8601 datetime string. The memory will be auto-forgotten after this time. Pass null to clear an existing expiry. Omit to inherit from the previous version.

forgetReasonstring nullable

Optional reason for the scheduled forgetting. Cleared automatically when forgetAfter is set to null.

Example request

{
  "id": "mem_abc123",
  "content": "John prefers dark mode",
  "containerTag": "user_123",
  "newContent": "John now prefers light mode",
  "forgetAfter": "2026-06-01T00:00:00Z",
  "forgetReason": "temporary project deadline"
}

Response

Memory updated successfully

idstring required

ID of the newly created memory version

memorystring required

The content of the new memory version

versionnumber required

Version number of this memory entry

parentMemoryIdstring nullable required

ID of the memory this version updates

rootMemoryIdstring nullable required

ID of the first memory in this version chain

createdAtstring datetime required

When this memory version was created

forgetAfterstring datetime nullable required

When this memory will be auto-forgotten, or null if no expiry

forgetReasonstring nullable required

Reason for the scheduled forgetting, or null

Example response

{
  "id": "mem_xyz789",
  "memory": "John now prefers light mode",
  "version": 2,
  "parentMemoryId": "mem_abc123",
  "rootMemoryId": "mem_abc123"
}