Claude Platform Docs

Memories

Create a memory
client.Beta.MemoryStores.Memories.New(ctx, memoryStoreID, params) (*BetaManagedAgentsMemory, error)
POST/v1/memory_stores/{memory_store_id}/memories
List memories
client.Beta.MemoryStores.Memories.List(ctx, memoryStoreID, params) (*PageCursor[BetaManagedAgentsMemoryListItemUnion], error)
GET/v1/memory_stores/{memory_store_id}/memories
Retrieve a memory
client.Beta.MemoryStores.Memories.Get(ctx, memoryID, params) (*BetaManagedAgentsMemory, error)
GET/v1/memory_stores/{memory_store_id}/memories/{memory_id}
Update a memory
client.Beta.MemoryStores.Memories.Update(ctx, memoryID, params) (*BetaManagedAgentsMemory, error)
POST/v1/memory_stores/{memory_store_id}/memories/{memory_id}
Delete a memory
client.Beta.MemoryStores.Memories.Delete(ctx, memoryID, params) (*BetaManagedAgentsDeletedMemory, error)
DELETE/v1/memory_stores/{memory_store_id}/memories/{memory_id}
Models
type BetaManagedAgentsConflictError struct{…}
Type BetaManagedAgentsConflictErrorType
Message string Optional
type BetaManagedAgentsContentSha256Precondition struct{…}

Optimistic-concurrency precondition: the update applies only if the memory's stored content_sha256 equals the supplied value. On mismatch, the request returns memory_precondition_failed_error (HTTP 409); re-read the memory and retry against the fresh state. If the precondition fails but the stored state already exactly matches the requested content and path, the server returns 200 instead of 409.

Type BetaManagedAgentsContentSha256PreconditionType
ContentSha256 string Optional

Expected content_sha256 of the stored memory (64 lowercase hexadecimal characters). Typically the content_sha256 returned by a prior read or list call. Because the server applies no content normalization, clients can also compute this locally as the SHA-256 of the UTF-8 content bytes.

type BetaManagedAgentsDeletedMemory struct{…}

Tombstone returned by Delete a memory. Deleting a memory does not erase its version history: its versions remain listable via List memory versions while they are retained (each version is kept for at least the version retention period after it was written, unless the store itself is deleted).

ID string

ID of the deleted memory (a mem_... value).

Type BetaManagedAgentsDeletedMemoryType
type BetaManagedAgentsErrorUnion interface{…}
One of the following:
type BetaManagedAgentsMemory struct{…}

A memory object: a single text document at a hierarchical path inside a memory store. The content field is populated when view=full and null when view=basic; the content_size_bytes and content_sha256 fields are always populated so sync clients can diff without fetching content. Memories are addressed by their mem_... ID; the path is the create key and can be changed via update.

ID string

Unique identifier for this memory (a mem_... value). Stable across renames; use this ID, not the path, to read, update, or delete the memory.

ContentSha256 string

Lowercase hex SHA-256 digest of the UTF-8 content bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a content_sha256 precondition on update. Always populated, regardless of view.

ContentSizeBytes int64

Size of content in bytes (the UTF-8 plaintext length). Always populated, regardless of view.

formatint32
CreatedAt Time

A timestamp in RFC 3339 format

formatdate-time
MemoryStoreID string

ID of the memory store this memory belongs to (a memstore_... value).

MemoryVersionID string

ID of the memory_version representing this memory's current content (a memver_... value). This is the authoritative head pointer; memory_version objects do not carry an is_latest flag, so compare against this field instead. Enumerate the history via List memory versions.

Path string

Hierarchical path of the memory within the store, e.g. /projects/foo/notes.md. Always starts with /. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes.

Type BetaManagedAgentsMemoryType
UpdatedAt Time

A timestamp in RFC 3339 format

formatdate-time
Content string Optional

The memory's UTF-8 text content. Populated when view=full; null when view=basic. Maximum 100 kB (102,400 bytes).

type BetaManagedAgentsMemoryListItemUnion interface{…}

One item in a List memories response: either a memory object or, when depth is set, a memory_prefix rollup marker.

One of the following:
type BetaManagedAgentsMemoryPathConflictError struct{…}
Type BetaManagedAgentsMemoryPathConflictErrorType
ConflictingMemoryID string Optional
ConflictingPath string Optional
Message string Optional
type BetaManagedAgentsMemoryPreconditionFailedError struct{…}
Type BetaManagedAgentsMemoryPreconditionFailedErrorType
Message string Optional
type BetaManagedAgentsMemoryPrefix struct{…}

A rolled-up directory marker returned by List memories when depth is set. Indicates that one or more memories exist deeper than the requested depth under this prefix. This is a list-time rollup, not a stored resource; it has no ID and no lifecycle. Each prefix counts toward the page limit and interleaves with memory items in path order.

Path string

The rolled-up path prefix, including a trailing / (e.g. /projects/foo/). Pass this value as path_prefix on a subsequent list call to drill into the directory.

Type BetaManagedAgentsMemoryPrefixType
type BetaManagedAgentsMemoryView string

Selects which projection of a memory or memory_version the server returns. basic returns the object with content set to null; full populates content. When omitted, the default is endpoint-specific: retrieve operations default to full; list, create, and update operations default to basic. Listing with view=full caps limit at 20.

One of the following:
const BetaManagedAgentsMemoryViewBasic BetaManagedAgentsMemoryView = "basic"
const BetaManagedAgentsMemoryViewFull BetaManagedAgentsMemoryView = "full"
type BetaManagedAgentsPrecondition struct{…}

Optimistic-concurrency precondition: the update applies only if the memory's stored content_sha256 equals the supplied value. On mismatch, the request returns memory_precondition_failed_error (HTTP 409); re-read the memory and retry against the fresh state. If the precondition fails but the stored state already exactly matches the requested content and path, the server returns 200 instead of 409.

Type BetaManagedAgentsPreconditionType
ContentSha256 string Optional

Expected content_sha256 of the stored memory (64 lowercase hexadecimal characters). Typically the content_sha256 returned by a prior read or list call. Because the server applies no content normalization, clients can also compute this locally as the SHA-256 of the UTF-8 content bytes.