Skip to content

[FEATURE] Avoid initializing boto client every single time for S3SessionManager and AgentCore memory. #1163

@CrysisDeu

Description

@CrysisDeu

Problem Statement

This issue also exist with AgentCore memory

There are a couple issues with the S3SessionManager:

  • There is no way to pass an S3SessionManager into the class. A new boto3 s3 client is created every single time.
  • The sessionManager class is tied to a sessionId upon initialization. There is no way to update it afterwards. It means there is no way to save a singleton class.

These issue results in added latency for every single agent conversation turn and should be considered anti-patterns.

Proposed Solution

  • Let client pass in an S3 client, only create a new one if None is passed in
  • Allow the S3SessionManager to be used as a singleton and can be invoked/set to different sessionIds

Use Case

Using strands with S3Session manager or AgentCore memory

Alternatives Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions