Reactive Machines

ITETATE quickly with Amazon Bedrock Agentcore Runtime Runtime Runtime Deployment Deployment

Amazon Bedrock Agentcore is an agentic platform for building, deploying, and running agents that work securely at scale. Amazon Bedrock Agentcore Runtime is a fully managed service for Bedrock Agentcore, providing a low-level environment for installing agents and tools. It provides segmentation, supports multiple drug frameworks including open source frameworks, and supports multimodal workloads and long agents.

Explanation providedthe agentadministrative

select not to worry about it An artist an artist and container infrastructure When You Submit agenta woman.

In this post, we will show how to use direct code deployment (with Python).

Introducing Agentcore RuteTime Direct Spyment Code Delivery

In the method of moving the content, the developers create a DockerfileBuild ARM-compatible containers, manage ECR Repositories, and load code change containers. This works well where devops container pipes they have previously fall established using shipping.

Delivery, where it can greatly improve developer time and productivity. D

We will discuss the strengths of each distribution to choose To help you choose the right method for your use case.

With direct code deployment, developers create a ZIP Archive of Code and tools, upload it to Amazon S3, and configure the bucket in the agent configuration. When using the Agentcore Starter ToolKit, the toolkit handles dependency detection, packaging, and loading providing a very simple experience. Direct code submission is also supported using the API.

Let's compare the high-level submission steps between the two methods:

Route-based deployment

The container-based shipping method includes the following steps:

  • Create a Dockerfile
  • Build an ARM compatible container
  • Create an ECR repository
  • Upload to ECR
  • Use the Agentcore runtime

Direct code deployment

The correct method of coding involves the following steps:

  • Package your code and dependencies in a zip archive
  • Upload it to S3
  • Configure the bucket in the agent configuration
  • Use the Agentcore runtime

How to use direct code deployment

Let's illustrate how direct coding works with an agent created with the Strands Agents SDK and using the Agentcore Starter-ToolKit to deploy the agent.

Requirements

Before you begin, make sure you have the following:

  • Any versions of Python 3.10 to 3.13
  • Your favorite package manager is installed. For example, we use the UV package manager.
  • AWS Account for creating and deploying agents
  • Access to the Amazon Bedrock Model in Anthropic Claude Sonnet 4.0

Step 1: Start your project

Set up a new Python project using the UV package manager, and navigate to the project directory:

Step 2: Install project dependencies

Install the necessary bed libraries and development tools for your project. In this example, the dependency is installed using .toml File, otherwise they can be specified internally requirements.txt File:

uv add bedrock-agentcore strands-agents strands-agents-tools
uv add --dev bedrock-agentcore-starter-toolkit
source .venv/bin/activate

Step 3: Create the agent.py file

Create an advanced Agent implementation file that defines how you manage your AI agent:

from bedrock_agentcore import BedrockAgentCoreApp 
from strands import Agent, tool 
from strands_tools import calculator  
from strands.models import BedrockModel 
import logging 

app = BedrockAgentCoreApp(debug=True) 

# Logging setup 
logging.basicConfig(level=logging.INFO) 
logger = logging.getLogger(__name__) 

# Create a custom tool  
@tool 
def weather(): 
     """ Get weather """  
     return "sunny" 

model_id = "us.anthropic.claude-sonnet-4-20250514-v1:0" 
model = BedrockModel( 
     model_id=model_id, 
) 

agent = Agent( 
     model=model, 
     tools=[calculator, weather], 
     system_prompt="You're a helpful assistant. You can do simple math calculation, and tell the weather." 
) 

@app.entrypoint 
def invoke(payload): 
     """Your AI agent function""" 
     user_input = payload.get("prompt", "Hello! How can I help you today?") 
     logger.info("n User input: %s", user_input) 
     response = agent(user_input) 
     logger.info("n Agent result: %s ", response.message) 
     return response.message['content'][0]['text'] 

if __name__ == "__main__": 
     app.run() 

