Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Lambda durable functionsでHuman in the Loopを楽に…楽に……
Search
Har1101
October 21, 2026
Programming
290
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Lambda durable functionsでHuman in the Loopを楽に…楽に……
2026/10/21 (水) JAWS-UG東京 2026秋 〜AWSライトニングトークNight〜 での登壇資料です
Har1101
October 21, 2026
More Decks by Har1101
See All by Har1101
AgentCore Runtime上にAgentic Coding基盤を構築・展開する際の設計ポイントと限界点 / Design considerations and limitations when building an agentic coding platform on AgentCore Runtime
har1101
7
1.2k
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
3
830
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
780
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
610
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
250
エージェンティックRAGにAWSで入門しよう!
har1101
9
2.4k
TypeScriptだけでAIエージェントを作る フロント・エージェント・インフラのフルスタック実践
har1101
7
2k
AgentCore Registry入門~マルチアカウントでどう使うの~
har1101
1
160
AgentCore×VPCでの設計パターンn選と勘所
har1101
4
770
Other Decks in Programming
See All in Programming
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
420
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
210
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
410
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
160
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
2.3k
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
330
ActionController meets Protocol Buffers
sorah
1
790
AIがコードを書いてくれる時代、我々は何を確かめるのか
yosuke_furukawa
PRO
13
5.8k
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
190
Modernizing iOS Apps
seyfoyun
0
150
Performance Optimization With LLMs
xleitix
0
250
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
730
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Optimizing for Happiness
mojombo
378
71k
Making Projects Easy
brettharned
120
6.8k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Making the Leap to Tech Lead
cromwellryan
135
10k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
970
Large-scale JavaScript Application Architecture
addyosmani
516
110k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
570
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
Transcript
Lambda durable functionsで Human in the Loopを楽に…楽に…… 2026/10/21 (水) JAWS-UG東京
2026秋 〜AWSライトニングトークNight〜 福地開
Who am I ? 福地 開 (ふくち はるき) @har1101mony 所属:AIネイティブファクトリー株式会社
業務:自分でもよくわからない 実績:AWS Community Builders 2年目 (AI Engineering) 2026 Japan All AWS Certifications Engineers 趣味:筋トレ、クラフトビール 近況:1級小型船舶操縦士免許取得 次はワインエキスパート取ります
前回(?)のあらすじ
AgentCore RuntimeのHITLしんどくて草 ◆ServerlessDays Tokyo 2026での登壇資料より • 人間に一度確認を促す段階で処理が一度終わる =サーバーレスはステートレスなので、普通だと途中からの再開ができない =続きはここから、というステート管理(状態管理)をする必要がある https://speakerdeck.com/har1101/design-considerations-and-limitations-when-building-an-agentic-coding-platform-on-agentcore-runtime?slide=29
サーバーレスだけどステートフルに ◆AIエージェントが再発見したサーバーレス • 高速で起動し、長時間稼働し、ユーザーごとに環境を分離し、挙句の果てには 処理途中でのストップ/リスタートもやりたい!!!!! • 人間というのは強欲なものです https://www.docswell.com/s/nekoruri/ZDMVQV-serverlessdays2026#p14
Lambda durable functions
Lambda durable functionsとは? ◆durable = 耐久性のある • 中断可能かつ信頼性が高くて最長1年間実行できる、 マルチステップアプリケーションやAIワークフローを構築できるもの •
サーバーレスでありながらステートフルみたいな動かし方ができるもの • step:処理の区切り。完了結果を保存し、再実行時はスキップ • wait:待機中はコンピュートが止まり課金なし • callback:外部の承認・応答を待って処理を再開
Lambda durable functionsとは? ◆durable = 耐久性のある • 中断可能かつ信頼性が高くて最長1年間実行できる、 マルチステップアプリケーションやAIワークフローを構築できるもの •
サーバーレスでありながらステートフルみたいな動かし方ができるもの • step:処理の区切り。完了結果を保存し、再実行時はスキップ • wait:待機中はコンピュートが止まり課金なし • callback:外部の承認・応答を待って処理を再開 ◆実質ヒソカのバンジーガム • Lambda durable functionsは ガム (ステートフルコンピューティングの長時間実行・ステート管理)と ゴム (Lambda Event Functionsの高速起動・環境分離)、 両方の性質を併せ持つ…♡ ※ちなみにLambda durable functionsは d と f 小文字です durable functions警察が来るのでご注意を()
AIエージェントを動かしたい! ◆ServerlessDays Tokyo 2026 Day2にて淡路さんから • Lambda durable functionsでAIエージェント動かすフレームワークありますよ https://docs.aws.amazon.com/durable-execution/sdk-reference/integrations/pydantic-ai/
書き方はめちゃ簡単 ◆エージェントとツールを定義してデコレーターをつけるだけ • これだけでエージェントが動くだけでなく、LLM推論・toolUseなどがすべて stepとして自動で区切られる →すなわちエージェントの挙動が1つずつstepとして保持される形 from typing import Any
from aws_durable_execution_sdk_python import DurableContext, durable_execution from pydantic_ai import Agent from pydantic_ai_harness.aws_lambda import AWSLambdaDurability, durable_agent_handler agent = Agent( "bedrock:us.amazon.nova-pro-v1:0", name="support", capabilities=[AWSLambdaDurability()], ) @agent.tool_plain def get_order_status(order_id: str) -> str: """注文IDから配送状況を返す""" return f"注文 {order_id}: 配送中(明日の午前中に到着予定)" @durable_execution @durable_agent_handler async def handler(event: dict[str, Any], context: DurableContext) -> str: result = await agent.run(str(event["prompt"])) return result.output
サンプルを動かしてみる • クエリ:注文 A-1001 はいまどういう状況ですか? • 回 答:注文 A-1001 は現在配送中で、明日の午前中に到着予定です。
TypeScript版がないやん! ◆Lambda durable functionsはTypeScriptも対応している • でもさっきのはPydantic AIの派生みたいなやつなのでTS対応していない そもそもStrandsで 対応してくれたら 良いのに…
作ってみた
minamo ◆TS×Lambda durable functions×AIエージェントなOSS • 短く書ける • stepごとにエージェントの挙動が保存される • Human
in the Loopを簡単に書けるようにする • できるだけ依存を少なくする(理想はHonoみたいな感じ)
minamo ◆TS×Lambda durable functions×AIエージェントなOSS • 短く書ける • stepごとにエージェントの挙動が保存される • Human
in the Loopを簡単に書けるようにする • できるだけ依存を少なくする(理想はHonoみたいな感じ) • 最近小型船舶免許を取った際に、船は車よりかなり色んなstepを踏みながら 準備・出航・操縦・帰港する必要があるのだと学んだ • Ex: 事前調査・出航前点検・ロープワーク・安全確認・海上での決まりごと・ トラシュー・着岸手順・メンテナンス… • Vibe運転ダメ絶対
minamo ◆TS×Lambda durable functions×AIエージェントなOSS • 短く書ける • stepごとにエージェントの挙動が保存される • Human
in the Loopを簡単に書けるようにする • できるだけ依存を少なくする(理想はHonoみたいな感じ) • 最近小型船舶免許を取った際に、船は車よりかなり色んなstepを踏みながら 準備・出航・操縦・帰港する必要があるのだと学んだ • Ex: 事前調査・出航前点検・ロープワーク・安全確認・海上での決まりごと・ トラシュー・着岸手順・メンテナンス… • Vibe運転ダメ絶対 • つまり船はdurable functionsだということに気が付き、そこから発想を得た ←彼は今適当なことを喋っています
minamo ◆一応公開とかしてみました • これからOSSとして育てていくかは不明です https://www.npmjs.com/package/@minamojs/minamo
minamo ◆書き方はこんな感じ(toolの書き方が長い) import { agent, RetryableError, tool } from "@minamojs/minamo";
import { bedrock } from "@minamojs/bedrock"; import { handle } from "@minamojs/lambda-df"; import { z } from "zod"; const support = agent({ name: "support", model: bedrock("us.anthropic.claude-haiku-4-5-20251001-v1:0"), instructions: "あなたはオンラインショップのカスタマーサポート担当です。", tools: { get_weather: tool({ description: "再配達の計画に使う、都市の天気予報を取得する。", input: z.object({ city: z.string() }), run: async ({ city }) => { const response = await weather.forecast(city); if (response.status === 503) throw new RetryableError("天気APIが一時的に使えません"); // 自動でリトライ return response.body; // それ以外の例外はエラー結果としてモデルに返る }, }), issue_refund: tool({ description: "人間が承認したあとに、注文を返金する。", input: z.object({ orderId: z.string(), amountYen: z.number().positive() }), approval: { when: ({ amountYen }) => amountYen >= 10_000, timeout: { hours: 1 } }, // 1万円以上は承認が必要 run: async (input, { idempotencyKey }) => payments.refund({ ...input, idempotencyKey }), }), }, }); export const handler = handle(support, { prompt: (event: { prompt: string }) => event.prompt, onHumanRequest: request => slack.notify(request.summary), // 承認依頼を通知(トークンはサーバー側に残す) });
サンプルアプリ アーキテクチャ • フロント:CloudFront, S3 • バック:API Gateway, Lambda, DynamoDB
• エージェント: Lambda durable functions, Bedrock • 画面更新:AppSync Events • 承認待ち:durable functions が保持 ※認証はCognito(図は省略) ※一部簡略化しています
まとめ
まとめ ◆Lambda durable functions面白い • サーバーレスだけど、サーバーレスゆえの制約をあの手この手で解消できる • エージェントと組み合わせて良い感じにHITL/HIOLを実現していきたい ◆小型船舶免許を取ろう •
えーあいにはできないことをやろう • 船の運転面白いよ!小型ジェットだけなら多分2日とかで取れます • 真冬の船上LT会を震えて待て(予定は一切未定です)
AI Builders Day 2026ぜひご参加ください! ◆Save the Date!10/25 23:59までプロポーザル募集中です!