메모리 업데이트
메모리 업데이트
Parameters
The ID of the memory to update (mem_...).
params BetaMemoryStoreMemoryUpdateParams
The ID of the memory store that holds the memory (memstore_...).
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.
New UTF-8 text content for the memory. Maximum 100 kB (102,400 bytes). Omit to leave the content unchanged (e.g., for a rename-only update).
Path param.Opt[string] OptionalNew path for the memory (a rename). Must start with /, contain at least one non-empty segment, and be at most 1,024 bytes. Must not contain empty segments, . or .. segments, control or format characters, or the Unicode line and paragraph separators (U+2028, U+2029), and must be NFC-normalized. Paths are case-sensitive. The memory's id is preserved across renames. Omit to leave the path unchanged.
New path for the memory (a rename). Must start with /, contain at least one non-empty segment, and be at most 1,024 bytes. Must not contain empty segments, . or .. segments, control or format characters, or the Unicode line and paragraph separators (U+2028, U+2029), and must be NFC-normalized. Paths are case-sensitive. The memory's id is preserved across renames. Omit to leave the path unchanged.
Optional optimistic-concurrency precondition. When supplied, the update applies only if the memory's current state matches; on mismatch the request returns memory_precondition_failed_error (HTTP 409). When omitted, the update is unconditional.
Betas []AnthropicBeta OptionalHeader parameterThis endpoint is in beta: requests must send agent-memory-2026-07-22 or managed-agents-2026-04-01 in this header.
This endpoint is in beta: requests must send agent-memory-2026-07-22 or managed-agents-2026-04-01 in this header.
WorkspaceID param.Opt[string] OptionalHeader parameterOptional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).
Optional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).
Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.
Returns
type BetaManagedAgentsMemory struct { Type: "memory"; ID; ContentSha256; /* 7 more */ }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.
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.
Unique identifier for this memory (a mem_... value). Stable across renames; use this ID, not the path, to read, update, or delete the memory.
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 int64Size of content in bytes (the UTF-8 plaintext length). Always populated, regardless of view.
Size of content in bytes (the UTF-8 plaintext length). Always populated, regardless of view.
CreatedAt TimeWhen this memory was created, in RFC 3339 format.
When this memory was created, in RFC 3339 format.
ID of the memory store this memory belongs to (a memstore_... value).
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.
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.
UpdatedAt TimeWhen this memory was last modified, in RFC 3339 format. Use this as a cheap freshness signal; for who made the change, look up the head version's created_by via List memory versions.
When this memory was last modified, in RFC 3339 format. Use this as a cheap freshness signal; for who made the change, look up the head version's created_by via List memory versions.
The memory's UTF-8 text content. Populated when view=full; null when view=basic. Maximum 100 kB (102,400 bytes).
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go"
"github.com/anthropics/anthropic-sdk-go/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"),
)
betaManagedAgentsMemory, err := client.Beta.MemoryStores.Memories.Update(
context.TODO(),
"memory_id",
anthropic.BetaMemoryStoreMemoryUpdateParams{
MemoryStoreID: "memory_store_id",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", betaManagedAgentsMemory.ID)
}{
"id": "id",
"content_sha256": "content_sha256",
"content_size_bytes": 0,
"created_at": "2019-12-27T18:11:19.117Z",
"memory_store_id": "memory_store_id",
"memory_version_id": "memory_version_id",
"path": "path",
"type": "memory",
"updated_at": "2019-12-27T18:11:19.117Z",
"content": "content"
}Returns Examples
{
"id": "id",
"content_sha256": "content_sha256",
"content_size_bytes": 0,
"created_at": "2019-12-27T18:11:19.117Z",
"memory_store_id": "memory_store_id",
"memory_version_id": "memory_version_id",
"path": "path",
"type": "memory",
"updated_at": "2019-12-27T18:11:19.117Z",
"content": "content"
}