Get more from Runtime (Sessions, versions and e...

Riku INADA PRO
November 11, 2026

Get more from Runtime (Sessions, versions and endpoints, and long-running tasks) | Learn Amazon Bedrock AgentCore with Kiro 02

This Level 300 deck takes the help desk agent of a made-up online electronics shop, deployed to AgentCore Runtime in deck 01, and makes it ready for many users: a dedicated microVM for each session with the session ID made and kept by the caller, the session life cycle (Active, Idle, Stopped, 15 minutes idle and 8 hours by default), streamed answers, and long-running tasks that return a receipt at once and keep working in a back thread with add_async_task while /ping says HealthyBusy. It then shows versions and named endpoints (try a new version on a test endpoint, then move production), inbound auth with IAM or JWT, the protocols, microVM V1 and V2 and Instances, zip or container, and a clean-up that keeps the versions, with figures that use the official AWS icons and real terminal screens, as deck 02 (Get started) of the series Learn Amazon Bedrock AgentCore with Kiro.

Riku INADA PRO

November 11, 2026

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

36 slides
  1. Learn Amazon Bedrock AgentCore with Kiro 02 Get started Level

    300 Get more from Runtime Sessions, versions and endpoints, and long-running tasks 02 As of November 2026 (AgentCore CLI 1.0.2) November 2026 Riku Inada Amazon Web Services Japan © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Kiro + AgentCore 1
  2. Introduction About me Riku Inada Amazon Web Services Japan G.K.

    Solutions Architect Works mainly with manufacturing customers Recent work Promoting the AI-Driven Development Life Cycle (AI-DLC) Writing and speaking about Kiro and AWS Amplify © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. X @inada_riku Speaker Deck speakerdeck.com/inariku Zenn zenn.dev/inariku GitHub github.com/inariku 2
  3. Introduction Where this deck fits You are here: 02 Get

    more from Runtime. Next: 03 Make it remember Get started 01–02 Build it out 03–06 Observe and improve 07–09 Govern and share 10–12 01 How AgentCore works Read next 03 Make it remember 07 See what it did 10 and the way out 02 Get more from Runtime 04 Connect tools 08 Evaluate it tool calls 11 Stop with rules 09 Keep improving 12 across teams Read first Let it compute 05 and browse Secure the way in Find and share Build it 06 from config © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 3
  4. Introduction What you'll learn Make the help desk of deck

    01 ready for many users 1 Sessions: a microVM for each chat. The caller keeps whose session it is 2 Long-running tasks: return a receipt first, and keep working in the back 3 Versions and endpoints: versions stay, and an endpoint picks the one to ship Also: the way in, how to deploy, and clean-up. You need the help desk deployed to Tokyo in deck 01 This deck is for reading along. To try it, agentcore invoke has --session-id and --qualifier A B Sessions Long-running tasks Versions, endpoints A microVM per chat Answer first, work on Try it, then ship it © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 4
  5. 1 Sessions © 2026, Amazon Web Services, Inc. or its

    affiliates. All rights reserved. 5
  6. 1 Sessions Customers come at the same time Two customers

    talk at once. Their chats must not mix Customers, at once App backend AgentCore Runtime (the caller) The help desk Map: customer → ID C-1001 C-1001 → ID A C-1002 C-1002 → ID B Session A (its own microVM) Only the chat of C-1001 Session B (its own microVM) Only the chat of C-1002 In Tokyo, an account runs up to 2,500 sessions at once and starts up to 25 a second (both can be raised) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 6
  7. 1 Sessions A dedicated microVM for each session CPU, memory

    and files apart. At the end, the microVM goes Session A Session B C-1001 C-1002 CPU CPU Can't Memory see Files Memory Files Its own microVM The microVM is deleted and its At the end memory wiped The last chat is not left for the next session Its own microVM While a microVM runs, calls with the same session ID reach that microVM © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 7
  8. 1 Sessions Two customers talked in two sessions The caller

    makes an ID per chat. Runtime keeps each ID apart “C-1001 here. My order has not arrived.” ① Caller: a new ID Session A desk-C-1001-c973… microVM “C-1002 here. My keyboard has not arrived.” ② Caller: a new ID Session B desk-C-1002-1524… microVM “Thank you, Ms. Yamada. I checked your order…” “Thank you, Mr. Suzuki. I can see your order…” The caller (the shop's backend) keeps the map of customers to IDs. desk calls it “Session map” ① ① New ID, C-1001 ② ② New ID, C-1002 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 8
  9. 1 Sessions The life of a session By default it

    stops after 15 minutes idle, or after 8 hours Answer done 15 min idle Active Idle Stopped Writes answers, Waits for The microVM runs back work the next call is gone Same ID again From any state: 8 hours after it started, or StopRuntimeSession Call the same ID after it stops: a new microVM starts (session storage files stay) 15 minutes and 8 hours are defaults. Set 1 minute to 8 hours in the Runtime settings © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 9
  10. 1 Sessions The same session ID picked up the last

    chat While a session runs, the same ID reaches the same microVM “What day will that item arrive?” The help desk's answer ① Caller: the same ID Session A (the microVM of slide 8) desk-C-1001-c973… Earlier: the order not arrived yet “The USB-C hub (order ORD-5488) is expected to arrive by 2026-11-11. Is there anything else I can help with?” ① Same ID again ① The caller only passes the ID in its map as runtimeSessionId (a boto3 excerpt: appendix A3) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 10
  11. 1 Sessions A session is not memory When it stops,

    the microVM's contents are gone. Keep what lasts outside A Runtime session (its own microVM) AgentCore Memory Chats and what it learned (deck 03) Memory Files (/tmp and so on) Amazon S3 Result files Gone when it stops (by default 15 min idle, session storage (preview) or 8 hours at most) Kept across stop and resume; empty on a new version This help desk's template also writes chats to AgentCore Memory (deck 03) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 11
  12. 1 Sessions The answer came in dozens of pieces You

    can start reading at the first piece, before the end First text at 10.5 s Call Done at 11.6 s Uses 2 tools and thinks (no answer text yet) 0s 5s 10.5 to 11.6 s, spread out 10 s The answer came in 32 pieces. The customer reads from the first one desk, the caller's stand-in, measured this once for this deck The entrypoint in deck 01's main.py streams the agent's events with yield. The screen is in appendix A4 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 12
  13. 2 Long-running tasks © 2026, Amazon Web Services, Inc. or

    its affiliates. All rights reserved. 13
  14. 2 Long-running tasks A long task answers first and works

    on in the back Return a receipt number at once, and keep working in a back thread One session of AgentCore Runtime (a microVM) Store manager (caller) Entrypoint Back thread “Make the list” add_async_task, then start “Your receipt is R-…” (at once) Counts on Answers the Runtime /ping (minutes with HealthyBusy (SDK) to hours) “Is it ready?” (later) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 14
  15. 2 Long-running tasks Register it with add_async_task, remove it at

    the end app/agent/report.py (excerpt; ... marks what is left out; _app is the BedrockAgentCoreApp) @tool def start_month_end_refund_report(month: str) -> str: task_id = _app.add_async_task("month_end_refund_report", {...}) threading.Thread(target=_work, args=(...), daemon=True).start() return f"Started the list ... under receipt {receipt}. It takes a few minutes" def _work(receipt, task_id, month): try: # ... reads the ledger one order at a time, writes the result in /tmp/reports finally: _app.complete_async_task(task_id) Entrypoint Back thread Returns the receipt. Work that blocks here can stall /ping: stopped at 15 min add_async_task /ping answer © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. complete_async_task HealthyBusy (the SDK answers) then Healthy 15
  16. 2 Long-running tasks In the same session, the list came

    2 minutes later The receipt came first, and the count went on in the back “Store manager here. Make the month-end refund list…” ① A tool starts it Makes a receipt “…has been started. Your receipt number is R-D2C5A8.…” The back thread counts on (one ledger row at a time, about 2 minutes). /ping says HealthyBusy “Is the list ready?” (about 2 minutes later) ② The same session ③ A tool reads it “Yes, the month-end refund list…is ready. There is 1 candidate, totaling 15,800 yen…” ① ① Starts the task ② ③ ② The same session ③ Reads the result The result was in /tmp. It is gone after 15 idle minutes (default) or 8 hours, so in production keep it in S3 or Memory © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 16
  17. 3 Versions and endpoints prod © 2026, Amazon Web Services,

    Inc. or its affiliates. All rights reserved. test 17
  18. 3 Versions and endpoints Versions Each change to the Runtime

    adds one version that never changes DEFAULT Version 1 Version 2 Version 3 Deck 01 Adds the Ends with help desk long-task tools “Anything else?” Always the latest version A running session keeps the version it started with Each change to the Runtime (code, instructions, settings) adds one, and a version never changes (the lock) A deploy that only adds or repoints endpoints adds no version Like Lambda versions and aliases, but each version is made for you © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 18
  19. 3 Versions and endpoints An endpoint picks the version to

    ship A named endpoint stays on the version you gave it DEFAULT (latest) Version 1 Customers acdecks02en_prod Version 2 Developers acdecks02en_test Version 3 A named endpoint stays on its version until you point it at another © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 19
  20. 3 Versions and endpoints Write endpoints in the config, and

    deploy to make them The commands run (prod and test added at version 2, made by deploy) agentcore add runtime-endpoint --runtime agent --name acdecks02en_prod --version 2 agentcore add runtime-endpoint --runtime agent --name acdecks02en_test --version 2 agentcore deploy agentcore/agentcore.json, in runtimes[0] (test set from 2 to 3 after version 3, then deploy) "endpoints": { "acdecks02en_prod": { "version": 2 }, "acdecks02en_test": { "version": 3 } } To move prod on, set its version to 3 and deploy. To go back, set 2 and deploy agent is the name of the Runtime in this config. The Runtime ID is the end of the ARN that agentcore status shows © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 20
  21. 3 Versions and endpoints The list showed test on version

    3 and prod on version 2 There are versions 1, 2 and 3, and each endpoint points at one ③ DEFAULT (latest) ① acdecks02en_test ② acdecks02en_prod Version 3 Version 2 Version 1 No endpoint The version list also had 3, 2 and 1, all READY (the same form as the screen on slide 29) ① test is on version 3 ② prod is on version 2 ③ DEFAULT: latest, version 3 ① ② ③ © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 21
  22. 3 Versions and endpoints Only test (version 3) added the

    closing line Check on test, then set prod's version to 3 and deploy “C-1002 here. Just tell me my order number.” ① acdecks02en_prod Version 2 “…your order number is ORD-5390, … Please note it is currently marked as delayed…” ② acdecks02en_test Version 3 “…your order number is ORD-5390, … Is there anything else I can help with?” ③ The closing line added in version 3's instructions Sent under new names with no chats in Memory (dev-a, dev-b). Sent as C-1002, prod also said it ① ① prod's last row (version 2) ② ② Called test (version 3) ③ ③ The closing line of version 3 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 22
  23. 4 The way in, and how to deploy © 2026,

    Amazon Web Services, Inc. or its affiliates. All rights reserved. 23
  24. 4 The way in, and how to deploy Who may

    call The way in checks either an IAM signature or a JWT IAM (SigV4) JWT (OAuth 2.0) Checks the AWS signature Checks the token of a Called from the app backend (this deck) signed-in user (deck 10) One Runtime takes one of the two at its way in ! Check in the entrypoint that prompt is a string. If a tool call's shape arrives, a tool may run without the model deciding © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 24
  25. 4 The way in, and how to deploy Not only

    agents MCP, A2A and AG-UI servers deploy to Runtime the same way HTTP MCP A2A AG-UI 8080 /invocations 8000 /mcp 9000 / 8080 /invocations The help desk's form A tool server: lists Talks with other Streams events (this deck) its tools, runs them agents (Agent Card) to a user interface Pick one protocol in the Runtime settings. Each gets a microVM per session and an IAM or JWT way in © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 25
  26. 4 The way in, and how to deploy Start-up speed,

    and running long V1 is the default. V2 for steady start-up, Instances for days microVM V1 (default) microVM V2 Instances Runs on microVMs AWS runs microVMs AWS runs EC2 in your account Create, update READY in seconds Minutes (takes a snapshot) Not tried in this deck Session start Sets up each time Restores the snapshot. Steady even for big images Not tried in this deck One run Up to 8 hours Up to 8 hours Up to 14 days Good for Starting out Big images, bursts of calls GPUs, long automation In Tokyo Yes Yes Yes © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 26
  27. 4 The way in, and how to deploy zip or

    container The template is zip. Use a container for big dependencies or a container CI zip (the default) Zipped locally and uploaded; no Docker needed Up to 250 MB zipped. AWS patches the runtime Container CodeBuild builds the image, puts it in ECR CodeBuild, ECR Up to 2 GB. You rebuild the image © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 27
  28. 5 Clean up © 2026, Amazon Web Services, Inc. or

    its affiliates. All rights reserved. 28
  29. 5 Clean up After clean-up, the 3 versions stayed Only

    the 2 endpoints went. No operation deletes only a version Before clean-up Remove the DEFAULT → version 3 endpoints, acdecks02en_prod → version 2 then deploy acdecks02en_test → version 3 ① DEFAULT → version 3 ② Versions 1, 2 and 3 Versions 1, 2 and 3 No operation deletes only a version ① ① Only DEFAULT is left ② ② Versions 3, 2, 1 are all left © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. After clean-up 29
  30. Summary Summary Keep sessions apart, run long tasks in the

    back, keep versions 1 Sessions: a microVM for each chat. The caller keeps whose session it is 2 Long-running tasks: return a receipt first, and keep working in the back 3 Versions and endpoints: versions stay, and an endpoint picks the one to ship A B Sessions Long-running tasks Versions, endpoints A microVM per chat Answer first, work on Try it, then ship it © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 30
  31. Summary Read next Deck 03 to keep things after the

    session. Deck 07 to see what happened 03 Make it remember 07 See what it did 10 Secure the way in and the way out Memory that lasts Follow what the Check the customer's after the session desk did in traces sign-in (JWT) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 31
  32. Appendix A1 Glossary Term Meaning Term Meaning Session One chat

    and its follow-ups Version A copy of the Runtime contents microVM A small VM for each session endpoint What you call. Points at a version session ID A session's name (the caller's) DEFAULT Always points at the latest Session map Customer to ID (the caller's) qualifier Which endpoint to call /ping The Runtime health check SigV4 AWS Signature Version 4 HealthyBusy Busy with work in the back JWT A sign-in token add_async_task Registers a long task (SDK) platform version How it starts (V1, V2) session storage Files that stay (preview) desk The caller's stand-in (this deck) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 32
  33. Appendix A2 Full commands Run in the help desk's project

    folder (each # gives the slide and what it does) ./desk ask C-1001 "C-1001 here. My order has not arrived." # 8 ./desk ask C-1002 "C-1002 here. My keyboard has not arrived." # 8 ./desk ask C-1001 "What day will that item arrive?" --continue # 10 ./desk ask C-1001 "C-1001 here. Explain my orders one by one." --times # 12 ./desk ask store-manager \ "Store manager here. Make the month-end refund list for 2026-11." # 16 ./desk ask store-manager "Is the list ready?" --continue # 16: 2 min later ./desk ask dev-a "C-1002 here. Just tell me my order number." \ --endpoint acdecks02en_prod # 22 ./desk ask dev-b "C-1002 here. Just tell me my order number." \ --endpoint acdecks02en_test # 22 ID=<the Runtime ID> # 21, 29: the end of the ARN that agentcore status shows aws bedrock-agentcore-control list-agent-runtime-versions --agent-runtime-id $ID aws bedrock-agentcore-control list-agent-runtime-endpoints --agent-runtime-id $ID agentcore remove runtime-endpoint --runtime agent --name acdecks02en_test # 29 agentcore deploy # 29: delete the removed endpoints on AWS (prod: the same) The AWS CLI commands also had --region ap-northeast-1, --output text and --query (in full in the notes) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 33
  34. Appendix A3 desk, the caller's stand-in (excerpt) desk (excerpt; the

    2 sid lines are the if and else branches; REGION = "ap-northeast-1") session = boto3.Session() # the default profile data = session.client("bedrock-agentcore", region_name=REGION) arn = runtime_arn(session.client("bedrock-agentcore-control", region_name=REGION)) sid = book[args.who] # --continue: the ID in the session map sid = f"desk-{args.who}-{uuid.uuid4().hex}" # a new chat: make it (33+ chars) remember(args.who, sid) # write it in the session map kw = {"qualifier": args.endpoint} if args.endpoint else {} # the endpoint r = data.invoke_agent_runtime(agentRuntimeArn=arn, runtimeSessionId=sid, payload=json.dumps({"prompt": args.text, "actorId": args.who}).encode(), **kw) for raw in r["response"].iter_lines(chunk_size=64): # text/event-stream line = raw.decode("utf-8") if line.startswith("data: "): # one event per data line ev = json.loads(line[6:]).get("event", {}) txt = ev.get("contentBlockDelta", {}).get("delta", {}).get("text") runtime_arn finds the ARN by the Runtime name with list_agent_runtimes. book is the session map © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 34
  35. Appendix A4 The streamed answer (slide 12) The last line

    is desk's own count of seconds and pieces. The answer's middle rows are left out (three dots) The answer changes on every call © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 35
  36. Appendix A5 Sources AWS, AgentCore Developer Guide: 16 pages, from

    "Use isolated sessions" (slides 4, 6–12, 14, 18, 20, 22, 24–27, 29, 34) https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-sessions.html AWS, the same guide: "Handle asynchronous and long running agents" (slides 4, 14–16) https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-long-run.html AWS, the same guide: "AgentCore Runtime versioning and endpoints" (slides 4, 18–21, 25, 29) https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agent-runtime-versioning.html AWS, Amazon Bedrock AgentCore Control plane API reference: Actions (slide 29) https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_Operations.html AWS, AWS Lambda Developer Guide: "Create an alias for a Lambda function" (slide 18) https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html Martin Fowler, March 2010, "BlueGreenDeployment" (slides 19, 22) https://martinfowler.com/bliki/BlueGreenDeployment.html Danilo Sato, June 2014, "CanaryRelease" (slide 22) https://martinfowler.com/bliki/CanaryRelease.html "The Twelve-Factor App": VI. Processes and IX. Disposability (slides 11, 16) https://12factor.net/processes Anthropic, November 2025, "Effective harnesses for long-running agents" (slide 16) https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents Where the help desk's code comes from (MIT-0, Module 1) (slides 10, 15, 34) https://github.com/aws-samples/sample-strands-agents-hands-on-workshop © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 36

More Decks by Riku INADA

Other Decks in Technology