Artificial Intelligence1 min read

Architecture patterns for fast session startup on Amazon Bedrock AgentCore runtime

By · Published by Everything Blog

In short

The V2 runtime captures an agent's memory and disk state inside a microVM snapshot after waiting up to 120 seconds for a healthy ping. Before the snapshot is frozen, the system clears operating system file caches to keep storage sizes minimal. Restored sessions retain initialized in-memory objects and clients, but developers must account for lazily loaded image files and stale network connections. For latency-sensitive deployments, teams can utilize build hooks for heavy assets or trigger background pre-warming.

Key points

  • Transitioning to the V2 runtime and initializing before calling app.run provides approxim…: Transitioning to the V2 runtime and initializing before calling app.run provides approximately two-second launch times.
  • Agents relying on external tools or large files can use build hooks to prime necessary as…: Agents relying on external tools or large files can use build hooks to prime necessary assets during snapshot creation.
  • Sub-second response requirements for voice or chat can be satisfied by pre-warming sessio…: Sub-second response requirements for voice or chat can be satisfied by pre-warming sessions when users open an application.

Sources checked by our analysis pipeline: 1

Artificial Intelligence

Architecture patterns for fast session startup on Amazon Bedrock AgentCore runtime

Agents today review code, process claims, and run unattended for hours. Many also sit behind interactive experiences where a person waits for the first response. Amazon Bedrock AgentCore runtime gives these agents a fully managed, serverless environment: each session runs in its own isolated microVM, the platform scales to zero when there’s no work, and you only pay for the resources your sessions consume.

AgentCore runtime with platformVersion

set to “V2” changes how sessions start. Instead of initializing your container for every session, it prepares your environment once, snapshots it, and restores that snapshot for each new session. Session start times are faster and more consistent. V2 also reclaims memory your sessions don’t use, so your bill tracks what your agent uses.

For most agents, switching to V2 is all it takes. Some agents need restructuring to get the full benefit, and for chat and voice experiences even 2 seconds is too slow. This post explains how V2 starts a session, how to measure session start time,…

Artificial Intelligence