:doc:`AgentsforBedrockRuntime <../../bedrock-agent-runtime>` / Client / get_agent_memory

****************
get_agent_memory
****************



.. py:method:: AgentsforBedrockRuntime.Client.get_agent_memory(**kwargs)

  

  Gets the sessions stored in the memory of the agent.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/GetAgentMemory>`_  


  **Request Syntax**
  ::

    response = client.get_agent_memory(
        agentAliasId='string',
        agentId='string',
        maxItems=123,
        memoryId='string',
        memoryType='SESSION_SUMMARY',
        nextToken='string'
    )
    
  :type agentAliasId: string
  :param agentAliasId: **[REQUIRED]** 

    The unique identifier of an alias of an agent.

    

  
  :type agentId: string
  :param agentId: **[REQUIRED]** 

    The unique identifier of the agent to which the alias belongs.

    

  
  :type maxItems: integer
  :param maxItems: 

    The maximum number of items to return in the response. If the total number of results is greater than this value, use the token returned in the response in the ``nextToken`` field when making another request to return the next batch of results.

    

  
  :type memoryId: string
  :param memoryId: **[REQUIRED]** 

    The unique identifier of the memory.

    

  
  :type memoryType: string
  :param memoryType: **[REQUIRED]** 

    The type of memory.

    

  
  :type nextToken: string
  :param nextToken: 

    If the total number of results is greater than the maxItems value provided in the request, enter the token returned in the ``nextToken`` field in the response in this field to return the next batch of results.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'memoryContents': [
              {
                  'sessionSummary': {
                      'memoryId': 'string',
                      'sessionExpiryTime': datetime(2015, 1, 1),
                      'sessionId': 'string',
                      'sessionStartTime': datetime(2015, 1, 1),
                      'summaryText': 'string'
                  }
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **memoryContents** *(list) --* 

        Contains details of the sessions stored in the memory

        
        

        - *(dict) --* 

          Contains sessions summaries.

          .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``sessionSummary``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                    'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


        
          

          - **sessionSummary** *(dict) --* 

            Contains summary of a session.

            
            

            - **memoryId** *(string) --* 

              The unique identifier of the memory where the session summary is stored.

              
            

            - **sessionExpiryTime** *(datetime) --* 

              The time when the memory duration for the session is set to end.

              
            

            - **sessionId** *(string) --* 

              The identifier for this session.

              
            

            - **sessionStartTime** *(datetime) --* 

              The start time for this session.

              
            

            - **summaryText** *(string) --* 

              The summarized text for this session.

              
        
      
    
      

      - **nextToken** *(string) --* 

        If the total number of results is greater than the maxItems value provided in the request, use this token when making another request in the ``nextToken`` field to return the next batch of results.

        
  
  **Exceptions**
  
  *   :py:class:`AgentsforBedrockRuntime.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`AgentsforBedrockRuntime.Client.exceptions.ConflictException`

  
  *   :py:class:`AgentsforBedrockRuntime.Client.exceptions.ValidationException`

  
  *   :py:class:`AgentsforBedrockRuntime.Client.exceptions.InternalServerException`

  
  *   :py:class:`AgentsforBedrockRuntime.Client.exceptions.DependencyFailedException`

  
  *   :py:class:`AgentsforBedrockRuntime.Client.exceptions.BadGatewayException`

  
  *   :py:class:`AgentsforBedrockRuntime.Client.exceptions.ThrottlingException`

  
  *   :py:class:`AgentsforBedrockRuntime.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`AgentsforBedrockRuntime.Client.exceptions.ServiceQuotaExceededException`

  