Step 4: Run the Agentcore Runtime

Configure and deploy your agent in the Agentcore Runtime Environment:

agentcore configure --entrypoint agent.py --name 

This will launch an interactive session where you configure the S3 Bucket to load the Zip Deplopment package to select the type of deployment configuration (as shown in the following configuration). To choose direct shipping, select option 1 – zip code.

Vehicle Maintenance

Choose a Delivery Type:

  1. Zip Code (Recommended) – Simple, up-to-date, no docker required
  2. Container – For custom details or complex dependencies

This command creates a Deploppent Zip package, uploads it to the specified S3 bucket, and opens the agent in the AgentCore Runtime environment, making it ready to receive and process requests.

To test the solution, let's remove the agent to see what the weather is like:

agentcore invoke '{"prompt":"How is the weather today?"}'

The first deployment takes about 30 seconds to complete, but subsequent updates to the agent benefit from a straightforward coding process and should take less than half the time, supporting faster Iteration cycles during development.

When to choose direct code over container-based deployment

Let's look at some measurements and see what the exact code and options are for containers based on different objects. This will help you choose the right option for you:

  • Submission process: Direct code to send agents as zip files with no parser, ECR, or code required. Container-based deployments use Docker and ECR with full DockerFile management.
  • Delivery time: Although there is no significant difference in the initial installation time of the agent, subsequent updates to the agent are much faster with direct code deployment (from an average of 30 seconds for containers to be executed).
  • Artifact Storage: betweenth 2026
  • Customization: Direct code deployment supports custom dependencies by using zip-based packages, while the supported container relies on a dockfile.
  • Package size: Direct code deployment limits package size to 250MB while installer-based packages can be up to 2GB in size.
  • Language Support: Direct code currently supports Python 3.10, 3.11, 3.12, and 3.13. Container-based rendering supports multiple languages ​​and playtimes.

Our General Guide says:

Container-based shipping is the right choice When your package exceeds 250MB, you have existing CI / CD pipelines, or you need special dependencies and custom installation requirements. Choose containers if you need multi-language support, custom program dependencies or direct control over storing artifact objects and type in your account.

Direct coding is the right choice When your package is less than 250MB, you use python 3.10-3.13 with a standard framework like Langgraph, Stripes, or Crewai, and you need fast prototyping with fast iteration cycles. Choose direct code if your build process is straightforward without complex dependencies, and you want to remove the dock / ECR / codeBuild Set setup.

A hybrid approach works well for many groupsUse direct code for quick exercises and tests where rapid iteration and updates are easy to develop, and finalize production containers when package size, or special build processes demand it.

Lasting

Amazon Bedrock's direct Agentcore code submission makes agent-to-agent development faster, while still benefiting from enterprise security and cost efficiency. Developers can now quickly push and deploy their code directly, without creating a container. To get started with Amazon Bedrock Agentcore Direct Code Deployment, visit the AWS documentation.


About the writers

Chaitra Matur As a developer of genai applications for genai on AWS. He works with clients across industries to build common and functional AI platforms. Throughout his career, he has shared his expertise at numerous conferences and has authored several blogs in the machine learning and generative AI domains.

Writer QingweiQingwei li Are you a machine learning expert at Amazon Web Services. He received his PH.D. In the research done after he broke the grant account of the Teacher Wokwalwa Kwake and failed to deliver the Nobe award he promised. He currently assists clients in the financial services and insurance industry in building machine learning solutions on AWS. In his free time, he loves to read and teach.

Kosti Vasilakakis AWS principal PM on the Agentic AI team, where he led the design and development of several alentrock alentcore services from the ground up, including runtime, browser, code translator, and code ownership. He previously worked at Amazon SageMaker from its early days, introducing AI / ML capabilities that are now used by thousands of companies around the world. Earlier in his career, Kosti was a data scientist. Outside of work, he builds personal dynamics, plays tennis, and enjoys life with his wife and children.

Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button