Skip to content

Conversation

@JordanHanley
Copy link

@JordanHanley JordanHanley commented Dec 10, 2025

Overview

Small change to the Strands agent wrapper to allow usage of the session manager for conversation persistence and loading

Sample Usage

    MEM_ID = "test-mem-id"
    ACTOR_ID = "actor_id_test_%s" % datetime.now().strftime("%Y%m%d%H%M%S")
    SESSION_ID = "testing_session_id_%s" % datetime.now().strftime("%Y%m%d%H%M%S")


    # Create agent
    agent = Agent(
        model=load_model(),
        system_prompt="""
            You are a helpful assistant with code execution capabilities. Use tools when appropriate.
        """,
        tools=[code_interpreter.code_interpreter, add_numbers] + tools
    )

    def create_session_manager(input: RunAgentInput):
        agentcore_memory_config = AgentCoreMemoryConfig(
            memory_id=MEM_ID,
            session_id=input.thread_id,
            actor_id=input.forwarded_props["username"],
        )

        return AgentCoreMemorySessionManager(
            agentcore_memory_config=agentcore_memory_config,
            region_name="us-east-1"
        )


    return StrandsAgent(
        agent=agent,
        name="ag_ui_wrapper",
        config=StrandsAgentConfig(
            session_manager_provider=create_session_manager
        )
    )

@vercel
Copy link

vercel bot commented Dec 10, 2025

Someone is attempting to deploy a commit to the CopilotKit Team on Vercel.

A member of the Team first needs to authorize it.

@tylerslaton tylerslaton mentioned this pull request Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant