Amazon Bedrock AgentCore is an agentic platform for constructing, deploying, and working efficient brokers securely at scale. Amazon Bedrock AgentCore Runtime is a totally managed service of Bedrock AgentCore, which offers low latency serverless environments to deploy brokers and instruments. It offers session isolation, helps a number of agent frameworks together with widespread open-source frameworks, and handles multimodal workloads and long-running brokers.
definition is offeredagent iscontainer
choose to not fear about Docker experience and container infrastructure when deploying agents.
On this put up, we’ll show how one can use direct code deployment (for Python).
Introducing AgentCore Runtime direct code deployment
With the container deployment technique, builders create a Dockerfile, construct ARM-compatible containers, handle ECR repositories, and add containers for code adjustments. This works nicely the place container DevOps pipelines have already been established to automate deployments.
deployment, which can considerably enhance developer time and productiveness. D
We’ll focus on the strengths of every deployment possibility that can assist you select the correct strategy on your use case.
With direct code deployment, builders create a zipper archive of code and dependencies, add to Amazon S3, and configure the bucket within the agent configuration. When utilizing the AgentCore starter toolkit, the toolkit handles dependency detection, packaging, and add which offers a much-simplified developer expertise. Direct code deployment can be supported utilizing the API.
Let’s evaluate the deployment steps at a excessive degree between the 2 strategies:
Container-based deployment
The container-based deployment technique includes the next steps:
Direct code deployment
The direct code deployment technique includes the next steps:
- Bundle your code and dependencies into a zipper archive
- Add it to S3
- Configure the bucket in agent configuration
- Deploy to AgentCore Runtime
use direct code deployment
Let’s illustrate how direct code deployment works with an agent created with Strands Brokers SDK and utilizing the AgentCore starter-toolkit to deploy the agent.
Stipulations
Earlier than you start, be sure to have the next:
- Any of the variations of Python 3.10 to three.13
- Your most well-liked package deal supervisor put in. For instance, we use uv package deal supervisor.
- AWS account for creating and deploying brokers
- Amazon Bedrock mannequin entry to Anthropic Claude Sonnet 4.0
Step 1: Initialize your venture
Arrange a brand new Python venture utilizing the uv package deal supervisor, then navigate into the venture listing:
Step 2: Add the dependencies for the venture
Set up the required Bedrock AgentCore libraries and growth instruments on your venture. On this instance, dependencies are added utilizing .toml file, alternatively they are often laid out in necessities.txt file:
Step 3: Create an agent.py file
Create the primary agent implementation file that defines your AI agent’s conduct:
Step 4: Deploy to AgentCore Runtime
Configure and deploy your agent to the AgentCore Runtime atmosphere:
This can launch an interactive session the place you configure the S3 bucket to add the zip deployment package deal to and select a deployment configuration sort (as proven within the following configuration). To go for direct code deployment, select possibility 1 – Code Zip.
Deployment Configuration
Choose deployment sort:
- Code Zip (beneficial) – Easy, serverless, no Docker required
- Container – For customized runtimes or complicated dependencies
This command creates a zipper deployment package deal, uploads it to the desired S3 bucket, and launches the agent within the AgentCore Runtime atmosphere, making it able to obtain and course of requests.
To check the answer, let’s immediate the agent to see how the climate is:
The primary deployment takes roughly 30 seconds to finish, however subsequent updates to the agent profit from the streamlined direct code deployment course of and will take lower than half the time, supporting sooner iteration cycles throughout growth.
When to decide on direct code as a substitute of container-based deployment
Let’s have a look at among the dimensions and see how the direct code and container-based deployment choices are totally different. This can assist you select the choice that’s best for you:
- Deployment course of: Direct code deploys brokers as zip information with no Docker, ECR, or CodeBuild required. Container-based deployment makes use of Docker and ECR with full Dockerfile management.
- Deployment time: Though there’s not a lot distinction throughout first deployment of an agent, subsequent updates to the agent are considerably sooner with direct code deployment (from a mean of 30 seconds for containers to about 10 seconds for direct code deployment).
- Artifact storage: inth 2026
- Customization: Direct code deployment helps customized dependencies by way of ZIP-based packaging, whereas container based mostly is dependent upon a Dockerfile.
- Bundle measurement: Direct code deployment limits the package deal measurement to 250MB whereas container-based packages will be as much as 2GB in measurement.
- Language Assist: Direct code presently helps Python 3.10, 3.11, 3.12, and three.13. Container-based deployment helps many languages and runtimes.
Our basic steerage is:
Container-based deployment is the correct selection when your package deal exceeds 250MB, you’ve present container CI/CD pipelines, otherwise you want extremely specialised dependencies and customized packaging necessities. Select containers should you require multi-language help, customized system dependencies or direct management over artifact storage and versioning in your account.
Direct code deployment is the correct selection when your package deal is below 250MB, you employ Python 3.10-3.13 with widespread frameworks like LangGraph, Strands, or CrewAI, and also you want fast prototyping with quick iteration cycles. Select direct code in case your construct course of is easy with out complicated dependencies, and also you wish to take away the Docker/ECR/CodeBuild setup.
A hybrid strategy works nicely for a lot of groups, use direct code for fast prototyping and experimentation the place quick iteration and easy setup speed up growth, then graduate to containers for manufacturing when package deal measurement, multi-language necessities, or specialised construct processes demand it.
Conclusion
Amazon Bedrock AgentCore direct code deployment makes iterative agent growth cycles even sooner, whereas nonetheless benefiting from enterprise safety and scale of deployments. Builders can now quickly prototype and iterate by deploying their code straight, with out having to create a container. To get began with Amazon Bedrock AgentCore direct code deployment, go to the AWS documentation.
In regards to the authors
Chaitra Mathur is as a GenAI Specialist Options Architect at AWS. She works with prospects throughout industries in constructing scalable generative AI platforms and operationalizing them. All through her profession, she has shared her experience at quite a few conferences and has authored a number of blogs within the Machine Studying and Generative AI domains.
Qingwei Li is a Machine Studying Specialist at Amazon Internet Providers. He acquired his Ph.D. in Operations Analysis after he broke his advisor’s analysis grant account and did not ship the Nobel Prize he promised. At present he helps prospects within the monetary service and insurance coverage trade construct machine studying options on AWS. In his spare time, he likes studying and educating.
Kosti Vasilakakis is a Principal PM at AWS on the Agentic AI crew, the place he has led the design and growth of a number of Bedrock AgentCore companies from the bottom up, together with Runtime, Browser, Code Interpreter, and Id. He beforehand labored on Amazon SageMaker since its early days, launching AI/ML capabilities now utilized by 1000’s of firms worldwide. Earlier in his profession, Kosti was a knowledge scientist. Exterior of labor, he builds private productiveness automations, performs tennis, and enjoys life together with his spouse and children.

