ML Tools and SageMaker Integration
Explore how to connect Amazon Bedrock and SageMaker in production AI systems. Understand when to use Bedrock foundation models versus SageMaker custom training, how to integrate SageMaker endpoints with Bedrock Agents via Lambda, and how to leverage Feature Store and Pipelines. Discover unified monitoring with CloudWatch for managing AI workflows effectively.
Lambda-backed action groups in Agents for Amazon Bedrock, from the previous lesson, connect agents to external compute. Those integrations are not limited to databases or third-party APIs. They can also call workflows hosted in Amazon SageMaker, AWS’s full-lifecycle machine learning platform. This lesson addresses a common question in production AI architecture: when to use Amazon Bedrock, when to use Amazon SageMaker, and how the two services work together.
Amazon Bedrock and Amazon SageMaker serve complementary roles in the AWS machine learning stack. Amazon Bedrock provides managed access to foundation models for generative AI workloads, including inference, supported customization options such as fine-tuning or continued pre-training, and application development through Agents for Amazon Bedrock and Knowledge Bases for Amazon Bedrock. Amazon SageMaker supports custom ML workflows, including training models from scratch, fine-tuning with deeper control over training infrastructure, and hosting traditional ML workloads such as classification, regression, and ranking, as well as custom model endpoints when you need that control.
The decision boundary follows a clear pattern. Use Bedrock when you are consuming or lightly customizing foundation models. Use SageMaker when you need custom training loops, specialized model architectures, or traditional ML. Sophisticated production systems frequently use both simultaneously, with a Bedrock Agent orchestrating conversation while calling SageMaker-hosted models for structured predictions.
Attention: A common misstep is jumping to fine-tuning when prompt engineering or RAG via Bedrock Knowledge Bases would produce equivalent results. Always evaluate prompting first, then RAG, then Agents, and only then fine-tuning. Skipping this hierarchy results in unnecessary complexity and increased costs.
The following diagram illustrates how these two services connect through a shared architecture:
With this architectural context established, the next sections walk through each integration pattern in detail, starting with the most common one.
SageMaker models as Bedrock Agent tools
A SageMaker real-time endpoint serving a custom model can be exposed as a tool within a Bedrock Agent’s action group. Consider a fraud classification model trained with XGBoost or a product ranking model built with PyTorch, both hosted on SageMaker endpoints. A Lambda function bridges the gap between the agent and the endpoint. ...