Deploying and Running Google ADK Agent on Amazon Bedrock AgentCore

2 hours ago 2

Sudip Mishra

When I started my journey as a developer, I treated my backend application servers as pets. My first production application was a complex Java monolith. I took care of it, worried about its runtime, the resources it consumed, and how to scale it. Security, observability, and access to resources were constant challenges.

Fast forward a few years, and with the advent of containers and serverless paradigms, I learned to orchestrate, run, manage and monitor tens of thousands of services in production. We now treated services as cattle, not pets, managing the herd instead of nurturing individuals.

When I look at how businesses are approaching Agentic AI, I see a familiar pattern. We are treating agentic applications like pets, worrying about their individual runtimes, resource access, identity, service discovery, memory, and security. We are all exploring what’s the most effective way to scale and manage hundreds of agents, especially in production.

This is why I’m exploring Amazon Bedrock AgentCore. It’s a platform designed to deploy, operate, and manage herds of agents at scale, shifting the paradigm from pets to cattle for Agentic AI. It allows developers to bring agents built with standard frameworks and run them in a secure, scalable production environment with minimal operational overhead.

The so what for enterprises are the developers now focus more on building the agents and all the undifferentiated heavy lifting to run those agents in production at scale is taken care of. This translates to accelerated production, AI Ops at scale, secure Agents, traceability and observability to understand how Agents are performing, and more importantly, it allows companies from running a dozen of so agents in production to be able to run hundreds or thousands of agents at scale.

The Challenge: Why Running Agents Feels Like a Step Backwards

Contextually, it helps to see Agentic AI applications same as our existing workloads in production, with more intelligence. One one hand, most of the requirements are the same: running in isolated runtimes, scalability, service discovery, secure access to resources, identity (both for humans interacting with the agent, and the agent interacting with other backend services), and observability. On the other hand, the intelligence is powered by access to LLMs (gateway), and access to short-term and long-term memory.

These aspects of traditional application + components that make an app truly “agentic” are baked into the components of Amazon Bedrock AgentCore. These components are:

  • AgentCore Runtime: A serverless environment for hosting agents.
  • AgentCore Memory: Enables short and long-term memory for agents.
  • AgentCore Gateway: Securely connects agents to internal tools and data sources.
  • AgentCore Observability: Provides tracing, debugging, and monitoring.
  • AgentCore Identity: Facilitates secure authentication and authorization.

And two bonus pieces:

  • AgentCore Browser Tool: A managed browser runtime for agents to perform web automation tasks and interact with web-based services.
  • AgentCore Code Interpreter: A sandboxed environment for agents to securely write and execute code in various programming languages.

Press enter or click to view image in full size

In this post, I will focus on the AgentCore Runtime. I will walk through the process of taking an agent built with Strands and another with Google’s ADK and deploying them on the Bedrock AgentCore service. The Strands Agents SDK, developed by Amazon, simplify the process of building and deploying agents on Bedrock. But what if someone has already built agents with another framework, let’s say, Google’s ADK, and they want to deploy that agent on Bedrock AgentCore? This is why I explore both the pathways here.

My code is available on GitHub for reference.

Deploying a Strands Agent

My code is available on GitHub for reference. Let’s start with the Strands agent.

1. The Standalone Agent

First, I created a basic Strands agent that can run locally. It has a weather tool and a calculator tool.

# strands_claude.py (standalone version)from strands import Agent, tool
from strands_tools import calculator
from strands.models import BedrockModel
import argparse
import json
@tool
def weather():
"""Get weather""" # Dummy implementation
return "sunny"
def init_model():
model_id = "us.anthropic.claude-sonnet-4-20250514-v1:0"
return BedrockModel(model_id=model_id)
def init_agent():
return Agent(
model=model,
tools=[calculator, weather],
system_prompt="You're a helpful and funny assistant. \n" + "You can do simple math calculations, and \n" +
"tell the weather. You MUST finish every answer with a joke."
)
def strands_demo_agent(payload):
user_input = payload.get("prompt")
response = agent(user_input)
return response.message['content'][0]['text']
if __name__ == "__main__":
model = init_model()
agent = init_agent()
parser = argparse.ArgumentParser()
parser.add_argument("payload", type=str)
args = parser.parse_args()
response = strands_demo_agent(json.loads(args.payload))
print(response)

You can invoke this agent from the command line:

python strands_claude.py '{"prompt": "What is the weather now?"}'

Response:
Great news! It's sunny today! ☀️ Perfect weather to get outside and enjoy some sunshine.

Why don't weather forecasters ever get invited to parties? Because they're always raining on everyone's parade! 🌧️😄

2. Adapting for AgentCore: The Code Transformation

To make this agent compatible with the AgentCore runtime, only a few changes are needed.

# strands_demo.py (AgentCore version)from strands import Agent, tool
from strands_tools import calculator
# 1. Import BedrockAgentCoreApp
from bedrock_agentcore.runtime import BedrockAgentCoreApp
from strands.models import BedrockModel
# 2. Instantiate the specialized app class
app = BedrockAgentCoreApp()
@tool
def weather():
""" Get weather """ # Dummy implementation
return "sunny"
def init_model():
model_id = "us.anthropic.claude-sonnet-4-20250514-v1:0"
return BedrockModel(model_id=model_id)
def init_agent():
return Agent(
model=model,
tools=[calculator, weather],
system_prompt="You're a helpful and funny assistant..."
)
# 3. Use the @app.entrypoint decorator
@app.entrypoint
def strands_demo_agent(payload):
user_input = payload.get("prompt")
response = agent(user_input)
return response.message['content'][0]['text']
if __name__ == "__main__":
model = init_model()
agent = init_agent()
# 4. Remove argument parser and run the app
app.run()

