Skip to main content

memory_versions

Creates, updates, deletes, gets or lists a memory_versions resource.

Overview

Namememory_versions
TypeResource
Idanthropic.memory_stores.memory_versions

Fields

The following fields are returned by SELECT queries:

Successful response (OK)

NameDatatypeDescription
idstringUnique identifier for this version (a `memver_...` value).
memory_idstringID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to [List memory versions](/en/api/beta/memory_stores/memory_versions/list) to retrieve the full lineage including the `deleted` row.
memory_store_idstringID of the memory store this version belongs to (a `memstore_...` value).
contentstringThe memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set.
content_sha256stringLowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.
content_size_bytesinteger (int32)Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.
created_atstring (date-time)When this version was written, in RFC 3339 format.
created_byobjectWho performed this write: a `session_actor`, `api_actor`, or `user_actor`. Captured at write time and preserved through redaction.
operationstringThe kind of mutation this version records: `created`, `modified`, or `deleted`. (created, modified, deleted)
pathstringThe memory's path at the time of this write. `null` if and only if `redacted_at` is set.
redacted_atstring (date-time)When this version was redacted, in RFC 3339 format, or `null` if it has not been redacted. When set, `content`, `path`, `content_size_bytes`, and `content_sha256` are all `null`. See [Redact a memory version](/en/api/beta/memory_stores/memory_versions/redact).
redacted_byobjectWho redacted this version, or `null` if it has not been redacted. In practice always an `api_actor` or `user_actor` (agents do not have a redact capability).
typestring (memory_version)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectmemory_store_id, memory_version_idview
listselectmemory_store_idmemory_id, session_id, api_key_id, operation, created_at[gte], created_at[lte], view
redactexecmemory_store_id, memory_version_id

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
memory_store_idstringPath parameter memory_store_id
memory_version_idstringPath parameter memory_version_id
api_key_idstringQuery parameter for api_key_id
created_at[gte]string (date-time)Return versions created at or after this time (inclusive).
created_at[lte]string (date-time)Return versions created at or before this time (inclusive).
memory_idstringQuery parameter for memory_id
operationstringQuery parameter for operation
session_idstringQuery parameter for session_id
viewstringQuery parameter for view

SELECT examples

Successful response (OK)

SELECT
id,
memory_id,
memory_store_id,
content,
content_sha256,
content_size_bytes,
created_at,
created_by,
operation,
path,
redacted_at,
redacted_by,
type
FROM anthropic.memory_stores.memory_versions
WHERE memory_store_id = '{{ memory_store_id }}' -- required
AND memory_version_id = '{{ memory_version_id }}' -- required
AND view = '{{ view }}'
;

Lifecycle Methods

Successful response (OK)

EXEC anthropic.memory_stores.memory_versions.redact
@memory_store_id='{{ memory_store_id }}' --required,
@memory_version_id='{{ memory_version_id }}' --required
;