Runtime cases: persistent compute for manufacturing AI brokers on Amazon Bedrock AgentCore


Voiced by Polly

Once you transfer AI brokers from prototype to manufacturing, the infrastructure challenges multiply. Your brokers must persist state throughout multi-step workflows that run for hours or days. They should coordinate with different brokers, share context, and generally entry GPUs for specialised duties. Amazon Bedrock AgentCore runtime microVMs present a totally managed surroundings for invocations that may run for as much as 8 hours and assist stateful workflows by way of managed session storage. Some workloads additionally profit from devoted, larger-capacity environments — for instance, when brokers must run repeatedly for a number of days, entry GPUs or the underlying OS, or run a number of collaborating brokers on the identical host.

At the moment, I’m blissful to announce runtime cases, a brand new complementary compute choice in Amazon Bedrock AgentCore Runtime that offers your brokers persistent, managed infrastructure purpose-built for advanced agent workloads.

What you get

Runtime cases offers AWS-managed EC2 infrastructure the place you deploy a number of brokers in a single runtime, every with their very own dependencies and artifact sorts. Your brokers can collaborate on the identical host inside shared periods that persist for as much as 14 days. The service helps GPU acceleration for compute-intensive duties, session cease/restart to save lots of prices throughout idle intervals, and containerized deployments for groups that need to ship independently. For data that should survive past a session, runtime cases pairs naturally with Amazon Elastic Block Retailer (Amazon EBS) and AgentCore Reminiscence, which supplies your brokers long-term recall throughout periods and environments.

Earlier than right this moment, in the event you wished to maintain your brokers operating for days or they wanted GPU entry, or multi-agent coordination, you needed to construct and handle that infrastructure your self. You provisioned EC2 cases, configured networking, arrange session administration, dealt with scaling, and stitched collectively monitoring. Runtime cases handles all of that for you whereas integrating with the identical AgentCore APIs, id controls, and observability you already use with AgentCore Runtime microVMs.

A couple of issues that ought to make agent builders smile: your brokers can name one another as instruments inside a shared session, iterating autonomously till the job is completed. You deliver any framework (CrewAI, LangGraph, LlamaIndex, Strands) and any mannequin. Packaging is minimal, a @app.entrypoint decorator and a zipper file or container picture. And in case your workflow spans days, hibernate Monday evening and resume Wednesday morning with all the pieces intact.

Runtime microVMs and runtime cases are complementary compute choices that you should use independently or collectively by way of the identical AgentCore runtime APIs. A light-weight orchestrator agent on runtime microVM can coordinate and dispatch work to specialised employee brokers operating on cases. The orchestrator handles API calls, job routing, and end result aggregation utilizing runtime microVM’s quick scaling, whereas staff on Situations carry out compute-intensive duties like code compilation, safety scanning, or GUI automation that require persistent state and direct OS entry.

Let me present you the way it works

I constructed two brokers for this demo: a code author agent that generates Python code from pure language descriptions, and a code reviewer agent that analyzes the generated code for bugs, safety points, and elegance enhancements. Each brokers share the identical file system, so the reviewer can learn regardless of the author produces with none information switch or API calls between them.

Right here is the code author (simplified, no error dealing with):

author = Agent(
    mannequin="us.anthropic.claude-sonnet-4-5-20250929-v1:0",
    system_prompt=(
        "You're a senior Python engineer. "
        "Given a job, return ONLY a single Python code block — no prose."
    ),
)

@app.entrypoint
def handler(occasion, context):
    job = occasion.get("job") or occasion.get("immediate")
    session_id = getattr(context, "session_id", None) or occasion.get("session_id")
    session_dir = SHARED_DIR / session_id
    session_dir.mkdir(mother and father=True, exist_ok=True)

    code = str(author(job))
    (session_dir / "code.py").write_text(code)

    return {"agent": "author", "wrote": str(session_dir / "code.py"), "code": code}

Right here is the code reviewer agent (simplified, no error dealing with):

reviewer = Agent(
    mannequin="us.anthropic.claude-sonnet-4-5-20250929-v1:0",
    system_prompt=(
        "You're a strict Python code reviewer. "
        "Given code, return 3 bullet factors: bugs, model, strategies."
    ),
)

@app.entrypoint
def handler(occasion, context):
    session_id = getattr(context, "session_id", None) or occasion.get("session_id")
    code_path = SHARED_DIR / session_id / "code.py"
    code = code_path.read_text()
    evaluation = str(reviewer(f"Overview this code:nn{code}"))

    return {"agent": "reviewer", "learn": str(code_path), "evaluation": evaluation}

Every agent is a Python utility utilizing Strands Brokers with an @app.entrypoint decorator and a mannequin of its selection. I bundle each as a zipper file. For this demo, I exploit the AWS Administration Console. It’s also possible to use the AgentCore CLI, the AWS Command Line Interface (AWS CLI) or infrastructure as code.

Step 1: Create a capability supplier.