The transformation is minimal:

  1. We import and use BedrockAgentCoreApp which provides the necessary hooks for the AWS runtime.
  2. We use the @app.entrypoint decorator to designate strands_demo_agent as the function the managed runtime will call. The function accepts a JSON payload, extracts the user input, executes the agent logic, and returns a string response.

3. The Deployment Workflow

With the code adapted, deployment is handled by the agentcore CLI toolkit.

  1. Configure: agentcore configure -e strands_demo.py This command inspects the entrypoint, reads requirements.txt, and generates a Dockerfile effectively preparing the application for containerization. It also ensures the necessary AWS resources like IAM roles and ECR repositories are available. Once it builds the container, it deploys it on the ECR. Below is the result:

Press enter or click to view image in full size

2. Launch: agentcore launch This command archives the source code, uploads it to S3, and starts an AWS CodeBuild job. CodeBuild builds the container image and pushes it to ECR. Finally, it deploys this image to the Bedrock AgentCore runtime. Below is the result:

Press enter or click to view image in full size

3. Invoke: agentcore invoke '{"prompt": "What is the weather today"}' Once deployed, the agent is live. This command sends a payload to the agent's new endpoint and streams the response (below).

Press enter or click to view image in full size

Deploying a Google ADK Agent

The process is similar for an agent built with a different framework, like Google’s ADK, demonstrating the platform’s framework-agnostic nature.

1. The Standalone Agent

Here is a basic ADK agent using the Google Search tool.

# adk_agent_demo.py (standalone version)from google.adk.agents import Agent
from google.adk.runners import Runner
from google.adk.sessions import InMemorySessionService
from google.adk.tools import google_search
from google.genai import types
import asyncio

APP_NAME = "google_agent_demo"
USER_ID = "user1234"
SESSION_ID = "session1234"

# Agent Definition
root_agent = Agent(
name="google_agent_demo",
model="gemini-2.5-flash",
description="Agent to answer questions using Google Search.",
instruction="I can answer your questions by searching the internet. Just ask me anything!",
# google_search is a pre-built tool which allows the agent to perform Google searches.
tools=[google_search]
)

# Session and Runner
async def setup_session_and_runner(user_id, session_id):
session_service = InMemorySessionService()
session = await session_service.create_session(app_name=APP_NAME, user_id=user_id, session_id=session_id)
runner = Runner(agent=root_agent, app_name=APP_NAME, session_service=session_service)
return session, runner

# Agent Interaction
async def call_agent_async(query, user_id, session_id):
content = types.Content(role='user', parts=[types.Part(text=query)])
session, runner = await setup_session_and_runner(user_id, session_id)
events = runner.run_async(user_id=user_id, session_id=session_id, new_message=content)
final_response = ""

async for event in events:
if event.is_final_response():
final_response = event.content.parts[0].text
print("Agent Response: ", final_response)
return final_response

async def main():
result = await call_agent_async("How does Amazon Bedrock AgentCore Runtime work?",
USER_ID, SESSION_ID)
print(result)

if __name__ == "__main__":
asyncio.run(main())

2. Adapting for AgentCore

The same three changes are required: use the BedrockAgentCoreApp, define an entrypoint, and run the app.

# adk_agent_demo.py (AgentCore version)
# ... ADK imports
from bedrock_agentcore.runtime import BedrockAgentCoreApp
import asyncio
# 1. Instantiate the specialized BedrockAgentCoreApp
app = BedrockAgentCoreApp()

# ... (the code for the agent definition remains the same)

# 2. Define the entrypoint
@app.entrypoint
def agent_invocation(payload, context):
return asyncio.run(
call_agent_async(payload.get("prompt", "what is Bedrock Agentcore Runtime?"), payload.get("user_id", USER_ID),
context.session_id))

#3. Invoke the BedrockAgentCoreApp
app.run()

3. The Deployment Workflow

The deployment steps are identical.

  1. Configure: agentcore configure -e adk_demo/adk_agent_demo.py

Press enter or click to view image in full size

2. Launch: agentcore launch --env GEMINI_API_KEY=<YOUR_API_KEY> Note — here, we need to pass in the Google AI Studio API key from https://aistudio.google.com/app/apikey

Press enter or click to view image in full size

3. Invoke: agentcore invoke '{"prompt": "What is Amazon Bedrock Agentcore Runtime?"}'

Press enter or click to view image in full size

Here you can see both the agents on AgentCore Console:

Press enter or click to view image in full size

Conclusion

This exercise shows that moving an agent to a managed runtime is primarily about defining a simple contract: a decorated entrypoint. By making a few minimal code changes, we can offload the undifferentiated heavy lifting of containerization, infrastructure provisioning, scaling, and observability.

This allows us to shift our focus from infrastructure management to agent logic and treat our agents as scalable, resilient workloads — as cattle, not pets. The real challenge is about running thousands of agents at scale with and this is a critical step for moving Agentic applications from prototypes to robust, production-grade systems.

I am excited by the Agentic applications. It gives us the opportunity to add intelligence to our apps to turn them into proactive autonomous systems that can reason, decide, and act on behalf of us with minimal oversight. It’s a fundamental shift in how we are going to be developing applications going forward. I believe there’s a ton of opportunity to add this intelligence, this proactive autonomy to our current application patterns and transform our workflows.

Resources

  1. Amazon Bedrock AgentCore
  2. Amazon Bedrock AgentCore samples
  3. Strands Agent on Bedrock AgentCore
  4. ADK Agent Integration with Bedrock AgentCore
  5. ADK Agent Documentation
Read Entire Article