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
デモ実装で考えるStrands Agentsのいいところ
Search
yoko / Naoki Yokomachi
July 22, 2025
1.9k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
デモ実装で考えるStrands Agentsのいいところ
yoko / Naoki Yokomachi
July 22, 2025
More Decks by yoko / Naoki Yokomachi
See All by yoko / Naoki Yokomachi
正しさだけではプロジェクトは進まないから | Become an AI Agent Orchestration Engineer
yokomachi
1
24
Inside the collaboration paradox -AI駆動開発とアジャイル開発と60%と20%とハーネスと私-
yokomachi
1
220
Code Interpreter で、AIに安全に コードを書かせる。
yokomachi
0
9.1k
Building a Personal AI Agent with Strands Agents × Amazon Bedrock AgentCore
yokomachi
1
50
Strands Agents × Amazon Bedrock AgentCoreで パーソナルAIエージェントを作ろう
yokomachi
3
400
身体を持ったパーソナルAIエージェントの 可能性を探る開発
yokomachi
1
210
AITuberKit+Bedrock AgentCoreで作る 3Dキャラクターエージェント
yokomachi
2
3.5k
ご飯食べながらエージェントが開発できる。そう、Agentic Engineeringならね。
yokomachi
1
480
"人"が頑張るAI駆動開発
yokomachi
1
960
Featured
See All Featured
Prompt Engineering for Job Search
mfonobong
0
450
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
680
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
450
Designing for Performance
lara
611
70k
Tell your own story through comics
letsgokoyo
1
1.1k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
270
Large-scale JavaScript Application Architecture
addyosmani
515
110k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
440
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
660
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
380
Transcript
2025/07/23 デモ実装で考える デモ実装で考える StrandsAgentsのいいところ StrandsAgentsのいいところ
Profile 名前: 横町直樹 好きなAWSサービス: AWSLambda X: yoko/@_cityside
・StrandsAgents、MCPの概要 ・デモの開発経緯 ・所感 話すこと 話すこと 話さないこと 話さないこと ・StrandsAgents、MCPの詳しい仕様 ・ソースコードの解説 ・AmazonBedrockAgentCore
Agenda やりたかったこと 構成図 実装 まとめ デモ StrandsAgentsのいいところ
やりたかったこと やりたかったこと →全部いっぺんにやろう! ついでにあれとかこれもやりたいし…
デモの要件 ・CloudTrailのAPIをたたいて ユーザーの⾏動履歴を調査するエージェント やりたかったこと やりたかったこと
例えばこんなとき・・・
やばい、なんかやらかして環境壊した とりあえず自分が何やってたか整理しよう
こんなときはCloudTrail でもこの手の調査大変だよな
なるほど、 君は今日〇時〇分にログインして、 このサービスのこの画面でこの作業してたんちゃう?(AI)
作ったもの 作ったもの
構成図 構成図 Strands Agents MCP Ser ver 全部CDKでデプロイ
MCP? MCP? 2025年上期バズワード 「MCP(ModelContextProtocol)」 アプリがLLMに対してコンテキストを与えるためのプロトコル 外部システムと連携する⽅法を標準化する Web検索したりGitHub操作をしたり、ローカルファイルを操作したり… →LLMが必要なタイミングでツールを実⾏ 標準化でアプリケーションを横断したエコシステムが作りやすくなった
MCP:実装 MCP:実装 機能 ・HTTPリクエストを受け付ける ・ツール実⾏のリクエストに応じてCloudTrailのAPIを実⾏して結果を返す ・必要なリソース以外にはアクセスしない
MCP:実装 MCP:実装 機能の実現 ・HTTPリクエストを受け付ける →LambdaWebAdapter+FunctionURLs ・ツール実⾏のリクエストに応じてCloudTrailのAPIを実⾏して結果を返す →FastMCP2.0 ・必要なリソース以外にはアクセスしない →IAMRole
MCP:実装 MCP:実装 Lambda関数 #FastMCPサーバーの初期化(ステートレスモード) mcp=FastMCP(stateless_http=True,json_response=True) #MCPツールの定義。実質CloudTrailのLookupEventsAPIをラップしただけ @mcp.tool deflookup_cloudtrail_events() #FastAPIアプリケーションを取得 app=mcp.http_app()
Dockerfile #CopyAWSLambdaWebAdapter COPY--from=public.ecr.aws/awsguru/aws-lambda-adapter:0.9.1/lambda-adapter/opt/extensions/lambda-adapter
from strands import Agent agent = Agent( model=model, tools=tools, system_prompt=system_prompt
) Strands Agents? Strands Agents? オープンソースのエージェント開発フレームワーク 👆これだけでAIエージェントが定義できる
モデル駆動 推論・ツール使用 ・応答生成のサイクルを 最先端LLMの性能に委ねるアプローチ 他フレームワークの例: ・LangGraph→Graph ・Mastra→Workflow Strands Agents? Strands
Agents? プ ロ ンプ ト と ツ ー ル 渡 す か ら 自 分 で 判 断 して タ ス ク して ね !
AgenticLoop プロンプト、コンテキスト、使⽤できるツールを渡しながらLLMを呼び出し、 LLMが動的に計画したステップの遂⾏を繰り返すStrandsAgentsのコア機能 StrandsAgents? StrandsAgents? 引⽤元:https://aws.amazon.com/jp/blogs/news/introducing-strands-agents-an-open-source-ai-agents-sdk/
StrandsAgents:実装 StrandsAgents:実装 機能 ・チャットベース ・東京リージョンのClaude3.5SonnetV2 ・ユーザーの要求に応じてMCPツールを実⾏
StrandsAgents:実装 StrandsAgents:実装 機能の実現 ・チャットベース →Streamlit ・東京リージョンのClaude3.5SonnetV2 ・ユーザーの要求に応じてMCPツールを実⾏ →StrandsAgents
StrandsAgents:実装 StrandsAgents:実装 ソースコード(抜粋) #使⽤するモデルの定義 bedrock_model=BedrockModel( model_id= apac.anthropic.claude-3-5-sonnet-20241022-v2:0 , region_name= ap-northeast-1
, temperature=0.7, max_tokens=4000 ) #MCPクライアント、ツールの定義 MCP_URL=os.environ[ MCP_URL ] mcp_client=MCPClient(lambda:streamablehttp_client(MCP_URL)) mcp_tools=mcp_client.list_tools_sync() #エージェントの定義 agent=Agent( model=bedrock_model, tools=all_tools, system_prompt=system_prompt ) #エージェントの応答をストリーミング loop=asyncio.new_event_loop() response=loop.run_until_complete(stream_agent_response(agent,prompt,st.container())) loop.close()
StrandsAgents:実装 StrandsAgents:実装 ファイル全部でこれだけ aws-detective-agent/ ├──app/#エージェントアプリ │├──main.py │├──requirements.txt │├──Dockerfile ├──lambda/#MCPサーバー │├──mcpserver/
││└──main.py │├──Dockerfile │└──pyproject.toml ├──lib/ #CDK │├──config.ts │└──stack.ts ├──bin/ #CDK │└──app.ts └──cdk.json └──package.json
None
MCP:まとめ MCP:まとめ ・CDKによる実装例を作れたのはよかった。モノレポも使いやすい。 ・ProdではMCPサーバーの認証にAPIGatewayやCloudFrontが必要 ・MCPツールのアクセス範囲をIAMロールで定義できるのは体験がいい ・ノンエンジニアでもMCPツールが利⽤しやすい ※ローカルMCPだがLambda⽤MCPサーバーも公開されている AWSLambdaMCPServer https://awslabs.github.io/mcp/servers/lambda-tool-mcp-server/
・UI実装がStreamlit⼀強 →AG-UIのサポートを期待。⼀応ロードマップにはあり →TypeScriptのサポートもロードマップにはあるが時期未定 ほかの選択肢 ・Gradio,Dash,Reflex,Chainlit,etc. →どれも触ったことないのでおススメあれば教えてください! そして今なら… でロジック実装、任意の⾔語でUI実装も楽に? StrandsAgents:まとめ StrandsAgents:まとめ
・⼿軽 →MastraやLangGraphに⽐べて⼀番お⼿軽。 モデル駆動の影響が⼤きい? 今回の範囲は表層of表層 マルチモーダル、マルチエージェント、AWS統合など、公式ツールも沢⼭ StrandsAgents:まとめ StrandsAgents:まとめ
Agent Strands Agentsのいいところ Strands Agentsのいいところ
Agent Strands Agents Strands Agents Strands Agentsのいいところ Strands Agentsのいいところ
「エージェント実装を簡単にし、 ツールやプロンプト、あるいはRAGやメモリ管理… 即ちコンテキストエンジニアリングに時間をかけられる」 というのはStrandsAgentsの価値かもしれない。 StrandsAgentsのいいところ StrandsAgentsのいいところ 引⽤: https://x.com/JnBrymn/status/1946213071476646172
おしまい おしまい 参考 https://strandsagents.com/latest/ https://github.com/jlowin/fastmcp https://github.com/ag-ui-protocol/ag-ui https://github.com/strands-agents/sdk-python https://github.com/awslabs/mcp/blob/main/src/lambda-tool-mcp-server https://aws.amazon.com/jp/blogs/news/introducing-strands-agents-an-open-source-ai-agents-sdk/ https://qiita.com/minorun365/items/dd05a3e4938482ac6055
https://qiita.com/kyuko/items/cb75e8f0a50985ca2030 https://qiita.com/5enxia/items/0dfca327e8f14f0b9d86 https://www.ranthebuilder.cloud/post/mcp-server-on-aws-lambda https://memoribuka-lab.com/?p=4460#google_vignette https://dev.classmethod.jp/articles/aws-lambda-mpc-server/