# sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking architecture

> Architecture diagram of the GitHub repository sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking
- Repository: https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking

## Overview

This repository benchmarks one Strands weather agent deployed on AgentCore Runtime V1 and V2. The principal workflow is a client request through the runtime to the agent, which obtains live weather through Gateway-hosted Lambda tools and returns an answer; conversation history is optional session memory. Separate benchmark scripts exercise multi-city questions and analyze runtime performance, usage, and cost. The sampled source confirms core agent, tool, and infrastructure wiring; benchmark internals are represented from README descriptions because those files were not sampled.

Main entry points: [`infra/stack.py`](https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/infra/stack.py) (CDK resources), [`agent/entrypoint.py`](https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/agent/entrypoint.py) (Weather agent), [`lambda/handler.py`](https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/lambda/handler.py) (Tool dispatcher), [`bench/questions.py`](https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/bench/questions.py) (Question benchmark)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Agent runtime"]
  node_runtime_v1["Runtime V1"]
  node_runtime_v2["Runtime V2"]
  node_agent["Weather agent<br/>[entrypoint.py]"]
  node_gateway_client["MCP client<br/>[gateway_client.py]"]
  node_memory[("Session memory")]
  node_model["Claude Haiku"]
end

subgraph group_weather["Weather tools"]
  node_gateway["AgentCore Gateway"]
  node_tool_handler["Tool dispatcher<br/>[handler.py]"]
  node_geocoding["City geocoding<br/>[weather.py]"]
  node_forecast["Current forecast<br/>[weather.py]"]
  node_temperature["Temperature conversion<br/>[weather.py]"]
  node_open_meteo["Open-Meteo"]
end

subgraph group_benchmark["Benchmark analysis"]
  node_benchmark_runner["Question benchmark<br/>[questions.py]"]
  node_bench_run["Benchmark runner<br/>[run.py]"]
  node_usage_analysis["Usage and cost<br/>[usage.py]"]
  node_cloudwatch[("CloudWatch observability")]
end

subgraph group_deployment["AWS deployment"]
  node_deployment["CDK resources<br/>[stack.py]"]
end

node_client(("Client"))

node_client -->|"invokes"| node_runtime_v1
node_client -->|"invokes"| node_runtime_v2
node_runtime_v1 -->|"serves"| node_agent
node_runtime_v2 -->|"serves"| node_agent
node_agent -->|"creates client"| node_gateway_client
node_agent -->|"prompts"| node_model
node_agent -->|"loads and saves turns"| node_memory
node_gateway_client -->|"calls MCP tools"| node_gateway
node_gateway -->|"dispatches tools"| node_tool_handler
node_tool_handler -->|"dispatches"| node_geocoding
node_tool_handler -->|"dispatches"| node_forecast
node_tool_handler -->|"dispatches"| node_temperature
node_geocoding -->|"requests geocoding"| node_open_meteo
node_forecast -->|"requests forecast"| node_open_meteo
node_benchmark_runner -->|"benchmarks"| node_runtime_v1
node_benchmark_runner -->|"benchmarks"| node_runtime_v2
node_bench_run -.->|"runs calls"| node_runtime_v1
node_bench_run -.->|"runs calls"| node_runtime_v2
node_usage_analysis -->|"reads billed usage"| node_cloudwatch
node_benchmark_runner -->|"analyzes results"| node_usage_analysis
node_deployment -->|"configures"| node_runtime_v1
node_deployment -->|"configures"| node_runtime_v2
node_deployment -->|"configures"| node_gateway
node_deployment -->|"deploys Lambda"| node_tool_handler
node_deployment -->|"provisions"| node_memory
node_deployment -->|"enables traces and logs"| node_cloudwatch

click node_agent "https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/agent/entrypoint.py"
click node_gateway_client "https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/agent/gateway_client.py"
click node_tool_handler "https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/lambda/handler.py"
click node_geocoding "https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/lambda/weather.py"
click node_forecast "https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/lambda/weather.py"
click node_temperature "https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/lambda/weather.py"
click node_benchmark_runner "https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/bench/questions.py"
click node_bench_run "https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/bench/run.py"
click node_usage_analysis "https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/bench/usage.py"
click node_deployment "https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/infra/stack.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_runtime_v1,node_runtime_v2,node_agent,node_gateway_client,node_memory,node_model,node_client toneBlue
class node_gateway,node_tool_handler,node_geocoding,node_forecast,node_temperature,node_open_meteo toneAmber
class node_benchmark_runner,node_bench_run,node_usage_analysis,node_cloudwatch toneMint
class node_deployment toneRose
```

## Components

### Agent runtime

- **Runtime V1**
- **Runtime V2**
- [Weather agent](https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/agent/entrypoint.py): `agent/entrypoint.py`
- [MCP client](https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/agent/gateway_client.py): `agent/gateway_client.py`
- **Session memory**
- **Claude Haiku**

### Weather tools

- **AgentCore Gateway**
- [Tool dispatcher](https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/lambda/handler.py): `lambda/handler.py`
- [City geocoding](https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/lambda/weather.py): `lambda/weather.py`
- [Current forecast](https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/lambda/weather.py): `lambda/weather.py`
- [Temperature conversion](https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/lambda/weather.py): `lambda/weather.py`
- **Open-Meteo**

### Benchmark analysis

- [Question benchmark](https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/bench/questions.py): `bench/questions.py`
- [Benchmark runner](https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/bench/run.py): `bench/run.py`
- [Usage and cost](https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/bench/usage.py): `bench/usage.py`
- **CloudWatch observability**

### AWS deployment

- [CDK resources](https://github.com/sanjayvs-shellkode/aws-agentcode-runtime-v2-benchmarking/blob/main/infra/stack.py): `infra/stack.py`

### Other components

- **Client**

## Connections

- Client → Runtime V1: invokes (evidence: `README.md`)
- Client → Runtime V2: invokes (evidence: `README.md`)
- Runtime V1 → Weather agent: serves
- Runtime V2 → Weather agent: serves
- Weather agent → MCP client: creates client (evidence: `agent/entrypoint.py`)
- Weather agent → Claude Haiku: prompts (evidence: `README.md`)
- Weather agent → Session memory: loads and saves turns (evidence: `README.md`)
- MCP client → AgentCore Gateway: calls MCP tools (evidence: `README.md`)
- AgentCore Gateway → Tool dispatcher: dispatches tools (evidence: `README.md`)
- Tool dispatcher → City geocoding: dispatches (evidence: `lambda/handler.py`)
- Tool dispatcher → Current forecast: dispatches (evidence: `lambda/handler.py`)
- Tool dispatcher → Temperature conversion: dispatches (evidence: `lambda/handler.py`)
- City geocoding → Open-Meteo: requests geocoding (evidence: `README.md`)
- Current forecast → Open-Meteo: requests forecast (evidence: `README.md`)
- Question benchmark → Runtime V1: benchmarks (evidence: `README.md`)
- Question benchmark → Runtime V2: benchmarks (evidence: `README.md`)
- Benchmark runner → Runtime V1: runs calls
- Benchmark runner → Runtime V2: runs calls
- Usage and cost → CloudWatch observability: reads billed usage (evidence: `README.md`)
- Question benchmark → Usage and cost: analyzes results (evidence: `README.md`)
- CDK resources → Runtime V1: configures (evidence: `infra/stack.py`)
- CDK resources → Runtime V2: configures (evidence: `infra/stack.py`)
- CDK resources → AgentCore Gateway: configures (evidence: `infra/stack.py`)
- CDK resources → Tool dispatcher: deploys Lambda (evidence: `infra/stack.py`)
- CDK resources → Session memory: provisions (evidence: `infra/stack.py`)
- CDK resources → CloudWatch observability: enables traces and logs (evidence: `README.md`)
