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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Har1101
October 21, 2026
Programming
66
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
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.2k
Performance Optimization With LLMs
xleitix
0
140
Domain-Driven Transformation
hschwentner
2
2.3k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
270
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
510
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
2.5k
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
AWSに止められる覚悟してますか?
morizo_1984
2
540
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
[2026-10-14](C)Re:ゼロから始める異世界生活〜始まりの終わりと終わりの始まり〜
tosite
0
100
ジョジョの世界をXRで再現する
mofurune
0
170
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
220
Featured
See All Featured
Docker and Python
trallard
47
4.2k
Amusing Abliteration
ianozsvald
1
350
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Done Done
chrislema
187
17k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
950
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
Designing Experiences People Love
moore
143
24k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
New Earth Scene 8
popppiees
4
2.7k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
310
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までプロポーザル募集中です!