《使用 Serverless、Strands 和 MCP 构建 AI 代理 [重复].pdf》由会员分享,可在线阅读,更多相关《使用 Serverless、Strands 和 MCP 构建 AI 代理 [重复].pdf(17页珍藏版)》请在三个皮匠报告上搜索。
1、 2025,Amazon Web Services,Inc.or its affiliates.All rights reserved.2025,Amazon Web Services,Inc.or its affiliates.All rights reserved.N T A 4 0 5Building AI Agents with Serverless,Strands,and MCPRahul PopatSenior Solutions Architect,AWSBhavin ShahSenior Solutions Architect,AWS 2025,Amazon Web Servi
2、ces,Inc.or its affiliates.All rights reserved.AgendaWhat is Agentic AI?Building AI Agent with Strands SDKMCP Tools integrationServerless deployment on AWSArchitecture and workflowLets build 2025,Amazon Web Services,Inc.or its affiliates.All rights reserved.Why do we need an AI Agent?Multi-step reaso
3、ning-Plans and executes complex workflows Tool integration-Access APIs,databases,external services Autonomous behavior-Makes decisions and takes actions Real-time data access-Fetches current information when needed Dynamic responses-Adapts based on current context 2025,Amazon Web Services,Inc.or its
4、 affiliates.All rights reserved.Agentic AI Loop 2025,Amazon Web Services,Inc.or its affiliates.All rights reserved.Strands AgentsStrands Agents is an open source python SDK for building agents using just a few lines of code 2025,Amazon Web Services,Inc.or its affiliates.All rights reserved.Create a
5、Simple Agentfrom strands import Agent#Initialize your agentagent=Agent(system_prompt=You are a helpful assistant that provides concise responses.)#Send a message to the agentresponse=agent(”Hello!What can you do?)print(response)2025,Amazon Web Services,Inc.or its affiliates.All rights reserved.Model
6、 Selectionfrom strands import Agentfrom strands.models import BedrockModelmodel=BedrockModel(model_id=us.amazon.nova-premier-v1:0,params=max_tokens:1600,temperature:0.7)agent=Agent(model=model)response=agent(”How can you help me?)2025,Amazon Web Services,Inc.or its affiliates.All rights reserved.Mod