Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Amazon Bedrock AgentCore ワークショップ JAWS UG TOHOKU...

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

Amazon Bedrock AgentCore ワークショップ JAWS UG TOHOKU / amazon-bedrock-agentcore-workshop-jawsug-tohoku-2026

Avatar for geeawa

geeawa

June 12, 2026

More Decks by geeawa

Other Decks in Technology

Transcript

  1. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Amazon Bedrock AgentCore ワークショップ 〜基本から⾼度なエージェント開発まで〜 Daisuke Awaji 【 J A W S - U G 東 北 】 A W S シ リ コ ン 最 前 線 × B E D R O C K A G E N T C O R E ハ ン ズ オ ン Solutions Architect Amazon Web Services Japan G.K.
  2. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Daisuke Awaji Amazon Web Services Japan Solutions Architect 2 @gee0awa Serverless, Genera,ve AI, Frontend ❤
  3. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 質問です 1、ローカルで動作する AI エージェントを使ったことがある 2、ローカルで動作する AI エージェントを作ったことがある 3、クラウドで動作する AI エージェントを作ったことがある 3
  4. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 質問です 1、ローカルで動作する AI エージェントを使ったことがある 2、ローカルで動作する AI エージェントを作ったことがある 3、クラウドで動作する AI エージェントを作ったことがある 4 今⽇のワークショップで全部やりましょう💪
  5. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Bedrock Engineer オープンソースとして公開している AI エージェントアプリケーション ファイルシステムの操作、ウェブ検索など 20 以上のツールを搭載しており、 多様な業務に特化したエージェントのカスタマイズが可能 https://github.com/aws-samples/bedrock-engineer
  6. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Bedrock Engineer のアーキテクチャ クラウドリソースの構築は不要(これこそまさに、サーバーレス︕︕) Amazon Bedrock を活⽤し、AI エージェントはローカル環境で実⾏される https://github.com/aws-samples/bedrock-engineer Amazon Bedrock ネイティブアプリ Prompt, ToolSpec Message, ToolUse Electron, Node.js, TypeScript
  7. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 7 ローカルで動くだけで良いのか 本番稼働を⾒据えて⼤規模にデプロイしたい…
  8. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. プロトタイプから本番への “キャズム” Performance Security Governance POC AI production agents Scalability Excitement and potential Challenges on the path to production Meaningful business value
  9. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Amazon Bedrock AgentCore エージェントを本番環境で稼働するために必要なエージェントプラットフォーム Runtime Memory Identity Gateway Code Interpreter Browser Policy Evaluations Observability
  10. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 10 エージェントを動かす。さてどこで︖
  11. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 11 ⻑い時間かかる Lambda では タイムアウト してしまうのでは︖ ユーザーごと セッションごとに ファイル分けるの ⼤変そう
  12. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 12 ⻑時間実⾏し、 VMが分離された環境で動作させることで 実現できるユースケース
  13. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 13 DEMO: ユーザーマニュアルの作成 作成されたユーザーマニュアル ユーザーからの指⽰(プロンプト)
  14. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 14 DEMO: Excel や CSV データを分析 ユーザーからの指⽰(プロンプト) 成果物
  15. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 15 DEMO: 惑星の軌道運動のシミュレーション ユーザーからの指⽰(プロンプト) 成果物
  16. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 16 DEMO: 研修動画の作成 ユーザーからの指⽰(プロンプト) 成果物 https://www.j-platpat.inpit.go.jp/manual/ja/pdf/gbd_image_search_manual.pdf
  17. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 17
  18. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 18 エージェントの実⾏時間の例 ユースケースの例 実⾏時間の⽬安 ウェブサイトを操作しユーザー向けマニュアルの作成とウェブサイトの公開 20 分 〜 30分 簡単なウェブ検索・調査・レポート作成 0.5分 〜 10分 ソフトウェア開発、コーディング(GitHub issue の要件からコードを実装し、テストを実 ⾏して Pull Request を起票する) 5 分 〜 30分 パワーポイントから研修動画の作成 10分 〜 30分 書類審査 0.5分 〜 10分 私の⼿元で簡単に実装して検証してみた⼀例を共有します ※実⾏時間はコンテンツの量や規模に依存して変化します。
  19. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 19 AI エージェントの実⾏環境に求められる要件 1. 迅速にスタートできること 開発のスピードを⾼めたい 2. マネージドでサーバーレスであること 運⽤⼯数をかけたくない 3. ⻑時間の実⾏時間ができること エージェントアプリケーションは実⾏時間が⻑くなる傾向になる 4. ⾼度な実⾏環境分離ができること ⾃律的なAIエージェントが他のユーザーのデータを誤操作させたくない 5. ペイロードサイズが⼤きい 画像や動画のようなマルチモーダルデータを⼊⼒できるサイズがほしい 6. モデルやフレームワークに依存しない 次々に新しい良いものが出てくるからどれかに依存したくない
  20. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 本番環境でのセキュアなデプロイ・エージェント実⾏のためのフルマネージドなエージェントランタイム 20 AgentCore Runtime • OSSフレームワーク: LangGraph, CrewAI, etc. • 様々なモデル: Amazon Bedrock, SageMaker, OpenAI, Gemini, etc. • プロトコル: MCP, A2A • Github, Salesforce, Google など サードパーティー リソースへの アクセスのための 組み込みの 認証情報管理機能 Memory, Gateway, Observability 等 他サービスとの統合 • テキスト, 画像, ⾳声, 動画を制限なく 双⽅向 ストリーミング • ペイロードサイズは 最⼤100MBまで対応 • ⾼速な初期化 (~200ms) • ⻑期間動作可能な ⾮同期ワークロード (最⼤8時間) • 持続的な 専⽤実⾏環境による 完全なセッション分離
  21. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Framework AI エージェントのソースコード Models AgentCore Runtime decorator + configure Docker file AgentCore Runtime AgentCore Runtime Endpoint Amazon ECR Repository launch Application invoke User AgentCore Observability config AgentCore Identity config AgentCore Runtime Agent Code-zip upload Amazon S3 Bucket launch AgentCore Runtime エージェントはここで動く 8 時間の⻑時間実⾏も可能 セッションごとに実⾏環境が分離される
  22. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 22 エージェントとの会話履歴、 記憶の管理はどうする︖
  23. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 23 セッションの保持、⻑期的な記憶も
  24. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 短期記憶 Chat Messages Session State 長期記憶 Semantic User Preferences Summary Automatic Memory Extraction Module AgentCore Memory async エージェントアプリからの呼び出し Messages Agent State List Events Events Retrieve Memory Records sync sync sync direct Agent Batch API for long-term Memory hydration async Custom Strategy Episodic AgentCore Memory ⻑期記憶の抽出 セッション管理
  25. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon ConfidenCal and Trademark. 25 エージェントのできることを 広げるには︖
  26. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon ConfidenCal and Trademark. 26 M365 を操作するエージェント
  27. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon ConfidenCal and Trademark. AgentCore Gateway の概要 既存の API、Lambda 関数、Remote MCPサーバーを束ねて単⼀の MCP サーバーとして利⽤可能。 ⼤量のツールの管理、各ツールの認証認可を⼀元的に⾏え、社内展開も容易に。 Agent MCP クライアント AgentCore Gateway OpenAPI 仕様の API AWS Lambda Amazon API Gateway MCP サーバー Smithy モデルによる API AgentCore Identity アイデンティティプロバイダー (Amazon Cognito, Okta, Microsoft Entra ID...) Inbound 認証 Outbound 認証 OAuth Authorization server (AS) 認可サーバーが公開 する JWK を⽤いて JWT を検証 Inbound OAuthトークン(JWT) Outbound • OAuthトークン • API キー • IAM ユーザーの代理 で認証トークン を発⾏
  28. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. AgentCore Gateway セマンティックサーチ AgentCore Gateway 検索なし 検索: 「SNS のポストを作成する」 ターゲット 1 250 ツール ターゲット 2 100 ツール ターゲット 3 10 ツール MCP ツールの⼀覧化 最も関連性の⾼い 4 つのツールを返却 数百のツールを持つサービス 300 以上のツールすべてを返却 検索あり 利点 • AgentCore Gateway は⾃動的にツールをインデックス化し、 サーバーレスのセマンティックサーチを提供 • エージェントの LLM に渡すコンテキストが短くなり、 精度とスピードの向上とコスト削減 • エージェントがタスクに関連したツールにフォーカス
  29. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 29 チャットをこえて
  30. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ユーザーの指⽰を待つことなく、イベントを監視して 必要に応じて通知や質問を⾏う⾃律型エージェントのアプローチ • イベントストリームをトリガーに⾃律的に⾏動する • 複数タスクを同時並⾏で処理 • Human-in-the-loop 完全⾃動ではなく、⼈間に必要なタイミングで確認を⾏う Ambient Agent
  31. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Ambient Agent Chat Agents Ambient Agents トリガー ⼈間からのメッセージ イベント 同時実⾏数 〜1 無制限 レイテンシー できるだけ早く ⻑くても良い UI/UX Chat UI Any
  32. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. イベント連携で起動する AI エージェント 32 Event Amazon Event Bridge S3 file uploaded Amazon Bedrock AgentCore GitHub Issue Created Slack message sent 書類審査 コーディング 週次レポート作成 GitHub S3 Slack etc.. ある程度⾃律的な判断が可能な業務、初⼿ AI で捌いてもよい作業をイベント駆動で実現する 例︓申請系処理で単純な項⽬漏れなどは AI が⾃動返信する、簡単な観点でレビューをパスしてから⼈間が書類を確認する 例︓クラウドのアラートをトリガーに AI が原因の調査特定、改善案の提案、ソースコードの修正まで⾏い⼈間が承認する
  33. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. サンプルソリューション 33
  34. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 34 Multi-agent Orchestration Chat on AgentCore Bedrock AgentCore で稼働する AI エージェントの OSS サンプル – 通称 MOCA プロンプトやツールをカスタマイズし、コーディングエージェントや運⽤エージェントも作れる パソコンでもスマホでも (モバイルフレンドリーなチャットUIのサンプルとして) AI エージェントを作る (システムプロンプト・ツールを組み合わせて) https://github.com/aws-samples/sample-multi-agent-orchestration-chat-on-agentcore
  35. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 35 Moca のアーキテクチャ
  36. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 36 デモ︓観葉植物のECサイトの不具合を治す GitHub デプロイ
  37. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 37
  38. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ソフトウェア開発と運⽤を AI に移譲する AWS Cloud(A省 Xシステム) GitHub 開発者 開発担当 エージェント AWS Cloud(システム) CI/CD バックログ管理 要件定義 エンドユーザー ヒアリング ・・・ GitHub Issue (機能追加リクエスト) 実装・テスト 運⽤担当 エージェント 異常検知 原因特定 セキュリティ レビュー・テスト 是正措置の提案 ログ・メトリクス・アラート 傾向分析 GitHub Issue 起票 ※ テスト環境を PR 単位にデプロイして受け⼊れ確認できる仕組みを構築する 本番環境 テスト環境 市場調査 週次報告 ※10万⾏程度のコードのソフトウェアで検証しています
  39. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon ConfidenCal and Trademark. ⽇時の運⽤レポートと、GitHub Issueへの起票例 スケジュール起動して⾃動的にこのプロンプトが送信されて起動する 作成された GitHub Issue
  40. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon ConfidenCal and Trademark. 40 Multi-agent Orchestration Chat on AgentCore Bedrock AgentCore で稼働する AI エージェントの OSS サンプル – 通称 MOCA プロンプトやツールをカスタマイズし、コーディングエージェントや運⽤エージェントも作れる パソコンでもスマホでも (モバイルフレンドリーなチャットUIのサンプルとして) https://github.com/aws-samples/sample-multi-agent-orchestration-chat-on-agentcore
  41. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon ConfidenCal and Trademark. 41 運⽤エージェントに関する話 https://jawsug-sre.connpass.com/event/390226/
  42. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon ConfidenCal and Trademark. Amazon Bedrock AgentCore プラットフォーム アプリ 任意のモデル Prompt Tools Context 任意の フレーム ワーク Runtime Identity Observability Gateway Browser Code Interpreter Memory Evaluations Policy ツール MCP 任意のプロバイダー OTEL A2A 任意の エージェント
  43. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 43
  44. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. ワークショップを始めましょう 44
  45. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. このワークショップで何を作るのか 共通の題材 ̶ AWS コスト⾒積りエージェント 1 つのエージェントを題材に、各 Lab で機能を段階的に拡張。「情報を集めて計算する」 という多くの業務に応⽤できる汎⽤パターン。 Foundation | Lab 1 – 5 信頼性の⾼いエージェントを構築する 1 Code Interpreter 計算するエージェント 2 Runtime クラウドへデプロイ 3 Memory 短期・⻑期の記憶 4 Observability トレースで監視 5 Evaluation 品質を測定 Extension | Lab 6 – 9 外部システムと安全に接続する 6 Identity 認証・認可 7 Gateway 外部ツールを MCP 化 8 Policy ツール単位のアクセス制御 9 Browser Use Web フォーム⾃動化 A 1 Kiro カスタムエージェント開発(付録)
  46. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 47 ワークショップを⾏う上での⼼構え
  47. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 48 コードを読み 理解する
  48. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Lab 1 Code Interpreter 49
  49. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Lab 1: Code Interpreter 計算するエージェント Foundation · Lab 1 AI エージェントの動作ループ ①計画を⽴て → ②ツールを使い → ③観測結果で計画を更新 エージェントの中⾝は 3 つだけ ① 基盤モデル 計画を⽴てるエンジン(Claude など) ② ツール AWS Pricing MCP Server(価格取得)/ Code Interpreter(計算) ③ システムプロンプト エージェントへの指⽰(振る舞いの定義) Code Interpreter で安全に計算を実⾏ • AI が⽣成したコードを隔離環境で安全に実⾏ • フルマネージドで運⽤ゼロ・使った分だけ従量課⾦ • Python / JS / TS と pandas ・ NumPy 等が即利⽤可
  50. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. AgentCore Code Interpreter クエリ 1. LLM 呼び出し 2. ツール選択 4. ツール結果 結果 セッション作成 3. テレメトリ Code Interpreter シェル ファイルシステム LLM Observability エージェント ユーザー
  51. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Lab 1: 実装と Code Interpreter の操作 Foundation · Lab 1 エージェントの定義(Strands Agents) all_tools = [self.execute_cost_calculation] + pricing_tools agent = Agent( BedrockModel(model_id=DEFAULT_MODEL), tools=all_tools, # 価格取得 + 計算 system_prompt=SYSTEM_PROMPT # 振る舞いの指⽰ ) Python Code Interpreter の操作 from bedrock_agentcore.tools.code_interpreter_client import CodeInterpreter interpreter = CodeInterpreter(region="us-west-2") # 1. 作成 interpreter.start() # 2. 起動 result = interpreter.invoke("executeCode", { # 3. 実⾏ "language": "python", "code": "print('Hello from secure sandbox!')" }) interpreter.stop() # 4. 停⽌ Python 実⾏ ̶ ⾃然⾔語の指⽰で⾒積りが返る uv run python test_cost_estimator_agent.py ¥ --architecture "パン屋の Web サイトを HTML でなるべく安く作りたい" Bash
  52. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon ConfidenCal and Trademark. 53 余談)本⽇のスライドについて 本⽇のスライドは Claude を使⽤し、AWS の SA が OSS として公開した Spec-Driven Presentation Maker のスキルを活⽤して⽣成しています。 https://aws.amazon.com/jp/blogs/news/spec-driven-presentation-maker-ja/
  53. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon ConfidenCal and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Lab 2 Runtime 54
  54. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Framework AI エージェントのソースコード Models AgentCore Runtime decorator + configure Docker file AgentCore Runtime AgentCore Runtime Endpoint Amazon ECR Repository launch Application invoke User AgentCore Observability config AgentCore Identity config AgentCore Runtime Agent Code-zip upload Amazon S3 Bucket launch AgentCore Runtime エージェントはここで動く 8 時間の⻑時間実⾏も可能 セッションごとに実⾏環境が分離される
  55. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 3 ステップでデプロイ ① prepare_agent.py IAM ロール作成・ソースコピー ② agentcore configure .bedrock_agentcore.yaml を⽣成 ③ agentcore deploy ビルド → ECR push → Runtime 作成 エントリポイント deployment/invoke.py app = BedrockAgentCoreApp() @app.entrypoint def invoke(payload): user_input = payload.get("prompt") agent = AWSCostEstimatorAgent() return agent.estimate_costs(user_input) if __name__ == "__main__": app.run() Python 追加で必要なのは 2 つだけ ✓ invoke.py(エントリポイント) ✓ requirements.txt(依存関係) Bedrock AgentCore Starter Toolkit が⾃動化 デプロイ後のテスト︓ コンソール / コマンドから呼び出し uv run agentcore invoke '"prompt" : "⼩規模な EC2 で SSH 接続環境を準備したい。コストは︖"}'
  56. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 57 Workshop Account で権限エラーが出る場合 稀に以下のエラーが出る場合があります。 botocore.errorfactory.AccessDeniedException: An error occurred (AccessDeniedException) when calling the ConverseStream o └ Bedrock region: us-west-2 └ Model id: us.anthropic.claude-sonnet-4-6 📊 Regular response length: 5869 characters Result preview: ❌ Cost estimation failed: An error occurred (AccessDeniedException) when calling the ConverseStream opera 環境変数で使⽤するリージョンを切り替えてご利⽤ください。 par$cipant:/$ export AWS_DEFAULT_REGION=us-east-1 par$cipant:/$ export AWS_REGION=us-east-1
  57. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Lab 3 Memory 58
  58. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Lab 3: Memory — 短期記憶と⻑期記憶 短期記憶 Short-term 対話をイベントとして保存。 セッション内の⽂脈を維持する。 Memory Strategy 短期記憶を⻑期記憶へ移⾏ ⻑期記憶 Long-term 会話の要約・事実・好みなどを、 次セッションへ引き継ぐ洞察として保存 。 Memory Strategy の種類 ̶ ⽤途で選び、カスタムも可能 Semantic 会話から得られた事実や知 識に注⽬ 今回使⽤ UserPreference ユーザーの好みや選択パタ ーンに注⽬ Summary 要点や決定事項に注⽬ Episodic ユーザーの意図に対し効果 的だった⾏動に注⽬
  59. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 短期記憶 Chat Messages Session State 長期記憶 Semantic User Preferences Summary Automatic Memory Extraction Module AgentCore Memory async エージェントアプリからの呼び出し Messages Agent State List Events Events Retrieve Memory Records sync sync sync direct Agent Batch API for long-term Memory hydration async Custom Strategy Episodic AgentCore Memory ⻑期記憶の抽出 セッション管理
  60. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Lab 3: 記憶の API 操作 Memory の作成 ̶ Strategy 指定で⻑期記憶を有効化 self.memory = self.memory_client.create_memory_and_wait( name=memory_name, strategies=[{ "userPreferenceMemoryStrategy": { "name": "UserPreferenceExtractor", "namespaces": [f"/preferences/self.actor_id}"] } }], event_expiry_days=7, ) Python namespace で記憶を分離 • namespace に顧客 ID 等を含め、ユーザー 間のデータ混在を防⽌ • strategies は複数形 ̶ 単位ごとに記憶を 設計可能 • 短期→⻑期の移⾏は Strategy が⾃動で記 録 create_event 短期に保存 create_event( memory_id, actor_id, session_id, messages=[ (user, "USER"), (resp, "ASSISTANT"), ], ) list_events 短期を取得 → compare list_events( memory_id, actor_id, session_id, max_results=4, ) # 過去の⾒積りを⽐較 retrieve_memories ⻑期を検索 → propose retrieve_memories( memory_id, namespace, query=..., top_k=3, ) # 好みで提案
  61. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon ConfidenCal and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Lab 4 Observability 62
  62. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. AgentCore Observability AgentCore Observability AgentCore Memory AgentCore Identity AgentCore Gateway AgentCore Browser & Code Interpreter Runtime フレームワーク ADOT AI エージェントテレメトリー サービステレメトリー 3P OTEL サードパーティ オブザーバビリティダッシュボード AI エージェントテレメトリー 2 3 1 AI エージェ ントとサービ スが⽣成した OTEL の⾃動 リンク 1 2 3 AgentCore Observability で AI エージェント実⾏ト レースを収集 または、サードパー ティオブザーバビリ ティツールで AI エー ジェント実⾏トレース を収集 オプションで、 AgentCore Observability でサー ビスレベルトレースを 有効化 AgentCore Evaluations AgentCore Observability ダッシュボード
  63. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Observability — トレースで監視 3 階層で動作を記録 Session ▸ Trace ▸ Span Session ̶ 会話全体(インタラクション全体) Trace ̶ 1 回のリクエスト〜レスポンス Span ̶ 個々の処理(モデル / ツール呼出) Span 同⼠は階層的に管理され、処理の流 れ(ツリー構造)が把握しやすい。 Timeline で処理時間をブレイクダウン、 Trajectory でダイアグラム表⽰も可能。 Span 内の Event を⾒れば、⼊出⼒プロン プトやツール呼出まで確認できる。
  64. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Lab 5 Evaluation 65
  65. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. エージェントには「継続的な」評価が必要 ユーザー プロンプトの修正 新バージョンの エージェント モデルの 更新 ツールの 追加 / 削除 エージェント開発者の関⼼事 エージェントは⽬的を達成できるか︖ エージェントの意思決定は正しいか︖ 最適なツールを利⽤しているか︖ 最終回答は正しいか︖ エージェント
  66. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. エンドツーエンドのエージェント評価ライフサイクル 開発 デプロイ 本番運⽤ ペルソナ 評価の⽬的 エージェント開発者 DevOps SRE / 運⽤担当 迅速な試⾏錯誤と 変更の検証 リリース前の 安全性検証 本番運⽤中の性能監視 運⽤時のインサイトを開発にフィードバック
  67. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. AWS はライフサイクル全体で評価ツールを提供 AgentCore Evaluations Strands Evalua3on 開発 デプロイ 本番運⽤
  68. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. AgentCore Evaluations エージェント ユーザー AgentCore Evaluations ジャッジの説明とともに 結果を書き込む 各メトリクスに対して LLM ジャッジを呼び出す AgentCore Observability エージェント オーナー 設定 モニタリング と評価 オンデマンド AgentCore Runtime AgentCore Gateway AgentCore Memory
  69. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 異なるニーズに対応する 2 つの評価モード エージェントの評価メトリクスは、最適化したいディメンションに依存します 開発と CI/CD 本番モニタリング オンライン評価 • ライブエージェントインタ ラクションをモニタリング • トレースを継続的に サンプリング • 品質低下を検出 ユースケース • サイレント障害をキャッチ • 品質トレンドを追跡 • デプロイ後のモニタリング • 継続的な信頼性を保証 オンデマンド評価 • デプロイ前に変更をテスト • CI/CD で評価テストを実行 • ビルドのリグレッションテスト • 品質に基づいてデプロイをゲート ユースケース • プロンプトの変更を検証 • モデルのパフォーマンスを 比較 • 品質リグレッションを防止 • 品質ゲートを自動化
  70. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. AgentCore Evaluations - demo
  71. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. GENERALLY AVAILABLE エージェント テストケース 評価器 データセット タスク関数 評価の実⾏ 評価 レポート Strands Evaluations エージェント構成の実験 テストケースと評価器の定義 任意のタスク関数に対して実⾏ シミュレーション⾃動⽣成 エージェントとのマルチターン会話 のシミュレーション 事前定義済みとカスタム 8 の評価器を搭載 カスタムメトリクスの定義 https://github.com/strands-agents/evals
  72. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. AgentCore & Strands による E2E 評価 開発 デプロイ 本番運⽤ • Ground Truth データの評価 (Strands) • データセットシミュレーション (Strands) • LLM as a Judge 評価 (Strands and AgentCore) • ⼩規模のテストケースでの 検証 (Strands) • より⼤きな規模の「実世界」 における LLM as a Judge (AgentCore) • デプロイ承認の意思決定 • CI / CD 統合 • ユーザーとのやりとりの 監視 (AgentCore) • ドリフトの検知
  73. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Lab 5: Evaluation の流れ 評価ファースト ̶ 測定可能な⽬標がなければ、終わりのないプロンプト調整が続く。初期から評価を組み込む。 コスト⾒積りは QCD(品質・コスト・速度) で評価 ̶ 価格取得ツールの呼出と最終出⼒を⾒る。 ① ローカル評価 strands-agents-evals 結果はターミナル ② オンデマンド評価 AgentCore Evaluate API 特定の Span/Trace/Session を都度 ③ オンライン評価 Runtime 上で継続監視 結果は CloudWatch 評価対象は 2 点 ̶ ツール呼出と最終出⼒ 観点 期待 ローカル評価 オンデマンド / オンライン ツール呼出 get_pricing API で実際の価格を取得 ToolCallEvaluator(カスタム・ Span 検査) カスタム評価器(llmAsAJudge) 出⼒ サービス別の具体的なコストを含む OutputEvaluator(ルーブリック) Builtin.Correctness
  74. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Lab 5: Experiment と評価器の構築 Foundation · Lab 5 Experiment = テストケース + タスク関数 + 評価器 from strands_evals import Case, Experiment cases = [Case( name="single-ec2", input="One EC2 t3.micro 24/7 in us-east-1", expected_trajectory=["get_pricing"], )] def task_fn(case): agent = AWSCostEstimatorAgent() return { "output": agent.estimate_costs(case.input), "trajectory": spans, } experiment = Experiment( cases=cases, evaluators=[output_evaluator, tool_evaluator], ) reports = experiment.run_evaluations(task_fn) Python OutputEvaluator (ビルトイン) ルーブリックで出⼒を採点(具体的な⾦額とサービス列挙 → 1.0) ToolCallEvaluator (カスタム) OTel Span を⾛査し、 get_pricing が呼ばれたか検証する オンライン評価の結果 ̶ CloudWatch で 100% スコアを確認
  75. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Lab 6 Identity 76
  76. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. エージェント (hosted/ self-hosted) AgentCore Gateway (ツール) ユーザー AWS リソース /エージェント (IAM 経由) Agent Inbound Auth アプリ ユーザー ID プロバイダ ユーザーはアプリケー ションを通じてエー ジェントにアクセスす る必要があります 外部リソース /エージェント (Oauth、API キー など経由) Gateway Inbound Auth Agent Outbound Auth (IAM) Agent Outbound Auth (OAuth/API キー) Agent Outbound Auth (OAuth/API キー) AgentCore Identity Gateway Outbound Auth OAuth トークン エージェントはリソースに アクセスする必要があります エージェントはリソースに アクセスする必要があります エージェントはリソースに アクセスする必要があります Gateway はダウンストリーム リソースにアクセスする必要 があります
  77. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Lab 6: Identity — AI エージェントの認証認可 3 つのリソースで安全にアクセス制御 Amazon Cognito 認証サーバー(ユーザー認証) AgentCore Identity 認可プロセス + Token Vault に保管 Secure Runtime 認可済みアクセストークンを要求 開発者はデコレーター 1 つ追加するだけ @requires_access_token( provider_name="cognito", scopes=[...], auth_flow="M2M", ) def call_agent(*, access_token: str): # OAuth 認可を実⾏し access_token が⾃動で渡される ... Python AgentCore Identity の強み • GitHub / Google / Microsoft / Slack と容 易に連携 • Token Vault に暗号化して集中管理(AWS / CMK 鍵) • クレデンシャルのリフレッシュを⾃動化
  78. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Lab 7 Gateway 79
  79. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. AgentCore Gateway の概要 既存の API、Lambda 関数、Remote MCPサーバーを束ねて単⼀の MCP サーバーとして利⽤可能。 ⼤量のツールの管理、各ツールの認証認可を⼀元的に⾏え、社内展開も容易に。 Agent MCP クライアント AgentCore Gateway OpenAPI 仕様の API AWS Lambda Amazon API Gateway MCP サーバー Smithy モデルによる API AgentCore Identity アイデンティティプロバイダー (Amazon Cognito, Okta, Microsoft Entra ID...) Inbound 認証 Outbound 認証 OAuth Authorization server (AS) 認可サーバーが公開 する JWK を⽤いて JWT を検証 Inbound OAuthトークン(JWT) Outbound • OAuthトークン • API キー • IAM ユーザーの代理 で認証トークン を発⾏
  80. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. AgentCore Gateway セマンティックサーチ AgentCore Gateway 検索なし 検索: 「SNS のポストを作成する」 ターゲット 1 250 ツール ターゲット 2 100 ツール ターゲット 3 10 ツール MCP ツールの⼀覧化 最も関連性の⾼い 4 つのツールを返却 数百のツールを持つサービス 300 以上のツールすべてを返却 検索あり 利点 • AgentCore Gateway は⾃動的にツールをインデックス化し、 サーバーレスのセマンティックサーチを提供 • エージェントの LLM に渡すコンテキストが短くなり、 精度とスピードの向上とコスト削減 • エージェントがタスクに関連したツールにフォーカス
  81. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon ConfidenCal and Trademark. Lab 7: Gateway — 外部サービスを MCP に変換 シナリオ ̶ ⾒積りレポートをメールで送信したい Inbound Cognito 認可(Lab 6 を利⽤) AI エージェント MCP AgentCore Gateway MCP エンドポイント AWS Lambda markdown_to_email メール送信 Outbound Lambda を Target 登録 → MCP 化 Lambda を MCP 化 メール送信 Lambda を Gateway の Target に登録するだけで、 MCP 経由で呼べるツールになる。 Inbound 認可 Lab 6 で構築した AgentCore Identity を⼊⼝の認可として再利 ⽤し、 Gateway へのアクセスをセ キュアに。 複数 API を統合 Outbound に複数の Target を設定 でき、様々な API を 1 つの MCP 窓⼝に統合できる。
  82. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Lab 8 Policy 83
  83. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. エンドツーエンドのエージェント制御機能 Gateway Runtime IdP Identity Policy クレデンシャル プロバイダー Gateway Interceptors ツール ユーザー同意 カスタム OAuth 属性 リソース ポリシー PrivateLink | VPC | Amazon Bedrock Guardrails | IAM
  84. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. AgentCore Policy ツール呼び出し リクエスト AgentCore Policy 動的な ポリシー評価 許可 / 拒否 AgentCore Observability 許可された ツール呼び出し エージェントと MCP クライアント ツール、API、 システム、 データ 保護された リソース ポリシーライフ サイクル管理 ポリシーの⽣成 (NL2Cedar) ポリシー 管理者 ユーザー AgentCore Gateway エージェントのガードレール ⾃律的に⾏動させつつ コンプライアンス境界内に留める 検証可能な正しさ ⾃動推論ベースで構築 Cedar ⾔語を利⽤ ⾼速かつ⼀貫した評価 ミリ秒でポリシーを評価 エージェントの遅延は最⼩限
  85. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. AgentCore Gateway Interceptors AgentCore Gateway Inboun d J WT MCP リクエスト リクエスト Interceptor 1 2 3 5 変換された リクエスト でターゲットを呼び出し レスポンス Interceptor 4 オリジナルの レスポンス 変換された レスポンス Ou t bou nd J WT , AP I Key or IAM REST API, Lambda, API Gateway, MCP server, … きめ細やかなアクセス制御 スキーマ変換 カスタムヘッダー伝搬 ツールごとの認可 テナント分離 データ無害化 できること interceptors の動作
  86. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. きめ細やかなアクセス制御のオプション シンプル な オーソライザー AgentCore Policy Gateway Interceptor Runtime & Gateway Identity IdP JWT authorizer Allow if tenant_id = ABC Gateway $200 返⾦リクエスト Policy group: Admin scope: read tenant_id: ABC Allow if refund < 100 and group = Admin JWT authorizer Allow if tenant_id = ABC Gateway JWT authorizer Allow if tenant_id = ABC Gateway Interceptor Fully custom, list tools, search tools, invoke tool Fine Finer Finest JWT Token
  87. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Lab 8: Policy — きめ細かいツールアクセス制御 Extension · Lab 8 IAM を補完する、ツール単位の制御 観点 IAM AgentCore Policy スコープ AWS サービスレベル Gateway 内のツールレベル 答える問い Gateway を呼べるか︖ この特定のツールを使えるか ⾔語 JSON ポリシー Cedar(⼈が読め、検証可能) 粒度 API アクション 個別ツール( markdown_to_email) • ⾃然⾔語から Cedar を⽣成する NL2Cedar も利⽤可能 Cedar で許可 / 拒否を定義 permit ( principal is User, // 誰が action == Action, // どのツールを resource == Gateway // どの Gateway で ) when { /* scope が⼀致するとき */ }; デモ︓ スコープでツールアクセスを制御(デフォルト拒否) ✗ Developer (scope: invoke developer のみ) markdown_to_email はツール⼀覧に表⽰されない ✓ Manager (scope: invoke manager) markdown_to_email の呼び出しが許可される
  88. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Lab 9 Browser 89
  89. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon ConfidenCal and Trademark. AgentCore Browser エージェント LLM 1. クエリ (Amazon で靴を買う) ユーザー 2. LLM の呼び出し コンピューターツール呼び出し 命令をコマンドに変換 Browser_use, Playwright, etc. 3. ツール利⽤ 4. コマンド変換 5. コマンド実⾏ 6. スクリーショット 実⾏環境 ヘッドレスブラウザー ライブラリーサーバー (Browser_use, Playwright, etc.) { type: ”click”, button: ”left”, x: 286, y:102 }
  90. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Lab 9: Browser Use — Web フォーム⾃動化 API が無い外部システムも⾃動化 API 未対応の Web フォームでも、ブラウザを操作して⼊⼒を⾃動化 ̶ エージェントが扱える世界が広がる。 AI エージェント AgentCore Browser マネージドブラウザ Playwright 操作を⾃動化 Web フォーム 外部システムに⾒⽴て マネージドなブラウザ環境 AgentCore Browser がヘッドレスブラウザをフルマ ネージドで提供。インフラ管理は不要。 ⼈間の操作を再現 Playwright でクリックや⼊⼒を再現し、外部システ ムに⾒⽴てた Web フォーム⼊⼒を⾃動化する。
  91. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Lab A-1: Kiro でカスタムエージェント開発 付録 · Lab A-1 学んだことを活かして⾃作エージェントを作る Kiro とは Spec Driven Development を⽀援する統合開発環境 (IDE)。 仕様を⽂書化することで⽣成コードの精度が上がり、 設計がチームに共有される。 Spec Driven Development の 3 フェーズ requirements.md design.md task.md 仕様を確認・承認できれば、実装は AI コーディングエージェントが担う 演習の流れ 1 Kiro CLI を起動 kiro-cli --agent agent-builder 2 Spec を執筆 作りたいエージェントを⾔葉で伝える → README.md を⽣成 3 実装 Kiro に「 README.md の通りに実装して」と依頼するだけ 4 デプロイ(Lab 2 と同様) uv run agentcore launch --local-build ポイント 仕様を⽂書化することで⽣成コードの精度が上がり、設計がチームに共有される ̶ デプロイ中のエラーは Kiro CLI に貼れば原因特定・修正まで⽀援
  92. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon ConfidenCal and Trademark. まとめ︓学んだことと次のステップ 1 つのエージェントを、信頼できる⼟台から外部連携、そして⾃作まで育てた Foundation ̶ 信頼できるエージェント ✓ Lab 1 Code Interpreter ̶ 仕組みと安全な計算 ✓ Lab 2 Runtime ̶ クラウドへデプロイ ✓ Lab 3 Memory ̶ 短期・⻑期の記憶 ✓ Lab 4 Observability ̶ トレースで監視 ✓ Lab 5 Evaluation ̶ 品質を測定 Extension ̶ 外部システムと接続 ✓ Lab 6 Identity ̶ 認証・認可 ✓ Lab 7 Gateway ̶ 外部ツールを MCP 化 ✓ Lab 8 Policy ̶ ツール単位のアクセス制御 ✓ Lab 9 Browser Use ̶ Web フォーム⾃動化 ✓ Lab A-1 Kiro ̶ カスタムエージェント開発 次のステップ Identity ・ Gateway ・ Memory などの機能を組み合わせ、 より⾼度な AI エージェントをぜひ実装してみてください。 不要になったリソースは各 Lab の clean_resources.py で削除できます ワークショップ はこちら catalog.workshops.a ws
  93. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Thank you! © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.