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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Har1101
October 21, 2026
Programming
61
0
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
1k
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
3
800
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
760
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
600
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
250
エージェンティックRAGにAWSで入門しよう!
har1101
9
2.4k
TypeScriptだけでAIエージェントを作る フロント・エージェント・インフラのフルスタック実践
har1101
7
2k
AgentCore Registry入門~マルチアカウントでどう使うの~
har1101
1
140
AgentCore×VPCでの設計パターンn選と勘所
har1101
4
730
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
220
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
170
golang-bob.pdf
iwatsukayura
0
130
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.6k
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
510
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
610
Railsバージョンを4倍にした話
optim
0
440
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.7k
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
190
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
750
Simple Storage Service(S3) is not simple
iwatsukayura
0
290
Featured
See All Featured
WENDY [Excerpt]
tessaabrams
14
40k
エンジニアに許された特別な時間の終わり
watany
109
250k
Building Applications with DynamoDB
mza
96
7.2k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
530
Utilizing Notion as your number one productivity tool
mfonobong
4
620
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
480
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Music & Morning Musume
bryan
48
7.4k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
How to Talk to Developers About Accessibility
jct
2
580
Become a Pro
speakerdeck
PRO
31
6.3k
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までプロポーザル募集中です!