<a id="cli-aws-opensearchmemory-update-space"></a>

# update-space

## Description

Updates a space’s memory strategies, retention settings, or extraction model. Supply only the fields to change. Omitted fields keep their current values.

If the request changes the set of strategies, a strategy’s configuration, a retention setting, or the extraction model, the space moves to `UPDATING` . When the change is complete, the space returns to `ACTIVE` , or moves to `FAILED` if the change can’t be applied. While the space is `UPDATING` , `GetSpace` returns the previous configuration. A request that only changes strategy descriptions or repeats the values the space has stored is applied immediately and doesn’t change the status. Sending a retention value that the space never set also moves the space to `UPDATING` , even one that matches the behavior without it, such as 90 for `eventExpiryDays` or 0 for `memoryExpiryDays` . A space that is `CREATING` , `UPDATING` , or `DELETING` can’t be updated: the request fails with `ConflictException` .

See also: [AWS API Documentation](https://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/UpdateSpace)

## Synopsis

```
  update-space
--space-id <value>
[--memory-strategies <value>]
[--event-expiry-days <value>]
[--memory-expiry-days <value>]
[--extraction-model-id <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
[--help]
```

## Options

`--space-id` (string) [required]

> The ID of the space to update.

> Constraints:

> * min: `1`
> * max: `64`
> * pattern: `sp-[a-f0-9]{12}`

`--memory-strategies` (list)

> The complete new list of memory strategies. The service removes strategies that aren’t in the list from the space. Removing a strategy stops extraction for it but doesn’t delete its memories: they’re kept, until they expire if the space sets `memoryExpiryDays` , and they’re available again if you later add a strategy with the same `type` and `name` . To delete them, use `DeleteMemory` before you remove the strategy, or delete the space.

> To keep a strategy, include it with the same `type` and `name` that `GetSpace` returns. For a kept strategy, any `configuration` member you omit keeps its current value. It doesn’t return to the default, and you can’t clear a member once it’s set. Omit this field to leave the strategies unchanged. The list must name at least one strategy. You can’t remove every strategy from a space with `UpdateSpace` .

> The serialized list can be at most 384 KiB.

> Constraints:

> * min: `0`
> * max: `10`

> (structure)

> > A memory strategy: how a space extracts one kind of memory from its events.

> > type -> (string) [required]

> > > The type of memory the strategy extracts.

> > > Possible values:

> > > * `SEMANTIC`
> > > * `SUMMARY`
> > > * `CUSTOM`

> > name -> (string)

> > > A name for the strategy, unique within the space. Omit it to have the service generate one from the type, for example `semantic_1` . The name must be 1 to 64 characters: letters, digits, periods, hyphens, and underscores, starting with a letter or digit. A strategy’s name can’t be changed, and the strategy’s memories are stored under it: a strategy added under a new name starts with no memories.

> > > Constraints:

> > > * min: `1`
> > > * max: `64`
> > > * pattern: `[A-Za-z0-9][A-Za-z0-9_.-]*`

> > description -> (string)

> > > A description of the strategy.

> > > Constraints:

> > > * min: `1`
> > > * max: `4096`

> > configuration -> (structure)

> > > Settings for the strategy. When you create a strategy, omit it to use the defaults for the strategy’s type.

> > > A `CUSTOM` strategy must set `extractionPrompt` .

> > > extractionPrompt -> (string)

> > > > Instructions that define what a `CUSTOM` strategy extracts, up to 30,720 characters. Required for a `CUSTOM` strategy: `CreateSpace` and `UpdateSpace` fail with `ValidationException` if a `CUSTOM` strategy has none.

> > > > Only `CUSTOM` strategies use it. `SEMANTIC` and `SUMMARY` strategies always extract with the service’s built-in instructions: the service accepts and stores a prompt on them, and `GetSpace` returns it, but extraction doesn’t use it.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `30720`

> > > extractEveryNMessages -> (integer)

> > > > Extract once this many messages have accumulated, from 1 to 1000. Lower values extract more often, in smaller batches. The default is 12.

> > > > Messages accumulate until the first of `extractEveryNMessages` , `extractEveryNTokens` , and `idleTimeoutSeconds` is reached. The service then extracts them together in one pass.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `1000`

> > > extractEveryNTokens -> (integer)

> > > > Extract once this many tokens of conversation have accumulated, from 1 to 80,000, however few messages that takes. Use it to bound how much text one extraction call carries when message sizes vary widely. Omit it to bound a batch only by `extractEveryNMessages` , `idleTimeoutSeconds` , and the service’s maximum batch size.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `80000`

> > > idleTimeoutSeconds -> (integer)

> > > > Extract what has accumulated once the conversation has been idle for this many seconds, from 1 to 86,400. The default is 60. This is what extracts the end of a conversation that stops. Raise it when the pauses in your conversations are longer than that, so that one exchange isn’t split across several extraction passes.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `86400`

> > > extractionSeedTopK -> (integer)

> > > > How many of the strategy’s stored memories that are most relevant to the conversation to include in the extraction prompt, from 0 to 20, to improve extraction and reduce duplicates. If you omit this or set it to 0, the service uses its default (see `extractionSeedRecentN` ). When this and `extractionSeedRecentN` are both set, the two sets of memories are combined without duplicates.

> > > > Constraints:

> > > > * min: `0`
> > > > * max: `20`

> > > extractionSeedRecentN -> (integer)

> > > > How many of the strategy’s most recent stored memories to include in the extraction prompt, from 0 to 20. If you omit this or set it to 0, the service uses its default: no seeding for most strategy types, and the 10 most recent memories for a `SUMMARY` strategy when neither seed setting is given. When this and `extractionSeedTopK` are both set, the two sets of memories are combined without duplicates.

> > > > Constraints:

> > > > * min: `0`
> > > > * max: `20`

> > > consolidationEnabled -> (boolean)

> > > > Specifies whether the strategy consolidates memories. With consolidation, each new memory is compared with similar stored memories, and the service adds it, updates a stored memory, or skips it, so duplicate or contradicting facts don’t accumulate. Without it, every extracted memory is stored as a new memory, which costs less and keeps a full history.

> > > > When omitted, the default depends on the strategy’s type: on for `SEMANTIC` and `SUMMARY` , off for `CUSTOM` .

Shorthand Syntax:

```
type=string,name=string,description=string,configuration={extractionPrompt=string,extractEveryNMessages=integer,extractEveryNTokens=integer,idleTimeoutSeconds=integer,extractionSeedTopK=integer,extractionSeedRecentN=integer,consolidationEnabled=boolean} ...
```

JSON Syntax:

```json
[
  {
    "type": "SEMANTIC"|"SUMMARY"|"CUSTOM",
    "name": "string",
    "description": "string",
    "configuration": {
      "extractionPrompt": "string",
      "extractEveryNMessages": integer,
      "extractEveryNTokens": integer,
      "idleTimeoutSeconds": integer,
      "extractionSeedTopK": integer,
      "extractionSeedRecentN": integer,
      "consolidationEnabled": true|false
    }
  }
  ...
]
```

`--event-expiry-days` (integer)

> How many days the space keeps each event, from 1 to 365. Omit it to leave the current value unchanged. Events already stored keep the expiry they were written with.

> Constraints:

> * min: `1`
> * max: `365`

`--memory-expiry-days` (integer)

> How many days the space keeps each memory, from 0 to 3650. 0 means memories never expire. Omit it to leave the current value unchanged. You can’t clear the setting. To make memories written from then on never expire, send 0. `GetSpace` then returns 0.

> A change applies to memories written after it. Memories already stored keep the expiry they were written with. A memory the service rewrites later, such as a summary it keeps up to date, takes the setting in force at that rewrite. A change moves the space to `UPDATING` . Sending the value that the space has stored doesn’t.

> Constraints:

> * min: `0`
> * max: `3650`

`--extraction-model-id` (string)

> The model that extracts and consolidates memories for every strategy in the space: `anthropic.claude-opus-5-5` or `anthropic.claude-haiku-5-5` . Omit it to leave the current value unchanged. Once set, it can’t be cleared back to the service default.

> Constraints:

> * min: `1`
> * max: `128`
> * pattern: `[a-zA-Z0-9][a-zA-Z0-9._:-]*`

`--cli-input-json` | `--cli-input-yaml` (string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by `--generate-cli-skeleton`. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with `--cli-input-yaml`.

`--generate-cli-skeleton` (string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value `input`, prints a sample input JSON that can be used as an argument for `--cli-input-json`. Similarly, if provided `yaml-input` it will print a sample input YAML that can be used with `--cli-input-yaml`. If provided with the value `output`, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.

## Global Options

`--debug` (boolean)

Turn on debug logging.

`--endpoint-url` (string)

Override command’s default URL with the given URL.

`--no-verify-ssl` (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

`--no-paginate` (boolean)

Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.

`--output` (string)

The formatting style for command output.

* json
* text
* table
* yaml
* yaml-stream
* off

`--query` (string)

A JMESPath query to use in filtering the response data.

`--profile` (string)

Use a specific profile from your credential file.

`--region` (string)

The region to use. Overrides config/env settings.

`--version` (string)

Display the version of this tool.

`--color` (string)

Turn on/off color output.

* on
* off
* auto

`--no-sign-request` (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

`--ca-bundle` (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

`--cli-read-timeout` (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

`--cli-connect-timeout` (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

`--cli-binary-format` (string)

The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob `fileb://` will always be treated as binary and use the file contents directly regardless of the `cli-binary-format` setting. When using `file://` the file contents will need to properly formatted for the configured `cli-binary-format`.

* base64
* raw-in-base64-out

`--no-cli-pager` (boolean)

Disable cli pager for output.

`--cli-auto-prompt` (boolean)

Automatically prompt for CLI input parameters.

`--no-cli-auto-prompt` (boolean)

Disable automatically prompt for CLI input parameters.

`--cli-error-format` (string)

The formatting style for error output. By default, errors are displayed in enhanced format.

* legacy
* json
* yaml
* text
* table
* enhanced

`--help` (boolean)

Display help for the command/subcommand.

## Output

spaceId -> (string)

> The ID of the space.

> Constraints:

> * min: `1`
> * max: `64`
> * pattern: `sp-[a-f0-9]{12}`

status -> (string)

> The status of the space: `UPDATING` when the change has to be applied to the space’s strategies, retention, or extraction model. Otherwise, the space’s current status.

> Possible values:

> * `CREATING`
> * `ACTIVE`
> * `UPDATING`
> * `DELETING`
> * `DELETED`
> * `FAILED`
