Class MemoryCreateParams
-
- All Implemented Interfaces:
-
com.anthropic.core.Params
public final class MemoryCreateParams implements Params
Create a Memory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classMemoryCreateParams.BuilderA builder for MemoryCreateParams.
public final classMemoryCreateParams.BodyThe request body for Create a Memory.
Creating a memory never replaces another one. The request fails with HTTP status 409 if a memory already uses
path, or ifpathis an ancestor or descendant of another memory's path. It also fails, with HTTP status 400, if the memory store is archived or has reached its limit of 10,000 memories. To change an existing memory, update it instead.See the memory guide to learn more about creating memories.
-
Method Summary
Modifier and Type Method Description final Optional<String>memoryStoreId()The ID of the memory store to create the memory in ( memstore_...).final Optional<BetaManagedAgentsMemoryView>view()Whether a memoryormemory_versionin the response includes itscontent.final Optional<List<AnthropicBeta>>betas()This endpoint is in beta: requests must send agent-memory-2026-07-22ormanaged-agents-2026-04-01in this header.final Optional<String>workspaceId()Optional header to select the Workspace for this request. final Optional<String>content()The UTF-8 text content of the new memory. final Stringpath()The path of the new memory, such as /projects/foo/notes.md.final JsonField<String>_content()Returns the raw JSON value of content. final JsonField<String>_path()Returns the raw JSON value of path. final Map<String, JsonValue>_additionalBodyProperties()final Headers_additionalHeaders()Additional headers to send with the request. final QueryParams_additionalQueryParams()Additional query param to send with the request. final MemoryCreateParams.BuildertoBuilder()final MemoryCreateParams.Body_body()final String_pathParam(Integer index)Headers_headers()The full set of headers in the parameters, including both fixed and additional headers. QueryParams_queryParams()The full set of query params in the parameters, including both fixed and additional query params. SpanData_spanData()The data for the OpenTelemetry span of a call to the method with these parameters. Booleanequals(Object other)IntegerhashCode()StringtoString()final static MemoryCreateParams.Builderbuilder()Returns a mutable builder for constructing an instance of MemoryCreateParams. -
-
Method Detail
-
memoryStoreId
final Optional<String> memoryStoreId()
The ID of the memory store to create the memory in (
memstore_...).
-
view
final Optional<BetaManagedAgentsMemoryView> view()
Whether a
memoryormemory_versionin the response includes itscontent. Defaults tofullon retrieve operations and tobasicon list, create, and update operations.With
full, list operations return at most 20 items per page.
-
betas
final Optional<List<AnthropicBeta>> betas()
This endpoint is in beta: requests must send
agent-memory-2026-07-22ormanaged-agents-2026-04-01in this header.
-
workspaceId
final Optional<String> workspaceId()
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.
-
content
final Optional<String> content()
The UTF-8 text content of the new memory. Pass
""to create an empty memory.The maximum size is 100 kB (102,400 bytes).
-
path
final String path()
The path of the new memory, such as
/projects/foo/notes.md. Paths are case-sensitive.A path starts with
/and has 1 to 20 segments. A segment can't be empty and can't be.or... A path can't contain control characters, format characters, or the line and paragraph separators U+2028 and U+2029. It must be in Unicode Normalization Form C and at most 1,024 bytes long.
-
_content
final JsonField<String> _content()
Returns the raw JSON value of content.
Unlike content, this method doesn't throw if the JSON field has an unexpected type.
-
_path
final JsonField<String> _path()
Returns the raw JSON value of path.
Unlike path, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalBodyProperties
final Map<String, JsonValue> _additionalBodyProperties()
-
_additionalHeaders
final Headers _additionalHeaders()
Additional headers to send with the request.
-
_additionalQueryParams
final QueryParams _additionalQueryParams()
Additional query param to send with the request.
-
toBuilder
final MemoryCreateParams.Builder toBuilder()
-
_body
final MemoryCreateParams.Body _body()
-
_pathParam
final String _pathParam(Integer index)
-
_headers
Headers _headers()
The full set of headers in the parameters, including both fixed and additional headers.
-
_queryParams
QueryParams _queryParams()
The full set of query params in the parameters, including both fixed and additional query params.
-
_spanData
SpanData _spanData()
The data for the OpenTelemetry span of a call to the method with these parameters.
-
builder
final static MemoryCreateParams.Builder builder()
Returns a mutable builder for constructing an instance of MemoryCreateParams.
The following fields are required:
.content() .path()
-
-
-
-