dendilaws 8f34263946
fixed issues with streamablehttp_client with timeout values & agent.tool_config (#192)
* updated to Sonnet 3.7

updated to Sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* uodated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* fixed the issue related to passing timeout value to the streamablehttp_client

Signed-off-by: dendilaws <dendilaws@gmail.com>

* fixed the issue with agent.tool_config

Signed-off-by: dendilaws <dendilaws@gmail.com>

* fixed the issue with agent.tool_config

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to pip install from uv

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to pip install from uv add

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to pip install from uv add

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to pip install from uv add

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to pip install from uv add

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to pip install from uv add

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to pip install from uv add

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to pip install from uv add

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to pip install from uv add

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to pip install from uv add

Signed-off-by: dendilaws <dendilaws@gmail.com>

* updated to pip install from uv add

Signed-off-by: dendilaws <dendilaws@gmail.com>

* overriding the default model used for the agent with sonnet 3.7

Signed-off-by: dendilaws <dendilaws@gmail.com>

* Changing runtime to role auto creation

* Changing runtime to role auto creation

* Changing mcp host on runtime to role auto creation

* Changing advance labs on runtime to role auto creation

---------

Signed-off-by: dendilaws <dendilaws@gmail.com>
Co-authored-by: Maira Ladeira Tanke <mttanke@amazon.com>
2025-08-04 21:15:01 -04:00
..
2025-07-21 09:26:13 -04:00

Understanding Runtime Context and Session Management in AgentCore Runtime

Overview

In this tutorial, we will learn how to understand and work with runtime context and session management in Amazon Bedrock AgentCore Runtime. This example demonstrates how AgentCore Runtime handles sessions, maintains context across multiple invocations, and how agents can access runtime information through the context object.

Amazon Bedrock AgentCore Runtime provides isolated sessions for each user interaction, enabling agents to maintain context and state across multiple invocations while ensuring complete security isolation between different users.

Tutorial Details

Information Details
Tutorial type Context and Session Management
Agent type Single
Agentic Framework Strands Agents
LLM model Anthropic Claude Sonnet 3.7
Tutorial components Runtime Context, Session Management, AgentCore Runtime, Strands Agent and Amazon Bedrock Model
Tutorial vertical Cross-vertical
Example complexity Intermediate
SDK used Amazon BedrockAgentCore Python SDK and boto3

Tutorial Architecture

In this tutorial, we will explore how Amazon Bedrock AgentCore Runtime manages sessions and provides context to agents. We'll demonstrate:

  1. Session Continuity: How the same session ID maintains context across multiple invocations
  2. Context Object: How agents can access runtime information through the context parameter
  3. Session Isolation: How different session IDs create completely isolated environments
  4. Payload Flexibility: How to pass custom data to agents through the payload

For demonstration purposes, we will use a Strands Agent that showcases these session management capabilities.

Tutorial Key Features

  • Session-based Context Management: Understanding how AgentCore Runtime maintains context within sessions
  • Runtime Session Lifecycle: Learning about session creation, maintenance, and termination
  • Context Object Access: Accessing runtime information like session ID through the context parameter
  • Session Isolation: Demonstrating how different sessions provide complete isolation
  • Payload Handling: Flexible data passing through custom payload structures
  • Cross-invocation State: Maintaining agent state across multiple calls within the same session