A capability supplier defines the EC2 infrastructure your brokers run on. Within the AgentCore console, I choose Runtime within the left navigation, then choose the Capability suppliers tab and Create capability supplier.

ACI Create Capcity Provider 1

I give it a Identify, choose Linux (64-bit ARM) because the Working system, and select c7g.2xlarge because the Allowed occasion sorts. This provides me 8 vCPUs and 16 GiB of reminiscence, sufficient for each brokers to run comfortably aspect by aspect.

Additional down, I configure the VPC, subnets, and safety teams for community entry. Underneath Storage configuration, I maintain the default gp3 quantity. Underneath Service entry, I choose Create a brand new service position and let the console create the infrastructure position that manages EC2 cases on my behalf.

I choose Create capability supplier and wait a number of seconds. The standing strikes to Lively.

ACI Create Capacity Provider 2

ACI Create Capacity Provider 3

Word the capability supplier configuration abstract: working system, occasion kind, subnets, safety group, occasion profile, and infrastructure position. As soon as created, solely the outline might be edited, so confirm your settings earlier than you proceed.

ACI Create Capcity Provider 2

Step 2: Create a runtime and deploy the primary agent.

Again on the Runtime web page, I choose Create runtime. I give it a Identify, choose Situations because the Compute kind, and select the Capability supplier I created within the earlier step.

ACI Create Runtime 1

Underneath Agent supply, I choose S3 Supply, then Add to S3. I select my agent zip file (ACIDemoWriter.zip), set the Language runtime to Python 3.13, and specify agent.py because the Agent entry level. That is the file that accommodates my @app.entrypoint embellished operate. Underneath Permissions, I choose Create default position to let the console provision the IAM position my agent wants.

ACI Create Runtime 2

I choose Create runtime and await the standing to turn into Prepared.

I repeat the identical course of for my code reviewer agent. I create a second runtime, choose the identical capability supplier, add my reviewer agent zip file, and await it to turn into Prepared. Each brokers now share the identical underlying EC2 infrastructure.

AgentCore Runtime Instances - Agent ReadyThe console reveals me a View invocation code part with ready-to-use Python, TypeScript, and JavaScript snippets to invoke my agent programmatically. However for this demo, I exploit the built-in check characteristic. I choose Check on the author agent’s web page.

AgentCore Runtime Instances - Show invocation codeStep 3: Invoke brokers and observe collaboration.

The Runtime playground opens. On the high, I see three fields: Runtime agent, Endpoint, and Session ID. The console generates a session ID robotically. I pay attention to it as a result of I’ll reuse it with the reviewer agent.

Within the Enter subject, I kind a JSON payload asking the author agent to generate code:

{"immediate": "write a fibonacci suite"}

I choose Run. After a number of seconds, the Output panel reveals the agent’s response. The author agent generated a Python module with two implementations of a Fibonacci sequence (a list-based operate and a generator) and wrote it to /tmp/agentcore-session/ca5ec24d-07f5-4eeb-add1-5ba416bf9eb2/code.py. Discover the session ID within the file path. That listing is the shared file system for this session.

AgentCore Runtime Instances - Invoke code writer agent

Step 4: Invoke the reviewer agent in the identical session.

Now I swap the Runtime agent dropdown to ACIDemoReviewer. The vital half: I paste the identical session ID (ca5ec24d-07f5-4eeb-add1-5ba416bf9eb2) within the Session ID subject. That is what connects the 2 brokers.

I kind a easy immediate:

{"immediate": "evaluation the code"}

I choose Run. The reviewer agent reads the file the author produced from the shared session listing and returns an in depth code evaluation. It finds no important bugs however suggests including kind hints, enter validation, and simplifying the sting case dealing with.

AgentCore Runtime Instances - Invoke code reviewer agentThe 2 brokers by no means exchanged messages or referred to as one another’s APIs. They collaborated by way of the shared file system that runtime cases present inside a session. You may prolong this sample to any variety of brokers: a check agent that runs the code, a documentation agent that generates README information, a safety agent that scans for vulnerabilities, all sharing the identical working listing.

Key particulars

Right here are some things to know as you get began:

  • Supported OS: Linux (ARM64 and x86_64) at launch.
  • Session persistence: Periods persist for as much as 14 days.
  • Runtimes: Python 3.11-14 with native code assist. Container pictures additionally supported.
  • GPU: Help for GPU-accelerated occasion sorts.
  • Integration: Makes use of the identical AgentCore APIs, id, observability, and coverage controls as AgentCore Runtime.
  • Pricing: Commonplace EC2 pricing plus a administration price for AgentCore orchestration.
  • Areas: US East (Ohio, N. Virginia), US West (Oregon), Asia Pacific (Mumbai, Singapore, Sydney, Tokyo), and Europe (Frankfurt, Eire)

To get began, go to the runtime occasion in Amazon Bedrock AgentCore documentation and create your first capability supplier.

— seb

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles