Skip to content
Get started

Patch Memory

client.memories.update(stringmemoryID, MemoryUpdateParams { metadata, text } body, RequestOptionsoptions?): MemoryItem { id, memory, agent_id, 7 more }
PATCH/v1/memories/{memory_id}/

Update memory text — supersedes old + creates new.

Metadata-only patches (no text) are rejected with 400; the row’s metadata is derived from extraction and isn’t editable from the API yet.

ParametersExpand Collapse
memoryID: string
body: MemoryUpdateParams { metadata, text }
metadata?: unknown
text?: string | null
ReturnsExpand Collapse
MemoryItem { id, memory, agent_id, 7 more }

One result item — used in flat search results and listings.

id: string
memory: string
agent_id?: string | null
categories?: Array<string>
conv_id?: string | null
created_at?: string | null
metadata?: unknown
score?: number | null
updated_at?: string | null
user_id?: string | null

Patch Memory

import XtraceMemoryManager from 'xtrace-memory-manager';

const client = new XtraceMemoryManager({
  apiKey: process.env['XTRACE_MEMORY_MANAGER_API_KEY'], // This is the default and can be omitted
  orgID: process.env['XTRACE_MEMORY_MANAGER_ORG_ID'], // This is the default and can be omitted
});

const memoryItem = await client.memories.update('memory_id');

console.log(memoryItem.id);
{
  "id": "id",
  "memory": "memory",
  "agent_id": "agent_id",
  "categories": [
    "string"
  ],
  "conv_id": "conv_id",
  "created_at": "created_at",
  "metadata": {},
  "score": 0,
  "updated_at": "updated_at",
  "user_id": "user_id"
}
Returns Examples
{
  "id": "id",
  "memory": "memory",
  "agent_id": "agent_id",
  "categories": [
    "string"
  ],
  "conv_id": "conv_id",
  "created_at": "created_at",
  "metadata": {},
  "score": 0,
  "updated_at": "updated_at",
  "user_id": "user_id"
}