Building Agentic Workflows with SageMaker AI and Bedrock AgentCore
Amazon Web Services
Anthropic
Alibaba/Qwen
This post demonstrates how to combine OpenAI-compatible endpoints on Amazon SageMaker AI with Amazon Bedrock AgentCore runtime to build multi-agent systems. It walks through deploying Qwen 3.5 9B on SageMaker AI, integrating it into a Strands Agents multi-agent system alongside models on Amazon Bedrock, and shipping the entire workflow to Amazon Bedrock AgentCore runtime. The focus is on integration mechanics, including token-level observability from SageMaker endpoints, which Strands doesn't provide by default.
A common challenge in building agentic workflows is mixing managed foundation models with your own cost-optimized or domain-specific models without rewriting the agent framework. This post shows how to combine OpenAI-compatible endpoints on Amazon SageMaker AI with Amazon Bedrock AgentCore runtime and its managed deployment. The architecture connects three model-hosting paths through a single Amazon Bedrock AgentCore container: an orchestrator agent (Claude Haiku 4.5 on Bedrock) for intent classification and routing, a budget agent (Claude Sonnet 4.6 on Bedrock) for budget breakdowns, and a financial analysis agent (Qwen 3.5 9B on Amazon SageMaker AI) for stock analysis using tool-calling. The deployment includes auto-refreshing bearer tokens for long-running sessions, using Strands Agents' agents as tools pattern, and deploying via the bedrock-agentcore-starter-toolkit. A key challenge is that Amazon Bedrock AgentCore runtime automatically instruments agents with OpenTelemetry, but SageMaker OpenAI-compatible endpoints don't get automatic token telemetry. The solution involves manually emitting gen_ai.chat spans wrapping the SageMaker agent invocation and extracting token usage from Strands' AgentResult.metrics.accumulated_usage. Additionally, stream_options: {"include_usage": True} must be set because vLLM doesn't include a usage chunk in streaming responses by default. The post also covers step-by-step configuration, example trace output, key learnings, and extending the pattern with fine-tuned models, A/B testing with inference components, and cost-aware routing.
- Abbreviations
- API = Application Programming Interface — программный интерфейс приложения
- AWS = Amazon Web Services — Amazon Web Services
- DLC = Deep Learning Container — контейнер глубокого обучения
- IAM = Identity and Access Management — управление доступом и идентификацией
- OTEL = OpenTelemetry — OpenTelemetry
Source: AWS ML blog —
original
