AI Practices AI实践 7d ago Updated 7d ago 更新于 7天前 45

Building agentic workflows with SageMaker AI and Bedrock AgentCore 使用 SageMaker AI 和 Bedrock AgentCore 构建智能体工作流

AWS introduces a pattern for mixing managed foundation models (Bedrock) with custom/domain-specific models (SageMaker AI) in multi-agent workflows without rewriting the agent framework Amazon Bedrock AgentCore runtime enables deploying the entire multi-agent system as a single container while routing to different model hosting paths The architecture uses Strands Agents' "agents as tools" pattern with an orchestrator agent (Claude Haiku 4.5) routing to specialized agents using different models To 解决多智能体工作流中混合托管基础模型与自定义/领域模型的技术难题,无需重写智能体框架 通过Amazon Bedrock AgentCore运行时统一编排,实现Claude Haiku 4.5、Claude Sonnet 4.6与自部署Qwen 3.5 9B的协同 采用Strands Agents的"agents as tools"模式,每个专业智能体使用最适合其任务的模型 提供完整的AWS部署代码,包括SageMaker AI端点配置、Bearer Token自动刷新机制和OpenAI兼容API集成 实现成本优化、数据驻留合规和模型灵活性的生产就绪架构,支持跨Region推理

60
Hot 热度
70
Quality 质量
65
Impact 影响力

Analysis 深度分析

TL;DR

  • AWS introduces a pattern for mixing managed foundation models (Bedrock) with custom/domain-specific models (SageMaker AI) in multi-agent workflows without rewriting the agent framework
  • Amazon Bedrock AgentCore runtime enables deploying the entire multi-agent system as a single container while routing to different model hosting paths
  • The architecture uses Strands Agents' "agents as tools" pattern with an orchestrator agent (Claude Haiku 4.5) routing to specialized agents using different models
  • Token-level observability from SageMaker endpoints requires custom implementation since Strands doesn't provide it by default
  • The solution demonstrates cost optimization, data residency control, and model flexibility in a production-ready architecture

Why It Matters

This integration addresses a critical pain point for AI practitioners: the inability to combine managed FMs with custom models in agentic workflows without significant framework modifications. It provides a practical blueprint for organizations seeking cost optimization through domain-specific model deployment while maintaining the capabilities of managed models, all within AWS's ecosystem.

Technical Details

  • Architecture: Three-agent system with an orchestrator (Claude Haiku 4.5 on Bedrock), budget agent (Claude Sonnet 4.6 on Bedrock), and financial analysis agent (Qwen 3.5 9B on SageMaker AI), all running inside a single Bedrock AgentCore container
  • SageMaker Deployment: Qwen 3.5 9B deployed using vLLM DLC (image vllm:0.22.1-gpu-py312-cu130) on ml.g6e.2xlarge instances with 1x L40S GPU (48GB VRAM), supporting 32K context length
  • Authentication: Custom bearer token handling via SageMakerAuth subclass with auto-refreshing tokens using sagemaker.core.token_generator.generate_token for long-running agent sessions
  • Framework: Strands Agents with "agents as tools" pattern, creating fresh agent instances per invocation; OpenAI-compatible API integration for SageMaker endpoints
  • Observability: Token-level observability from SageMaker requires custom OpenTelemetry setup (strands-agents[otel]) since Strands doesn't provide it by default

Industry Insight

  • Organizations can now implement hybrid AI architectures that balance cost (using smaller/custom models for specific tasks) with capability (leveraging managed models for complex reasoning), without vendor lock-in to a single model hosting approach
  • The "agents as tools" pattern with fresh instance creation per invocation provides a scalable template for building specialized multi-agent systems that can be deployed across different cloud regions
  • AWS's integration of Bedrock AgentCore with SageMaker AI endpoints signals a strategic push toward unified multi-model agent orchestration, encouraging enterprises to adopt modular agent architectures rather than monolithic single-model solutions

TL;DR

  • 解决多智能体工作流中混合托管基础模型与自定义/领域模型的技术难题,无需重写智能体框架
  • 通过Amazon Bedrock AgentCore运行时统一编排,实现Claude Haiku 4.5、Claude Sonnet 4.6与自部署Qwen 3.5 9B的协同
  • 采用Strands Agents的"agents as tools"模式,每个专业智能体使用最适合其任务的模型
  • 提供完整的AWS部署代码,包括SageMaker AI端点配置、Bearer Token自动刷新机制和OpenAI兼容API集成
  • 实现成本优化、数据驻留合规和模型灵活性的生产就绪架构,支持跨Region推理

为什么值得看

本文提供了AWS生态下多智能体系统集成的完整技术方案,解决了实际部署中混合模型调用的核心痛点。对AI工程师和架构师而言,可直接复现的代码模式和架构设计具有明确的工程参考价值。

技术解析

  • 架构设计:采用单容器Bedrock AgentCore运行时,通过Orchestrator Agent(Claude Haiku 4.5)进行意图分类和任务路由,Budget Agent(Claude Sonnet 4.6)处理结构化预算分析,Financial Analysis Agent(Qwen 3.5 9B)执行股票分析和投资组合构建
  • 模型部署:Qwen 3.5 9B使用vLLM DLC(镜像vllm:0.22.1-gpu-py312-cu130)部署在ml.g6e.2xlarge实例(1x L40S 48GB VRAM),配置32768上下文长度和张量并行度1
  • 认证机制:实现SageMakerAuth类处理Bearer Token自动刷新,通过sagemaker.core.token_generator.generate_token在每次请求时动态生成认证头
  • 智能体框架:基于Strands Agents的agents as tools模式,每个子智能体作为工具函数封装,使用fresh Agent实例确保状态隔离
  • 可观测性:通过OpenAI兼容API的stream_options.include_usage参数获取token级使用统计,弥补Strands默认缺乏的端点可观测性

行业启示

  • 混合模型部署成为主流:生产环境需要灵活组合托管模型(成本/性能优化)与自部署模型(数据敏感/领域定制),统一编排层是关键基础设施
  • AWS生态整合价值凸显:Bedrock AgentCore与SageMaker AI的深度集成提供了从开发到部署的完整链路,降低多模型协作的复杂度
  • 可观测性设计需前置考虑:在智能体框架选型时,应评估其对底层推理端点的监控能力,必要时通过自定义认证和流式选项补充缺失的可观测性

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Agent Agent LLM 大模型 Deployment 部署