OpenSearchMemory / Client / get_memory
get_memory¶
- OpenSearchMemory.Client.get_memory(**kwargs)¶
Gets a memory by ID, as returned by
SearchMemoriesorListMemories. A memory that doesn’t exist returnsResourceNotFoundException. UnlikeSearchMemories, this operation also returns memories that consolidation has superseded.A memory past its expiry (set from the space’s
memoryExpiryDayswhen the memory is written) reads as not found:ResourceNotFoundException, the same answer as for an ID that does not exist.If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with
AccessDeniedExceptionif you aren’t allowed to use the key, and withThrottlingExceptionif AWS KMS throttles the request. It fails withValidationExceptionif the key is disabled, pending deletion, or deleted.See also: AWS API Documentation
Request Syntax
response = client.get_memory( spaceId='string', memoryId='string', actorId='string', strategyName='string' )
- Parameters:
spaceId (string) –
[REQUIRED]
The ID of the space that holds the memory.
memoryId (string) –
[REQUIRED]
The memory’s ID, as returned by
SearchMemoriesorListMemories.actorId (string) – The ID of the actor the memory must belong to. Omit it to skip this check. If it doesn’t match the stored memory, the call fails with
ResourceNotFoundException, as if the memory did not exist.strategyName (string) – The name of the strategy the memory must belong to. Omit it to skip this check. If it doesn’t match the stored memory, the call fails with
ResourceNotFoundException, as if the memory did not exist.
- Return type:
dict
- Returns:
Response Syntax
{ 'memory': { 'memoryId': 'string', 'memoryType': 'SEMANTIC'|'SUMMARY'|'CUSTOM', 'strategyName': 'string', 'content': 'string', 'systemMetadata': { 'actorId': 'string', 'sessionId': 'string', 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1) }, 'metadata': { 'string': 'string' } } }
Response Structure
(dict) –
memory (dict) –
The memory. Always present: a memory that doesn’t exist returns
ResourceNotFoundException.memoryId (string) –
The memory’s ID, assigned by the service.
memoryType (string) –
The memory type.
strategyName (string) –
The name of the strategy the memory belongs to, for example
user-facts. A space can hold several strategies of the same type, so this tells them apart. Absent when the memory’s strategy is no longer declared on the space, for example right after the strategy is deleted.content (string) –
The memory text.
systemMetadata (dict) –
Provenance for the memory: the owning actor and session, and when it was created and last updated. Always present.
updatedAtequalscreatedAtfor a memory that has never been updated.actorId (string) –
The owning actor. Absent when none was recorded.
sessionId (string) –
The owning session. Absent when none was recorded.
createdAt (datetime) –
When the record was created. Always present on
ListMemoriesandGetMemory. It can be absent from search results.updatedAt (datetime) –
When the record was last updated. Equals
createdAtfor a record that has never been updated, and always for aSearchEventsresult.
metadata (dict) –
The memory’s metadata tags. All values are strings. May be empty.
(string) –
A metadata key: letters, digits, hyphens (
-), and underscores (_). Dots are not allowed, because a query uses dots to separate nested field names.(string) –
The value of a metadata entry.
Exceptions
OpenSearchMemory.Client.exceptions.ResourceNotFoundExceptionOpenSearchMemory.Client.exceptions.AccessDeniedExceptionOpenSearchMemory.Client.exceptions.ThrottlingExceptionOpenSearchMemory.Client.exceptions.InternalServerExceptionOpenSearchMemory.Client.exceptions.ValidationException