Manage deployment infrastructure for ML and AI models
Four inference options: how does the caller wait?
For example, suppose a checkout cannot complete until a fraud score comes back, while a marketing team wants churn scores for every customer by morning; both need predictions, but their response-time and workload requirements differ, and AWS matches them to different options: Real-Time Inference suits millisecond latency requirements, and Batch Transform suits offline predictions on large batches of data available up front[1]. Matching each requirement to the mechanism that meets it is the AWS MLA-C02 exam guide skill 'Select model inference strategies (for example, real-time and batch processing)'[2] of Task 3.1, Manage deployment infrastructure for ML and AI model types, whose other skills include shared endpoints, models built outside of AWS, foundation models, agents and retrieval-augmented generation. For Task 3.2 (provisioning and configuring resources) and Task 3.3 (orchestration and CI/CD pipelines) of the same domain, see Provision and configure ML and AI workload resources and Automate ML and AI delivery pipelines.
The four options
Amazon SageMaker AI provides four options to deploy a trained model for predictions[1]. The first question is whether each prediction answers an individual request at all:
- Batch transform has no per-request caller. A job starts compute instances, distributes the input files in Amazon S3 among them, and writes one output file per input file back to S3[3]. AWS lists it for running inference when you don't need a persistent endpoint[3], so nothing keeps running between nightly jobs; by contrast, a real-time endpoint kept running between scheduled scoring jobs holds serving instances while the offline workload sends no requests. It can split input files into mini-batches[3], groups of records sent to the model container as one payload[1].
- Real-time inference is a persistent endpoint (an HTTPS address backed by instances you choose) that answers each request synchronously. It suits sustained traffic that needs lower and consistent latency, with payloads up to 25 MB and processing times up to 60 seconds, or 8 minutes for streaming responses[1].
- Serverless Inference also answers synchronously, but SageMaker AI launches compute when requests arrive and scales it in and out with traffic, so you choose no instance type and manage no scaling policy[4]. AWS positions on-demand Serverless Inference for workloads that have idle periods between traffic spurts and can tolerate cold starts[4]. Its payload limit is 4 MB[1].
- Asynchronous Inference queues each request and writes its result to Amazon S3 later. It fits payloads up to 1 GB and processing times up to one hour[5]; the next section follows its request path.
Cold starts: the price of on-demand idle savings
A cold start is the delay when a serverless endpoint that has been idle, or whose concurrent requests exceed its current usage, must spin up compute before it can process requests[4]; its length depends on model size, model download time and container start-up time. Accepting that delay is what buys the saving: with on-demand Serverless Inference you pay for the duration of running the inference code and the amount of data processed, not for idle periods[1]. Provisioned Concurrency keeps a set amount of serverless capacity warm for predictable bursts.
What Serverless Inference does not support
Serverless Inference is not a drop-in replacement for a real-time endpoint. Its feature exclusions[4] are GPUs, AWS Marketplace model packages, private Docker registries, multi-model endpoints, VPC configuration, network isolation, data capture (recording endpoint requests and responses to Amazon S3), multiple production variants (several model versions behind one endpoint, each with its own instances), Amazon SageMaker Model Monitor and inference pipelines. If a scenario needs any one of them, for example a GPU-backed model or captured traffic for monitoring, Serverless Inference is ruled out even when traffic is bursty. Provisioned Concurrency does not lift these exclusions; it only keeps serverless compute initialized. The conversion is also one-way: you cannot update a real-time endpoint to serverless, and a serverless endpoint converted to real-time cannot be rolled back to serverless[4].
The selection follows the caller. An offline dataset available up front suits batch transform; individually queued requests whose results are collected later suit Asynchronous Inference; a caller waiting on the response can use real-time inference, or Serverless Inference when traffic is intermittent, cold starts are acceptable and none of the excluded features is required. Check payload and processing-time limits as well. The comparison table The four SageMaker AI inference options and the decision tree at the end of this page lay out the same choice[1].
Asynchronous Inference: requests and results in Amazon S3
This section follows one asynchronous request from submission to result, because its path through Amazon S3 is what separates Asynchronous Inference from the two synchronous options in the previous section.
You create an asynchronous endpoint the same way as a real-time one, adding an AsyncInferenceConfig object to the endpoint configuration[5]. The request path[5] then runs in five steps:
- The client uploads the request payload to Amazon S3.
- The client calls
InvokeEndpointAsync, passing a pointer to that S3 object rather than the payload itself. - SageMaker AI queues the request and immediately returns an identifier and the output location.
- When an instance processes the request, SageMaker AI writes the result to the S3 output location.
- Optionally, Amazon SNS sends a success or error notification, so the application does not have to poll the output location.
The figure below follows the request from submission to notification. Two endpoint properties matter here. First, an endpoint configuration that contains AsyncInferenceConfig means the endpoint can only receive asynchronous invocations[5], so an application that also needs synchronous answers needs a separate endpoint. Second, the instance count can scale down to zero; requests received while there are zero instances are queued for processing once the endpoint scales up[1].
Serverless Inference can also sit at zero instances, so the two are easy to confuse. A serverless endpoint still returns each prediction in the HTTP response and accepts at most 4 MB per request, while an asynchronous endpoint never returns the prediction in the response and accepts payloads up to 1 GB. Intermittent traffic alone therefore points to Serverless Inference; a requirement to submit large inputs and collect results later points to Asynchronous Inference.
Sharing one endpoint among several models
Hosting each model on its own endpoint can leave a company paying for mostly idle instances when each customer model receives infrequent traffic. SageMaker AI offers four ways for models to share an endpoint's instances, and they differ in how a request reaches a model:
| Topology | How a request reaches a model | Fits when |
|---|---|---|
| Multi-model endpoint (MME) | The request names a model with TargetModel; SageMaker AI loads it into the shared container if needed | Many models on the same ML framework, with a mix of frequent and infrequent traffic |
| Multi-container endpoint with direct invocation | The request names one container with TargetContainerHostname; only that container runs | A set of independent models, possibly on different frameworks, kept in memory |
| Inference pipeline | The request enters the first container; each container's output is the next one's input | Dependent stages such as preprocessing, prediction and postprocessing |
| Inference components | Each model is deployed as its own component with declared CPU, accelerator and memory needs | Several models that must be added, removed or updated independently with explicit resource shares |
Multi-model endpoints
A multi-model endpoint uses the same fleet of resources and a shared serving container to host all of your models[6], which raises endpoint utilization compared with single-model endpoints. Because one container serves every model, it is ideal for a large number of models that use the same ML framework[6], and it works best when the models are fairly similar in size and invocation latency[6].
Multi-container endpoints with direct invocation
A multi-container endpoint deploys multiple containers, which can use different models or frameworks, on a single endpoint[7]. With direct invocation, up to 15 inference containers share the endpoint, and each request specifies the container to invoke with the TargetContainerHostname parameter[8]; only the container with that hostname processes the request[8]. The hosting FAQ describes these containers as running with no cold starts, which suits keeping all the models in memory[1]. Here a cold start is a model-loading delay: on a multi-model endpoint, less frequently used models may incur some cold start latencies since the models are dynamically loaded to an instance[6], which differs from the serverless compute start-up described in the first section. This suits independent models with separate framework-specific containers; different frameworks alone do not rule out an MME, since GPU-backed MMEs can use Triton (NVIDIA Triton Inference Server, which can be used to deploy models from all major ML frameworks[9]) to serve multiple frameworks.
Inference pipelines
An inference pipeline (listed among SageMaker AI's advanced endpoint options as Serial Inference Pipelines[10]) is a SageMaker AI model composed of a linear sequence of two to fifteen containers[11]. SageMaker AI handles each invocation as a sequence of HTTP requests: the first container handles the initial request, its intermediate response becomes the request to the second container, and so on, and SageMaker AI returns the final response to the client[11]. All the containers run on each instance of the endpoint or transform job[11], so one pipeline serves real-time requests or batch transform jobs, and the client never coordinates separate stage calls. The same multi-container endpoint is configured for one mode or the other: its containers run in sequence as an inference pipeline, or each container is accessed individually by direct invocation[7]. A request to an endpoint configured for direct invocation must specify a target container[8], so direct invocation runs one container and never the whole chain. The figure below contrasts the two modes: chained in an inference pipeline, or picked one at a time by direct invocation.
Inference components
An inference component is a SageMaker AI hosting object that deploys a model to an endpoint and specifies how that model uses the endpoint's resources[12]: the CPU cores, accelerators and memory it requires. Because the component decouples the model from the endpoint, you can add or remove models as needed and update each model independently[12]. Production-variant weights do a different job: they set the percentage of traffic routed to each variant[13] and reserve no accelerator memory for any model.
The choice follows how the models relate: one framework and many models suggests an MME, independent models on different frameworks suggest direct invocation, dependent stages suit an inference pipeline, and explicit per-model resources with independent updates call for inference components.
How a multi-model endpoint loads and caches models
This section explains why latency on a multi-model endpoint varies from model to model, and why adding a model needs no endpoint change. Both follow from one design choice: SageMaker AI does not download every model when you create the endpoint; it loads and caches models when you invoke them[6].
Each request names its model in the TargetModel parameter, the model's path relative to the Amazon S3 prefix given when the SageMaker AI model was created[14]. For each request, SageMaker AI does the following[6]:
- Routes the request to an instance behind the endpoint.
- Downloads the model from the S3 bucket to that instance's storage volume.
- Loads the model into the container's memory (CPU or GPU memory, depending on the instance type). If the model is already loaded, the invocation is faster because neither the download nor the load is needed.
The figure below shows the three outcomes: a model already in memory answers at once, a model still on the storage volume needs only a load, and a model on neither needs a download first. When an instance's memory utilization is high and another model must be loaded, SageMaker AI unloads unused models from the container; unloaded models remain on the storage volume and can be loaded again without another download from S3, and models are deleted from the volume only when it reaches capacity[6]. SageMaker AI keeps routing a model's requests to the instance where it is already loaded, and sends some requests to another instance when the model is busy[6].
What the cache means for design
- Latency depends on cache state. The application should tolerate occasional cold start latency when it invokes infrequently used models[6]; here the cold start is the S3 download and memory load shown in the figure above, not the serverless compute start-up described in the first section. Models with significantly higher transactions per second or strict latency requirements belong on dedicated endpoints[6], not in a cache where they compete with infrequent models for memory.
- Adding a model is an upload. To add a model, you upload it to the S3 bucket and invoke it; adding models to, or deleting them from, a multi-model endpoint does not require updating the endpoint[6]. Creating a production variant for each new tenant model would use variant-based deployment, a different mechanism, instead of this dynamic loading.
- Files in S3 warm nothing. A model enters memory only when a request invokes it, so uploading more model files to the bucket does not reduce anyone's latency.
A multi-model endpoint trades predictable latency for density; a model that cannot accept an occasional load delay belongs on its own endpoint.
Hosting a model trained outside AWS
A model trained on a laptop, in another cloud or on an on-premises cluster is still a set of artifacts plus code that knows how to serve them, so moving it to AWS is a question of which runtime accepts that package. The AWS MLA-C02 exam guide names the skill 'Deploy models that were built outside of AWS into AWS environments (for example, Amazon SageMaker AI, Amazon Bedrock Custom Model Import)'[2], and the deployment target follows from what you hold:
| What you hold | Deployment target |
|---|---|
| Framework model artifacts, for example a PyTorch or TensorFlow model | A SageMaker AI model that uses an AWS-provided framework container |
| Customized weights of a supported foundation model architecture, to be served by Amazon Bedrock | Amazon Bedrock Custom Model Import |
| ML services already packaged as container images on Kubernetes | Amazon Elastic Kubernetes Service (Amazon EKS), with the images in Amazon Elastic Container Registry (Amazon ECR) |
SageMaker AI hosting for an externally trained model
SageMaker AI can take a framework model that you trained outside of SageMaker AI and deploy it on any of its hosting options[1]; a SageMaker AI training job is not a prerequisite, so retraining a compatible model just to obtain a training-job record adds nothing. You package the artifacts as a model.tar.gz file in the directory structure that the framework container expects[1]. Before deploying, note the AWS Region of the S3 bucket, the S3 URI of the model artifacts, the IAM role for SageMaker AI, and the framework and version of an AWS-provided image[12]. That IAM role is the execution role: the identity SageMaker AI uses to read the artifacts and pull the image.
One regional rule trips many migrations: the Amazon S3 bucket where the model artifacts are stored must be in the same AWS Region as the model that you are creating[12]. Copying the artifacts to a bucket in the deployment Region fixes it. Granting broader S3 permissions does not, because the rule concerns where the bucket is, not who may read it.
Amazon Bedrock Custom Model Import
Custom Model Import creates a custom model in Amazon Bedrock from a foundation model that you customized in another environment, such as SageMaker AI[15], and serves it with on-demand throughput through the InvokeModel or InvokeModelWithResponseStream operation[15]. It imports weights; it is not a container host:
- The model must use one of the supported architectures[15], which include Mistral, Mixtral, Flan, several Llama versions, GPTBigCode, Qwen families and GPT-OSS. Custom Model Import does not support embedding models[15].
- From Amazon S3, you supply the model files in the Hugging Face weights format[16], the file layout the Hugging Face transformers library produces. At minimum that means the weights in
.safetensorsfiles,config.json,tokenizer_config.json,tokenizer.jsonandtokenizer.model[15]. - The import job runs as a service role that must be able to read those files, and a cross-account S3 bucket or AWS Key Management Service (AWS KMS) key needs access granted to the import[16]. A correct file format does not substitute for permission to read or decrypt the source, and a role that can only invoke models cannot read it either.
- An imported model cannot be used with Bedrock batch inference or AWS CloudFormation[15].
Uploading an inference Docker image does not work here, because the import expects model files of a supported architecture, not a serving container.
Amazon EKS for existing containerized services
When an existing Kubernetes deployment already packages each ML service as a standalone container image, the move to AWS is a lift-and-shift (moving the workload without redesigning it): push the images to Amazon ECR and deploy them to the Amazon EKS cluster. Pods must reference the full registry/repository:tag image name[17], and the nodes need pull permissions: on managed or self-managed nodes the worker node IAM role needs Amazon ECR permissions, and on AWS Fargate the Fargate pod execution role provides them[17]. Moving an image does not change the trained model inside it, so neither retraining nor a rewrite into another ML orchestration framework is part of the move.
Match the artifact you hold to the runtime that accepts it: framework artifacts to a SageMaker AI model whose artifact bucket is in the same Region[12], supported foundation model weights to Custom Model Import[15], and existing container images to Amazon EKS, pulled from Amazon ECR[17].
Running foundation models on Amazon Bedrock
For Amazon Bedrock's serverless model inference, you do not choose an instance; the decisions are how capacity is allocated and where a request may be processed. Bedrock serves a foundation model (FM, a large pre-trained model used through an API) through several capacity and routing options, among them those in the table below, and a custom model has its own path to on-demand serving.
| Option | What you get | Fits when |
|---|---|---|
| On-demand inference | Usage-based access with no capacity to set up | Variable or moderate traffic |
| Provisioned Throughput | Dedicated capacity in model units at an hourly price | Consistent, high throughput for a supported model |
| Batch inference | An asynchronous job that reads prompt files from Amazon S3 and writes output files to S3 | Large sets of independent prompts that need no immediate answer |
| Cross-Region inference profile | Bedrock picks a Region from the profile's set for each request | Higher throughput across Regions, where data location rules allow |
Provisioned Throughput
Provisioned Throughput lets you provision a higher level of throughput for a model at a fixed cost, billed hourly[18]. Capacity is bought in model units (MUs), and each MU delivers a specific number of input and output tokens per minute for the model[18]. You choose no commitment, 1 month or 6 months; the longer the commitment, the more discounted the hourly price, and billing continues until you delete the Provisioned Throughput[18]. Support differs by model and Region, so confirm the model is on the Provisioned Throughput supported list for your Region before planning on it. On-demand inference is the alternative whenever usage-based access without a capacity commitment meets the requirement.
Custom models: Provisioned Throughput or a custom model deployment
The Provisioned Throughput page states that if you customized a model, you must purchase Provisioned Throughput to use it[18]. Models brought in with Custom Model Import (previous section) follow their own path: you can use a model that you import with on demand throughput[15]. For a model created with a model customization job[19], the Provisioned Throughput rule has one documented alternative: a custom model deployment sets up on-demand inference for a custom model, so you pay only for what you use[19]. It requires a model customized on or after July 16, 2025 from a supported base model (Amazon Nova Lite, Nova 2 Lite, Nova Micro or Nova Pro in US East (N. Virginia), or Meta Llama 3.3 70B Instruct in US West (Oregon))[19]. You invoke it by passing the deployment's Amazon Resource Name (ARN) as the modelId[19].
The deployment and the model are separate resources. Deleting a custom model deployment ends its on-demand inference but does not delete the underlying custom model; to use the model on demand again, you create a new deployment[19]. Deleting the custom model itself to stop one deployment removes the retained model, not just its serving resource.
Batch inference
Batch inference lets you submit multiple prompts and generate responses asynchronously: you upload input files to Amazon S3, submit a job that names the bucket, and retrieve the output files from S3[20]. Each input record is processed independently without multi-turn interaction, so tool calling is not supported[20]: an agent conversation that needs back-and-forth tool exchanges cannot run as a batch job. Batch inference isn't supported for provisioned models[20], and it never reserves capacity for synchronous application requests.
Cross-Region inference profiles
An inference profile defines a foundation model and the AWS Regions to which requests can be routed[21]. The system-defined cross-Region profiles come in two scopes: with a geographic profile Bedrock selects a commercial Region within that geography (such as US or EU), and with a global profile it selects any supported commercial Region[21]. The application specifies the inference profile's ARN when calling InvokeModel, InvokeModelWithResponseStream, Converse or ConverseStream[22] instead of managing separate regional calls, and there is no additional routing cost; the price is calculated from the Region in which you call the profile[21]. Choose the geographic scope when data must stay within a geography. A single-Region model ID never produces cross-Region routing, and inference profiles currently don't support Provisioned Throughput[21], so the two are separate ways to raise throughput, not a combination.
On Bedrock, the options covered here are pay per use, reserve units, batch the work, or widen the Regions; custom models add the deployment-versus-model distinction.
Foundation models on SageMaker AI hosting
Some requirements need the opposite of Bedrock's serverless approach: control over the instances that serve a foundation model. AWS's decision guide states the split: Amazon Bedrock is serverless, meaning you do not have to manage infrastructure[23], while SageMaker AI is the choice when you need to access the container or orchestration layer to directly manage cost-latency-throughput tradeoffs[23]. Two paths put an FM on SageMaker AI hosting.
Amazon SageMaker JumpStart
SageMaker JumpStart is a model hub that offers built-in publicly available and proprietary foundation models[23]. Deploying a JumpStart foundation model follows the SageMaker Studio model deployment steps to a SageMaker AI endpoint[24], where you select the hosting compute and deployment settings yourself; JumpStart optimized deployments also offer preset configurations for a target use case with a cost, throughput, latency or balanced optimization[24]. Some models require you to accept an end-user license agreement before deployment[24].
Amazon Bedrock Marketplace
Bedrock Marketplace offers over 100 popular, emerging and specialized FMs in addition to Bedrock's own selection[25], and it mixes the two platforms. After you subscribe to a catalog model, you deploy it to a SageMaker AI endpoint, providing the endpoint name, the number of instances and the instance type; the model is hosted by SageMaker AI[26]. You then call it through Bedrock: the Converse or InvokeModel operation, with the endpoint ARN as the model ID[27], with Converse available only for compatible models[27]. Because the model is reached through Bedrock's APIs, it works with Bedrock tools such as Agents, Knowledge Bases and Guardrails[25]. So a Marketplace model is not ordinary serverless Bedrock access: you pick and pay for its instances.
Marketplace and Custom Model Import are easy to mix up because both end with a non-native model reachable from Bedrock. A Marketplace subscription deploys a catalog model to SageMaker AI hosting; Custom Model Import brings in weights that you customized elsewhere. Neither activates the other.
When the requirement is to invoke an FM through an API without selecting serving infrastructure, choose Amazon Bedrock; when it names instance types or deployment settings, choose a SageMaker AI endpoint through JumpStart; when the model is offered only through Bedrock Marketplace, subscribe and deploy it to its SageMaker AI endpoint.
Converse: one message format across models
A team that moves its chatbot from one FM to another finds that each model's native request body, the format that InvokeModel takes, is different; the parameters for that body are listed per model in the inference parameters documentation[28]. The Converse API exists to remove that rework.
Converse, and ConverseStream for streaming responses, provide a consistent API that works with all Amazon Bedrock models that support messages, so you can write code once and use it with different models[29]. A request carries messages (the role and content of each turn), an optional system prompt, and inferenceConfig for the inference parameters common to all models[29]; parameters unique to one model go in additionalModelRequestFields[29]. The shared interface standardizes the request shape, not the models: a capability that one model lacks does not appear because the interface is shared. The same request can also carry toolConfig for tool use, described in the next section, and guardrailConfig to apply a guardrail.
Streaming and model independence are separate properties. InvokeModelWithResponseStream streams output too, but its request body still follows the selected model's own inference format; when an application needs both streaming and one message format across models, ConverseStream is the operation. Permissions follow the base operations: calling Converse requires permission for bedrock:InvokeModel, and ConverseStream requires bedrock:InvokeModelWithResponseStream[29].
Use Converse for portable conversation code, ConverseStream when that code must stream, and keep model-specific options in additionalModelRequestFields.
Client-side tool use: your code runs the tool
A model sometimes needs information it does not have, such as today's most-played song on a radio station; tool use settles who fetches it. In Amazon Bedrock, the model doesn't directly call the tool[30]: you supply definitions of the tools with the request, the model decides when one is needed, and something else runs it. Bedrock documents three modes of tool use[30], which differ in who runs the tool:
| Mode | Who runs the tool |
|---|---|
| Client-side tool use | Your application code, after the model returns a tool request; available with the Converse, InvokeModel, Responses and Chat Completions APIs |
| Server-side tool use | Amazon Bedrock, which invokes a registered Lambda function or AgentCore Gateway on the model's behalf; currently available on the Responses API |
| Anthropic Claude tool use | Your application code, using Anthropic-defined tool types and the Anthropic Messages request format |
Bedrock also provides the OpenAI Responses API[31] and the OpenAI Chat Completions API[32]. AgentCore Gateway, which exposes existing backends as tools, is described under AgentCore Gateway: existing backends as tools.
With Converse, client-side tool use is a loop of five steps, which the figure below traces as an exchange between your application and the model:
- The application sends the messages plus tool definitions (name, description, input schema) in
toolConfig. - The model stops with the stop reason
tool_useand returns atoolUseblock naming the tool, its inputs and atoolUseId. - The application runs the tool itself.
- The application sends a
toolResultblock that echoes the sametoolUseId, so the model can match the result to the request[28]. - The model continues and generates its answer using the result.
The Converse example in the Bedrock documentation[28] follows exactly this pattern: it checks stopReason for tool_use, calls the tool, and appends a user message whose content is the toolResult. Execution ownership is the point: in client-side mode your code runs the tool, and in a successful tool-use loop you send its result back so the model can continue its answer. The optional toolChoice field defaults to auto, in which the model decides whether to request a tool; any and tool force a tool request and are supported only by some models[28].
This loop is a property of a direct model call. Configuring an agent's action groups, covered in the next section, is a different layer, in which the agent orchestrates the steps.
Configuring an Amazon Bedrock Agents Classic agent
Amazon Bedrock Agents Classic is the current name of Amazon Bedrock Agents (launched November 2023); it is no longer open to new customers from July 30, 2026, and AWS recommends migrating its workloads to Amazon Bedrock AgentCore[33]. Existing agents keep running, so their configuration still matters. This section covers the three capabilities you configure on an Agents Classic agent: action groups, knowledge base associations and code interpretation. One rule applies to every change: prepare the agent after changing its configuration, before you test it[34]. Preparing, with Prepare in the console or the PrepareAgent operation, packages the agent with your latest changes to its working draft[35].
Action groups: the definition is separate from the execution
An action group tells the agent which actions exist and how each one is carried out. You define the actions with an OpenAPI schema (a standard machine-readable API description) that describes each action as an API operation, or with function details that list the parameters the agent must elicit from the user[36]. When the agent decides to invoke an action, it elicits the parameters it needs[36] and hands them to the fulfillment option you configured, chiefly one of two:
- Lambda function: the agent passes the action and parameters to a Lambda function that you create to hold the business logic[37].
- Return control: the agent skips Lambda and returns the information and parameters in the
InvokeAgentresponse; your systems produce the result, which can go back in the session state of anotherInvokeAgentrequest[37].
The schema describes the operation; the fulfillment option supplies its implementation. Return control and client-side tool use (previous section) both leave execution to your application, but at different layers: return control is a setting of an agent's action group, while client-side tool use belongs to a direct model call with toolConfig. An AgentCore Gateway tool definition is not an action group configuration either; Gateway exposes backends as MCP (Model Context Protocol) tools, as described under AgentCore Gateway: existing backends as tools.
Knowledge base association
Creating and syncing a knowledge base connects it to no agent. You associate the knowledge base with the agent, during or after agent creation, and provide instructions that tell the agent when and how to query it[34]; the agent includes these instructions in its prompt context to decide whether to retrieve information from the knowledge base for a given user request[34]. An action group schema cannot stand in for this association: it describes operations and their inputs, not a knowledge base.
Code interpretation
Code interpretation enables the agent to generate, run and troubleshoot code in a secure test environment[38], so it can analyze and visualize data and extract information from files the user uploads[38] and answer from the results of actual execution rather than from code text alone. You enable Code Interpreter in the agent builder, then save and prepare the agent to apply the change before testing[39]. Return control is not a managed code executor: it sends the selected action and inputs back to your application to fulfill.
On an Agents Classic agent, the schema says what an action is, the fulfillment option says who runs it, a knowledge base needs an association plus instructions, and code interpretation is the managed way to execute generated code; prepare after each change.
Hosting agent code on AgentCore Runtime
A team has a working agent written with LangGraph that calls a model from another provider, and wants managed hosting without rewriting it. Amazon Bedrock AgentCore Runtime is built for this case: it is framework agnostic, working with frameworks such as LangGraph, Strands and CrewAI and with custom agents that use no specific framework[40], and it works with any large language model, such as models offered by Amazon Bedrock, Anthropic Claude, Google Gemini and OpenAI[40]. Rewriting a working agent into another framework is not a prerequisite for using it.
The service contract
What Runtime does require is its service contract: the standardized communication protocol that your agent application must implement to integrate with the hosting infrastructure[41]. You select a protocol for the runtime, and the container must serve that protocol's endpoints and message format. The protocol comparison[41] lists four:
| Protocol | Port | Mount path | Message format | Discovery | Use case |
|---|---|---|---|---|---|
| HTTP | 8080 | /invocations, /ws | REST JSON or SSE, WebSocket | None | Direct API calls, real-time streaming |
| MCP | 8000 | /mcp | JSON-RPC | Tool listing | Tool servers |
| A2A | 9000 | / (root) | JSON-RPC 2.0 | Agent Cards | Agent-to-agent communication |
| AG-UI | 8080 | /invocations, /ws | Event streams (SSE or WebSocket) | None | Interactive UI experiences |
Server-sent events (SSE) deliver real-time streaming responses[42], while the WebSocket endpoint supports real-time bidirectional streaming[42]; the MCP contract uses a JSON-RPC based request/response format[43]. A container that merely starts is not enough. An application that exposes only an MCP server, deployed under the HTTP protocol, does not serve the /invocations interface the runtime then expects; configure the runtime protocol and the application's server consistently.
MCP or A2A
The two protocols that connect an agent to other software serve different roles, and Runtime lets agents communicate with tools and other agents through either[40]:
- MCP (Model Context Protocol) is how a service exposes tools to agent clients. Its discovery mechanism is a tool listing.
- A2A (Agent-to-Agent protocol) is for multi-agent communication and discovery[41], with Agent Cards as its discovery mechanism.
A tool server and a collaborating agent are different integration roles: when another agent must discover and work with yours, A2A is the contract, and an MCP tool listing does not substitute for it.
AgentCore Runtime accepts the agent you already have, whatever its framework and model, provided the container implements the selected protocol's contract.
Inbound and outbound authentication for an agent
An agent sits between two parties: the callers that invoke it and the tools that it invokes. Each side has its own authentication path, and the figure below shows both, with AgentCore Gateway, which converts APIs, Lambda functions and existing services into MCP-compatible tools[44], on the tool side.
Inbound authentication: who may invoke the agent
AgentCore Runtime authenticates callers with IAM SigV4 (AWS Signature Version 4) by default, or with JWT (JSON Web Token) bearer tokens checked against an authorizer configuration: a discovery URL plus the allowed audiences, clients or scopes[45]. That lets end users authenticate through a corporate identity provider such as Okta, Microsoft Entra ID or Amazon Cognito into only the agents they may use[40]. A runtime supports either SigV4 or JWT inbound authentication, not both at the same time[45].
Outbound authentication: what the agent may call
Outbound authentication lets the agent access third-party services such as Slack, Zoom and GitHub, either on behalf of users or autonomously, using OAuth or API keys[40]. For delegated user access, the agent retrieves OAuth tokens on behalf of end users through the authorization code grant[45]. Successful inbound authentication alone does not automatically authorize a downstream request; the agent still needs an appropriate credential for each tool that requires authentication[46].
Inbound authentication answers who may call the agent; outbound authentication answers what the agent may call.
AgentCore Gateway: existing backends as tools
AgentCore Gateway converts APIs, Lambda functions and existing services into MCP-compatible tools[44] and supports OpenAPI, Smithy and Lambda as tool input types[44]. Its translation capability converts agent requests that use MCP into API requests and Lambda invocations[44], so the backend keeps its business logic and the gateway only adapts access to it. Gateway also manages both inbound authentication (verifying agent identity) and outbound authentication (connecting to tools), including OAuth flows, token refresh and credential storage[44]. Direction is named from each component's side: Gateway's inbound authentication checks the agent that calls it, which is that agent's outbound call in the Runtime terms of the previous section. Importing the API's documentation into a knowledge base is no substitute: it makes the descriptions retrievable but never executes the action.
Gateway turns existing backends into tools: with IAM or JWT inbound authentication configured, the agent authenticates to Gateway with its outbound credential, which Gateway's inbound authentication validates[47], and Gateway then authenticates outbound to each backend (a Gateway target) that requires it[46].
Configuring a knowledge base query
When an application asks an Amazon Bedrock knowledge base a question, it makes two choices: which operation to call, and how retrieval behaves for that query. These query-time choices fall under the AWS MLA-C02 exam guide skill 'Apply Retrieval Augmented Generation (RAG) system configurations (for example, retrieval strategies, reranking)'[2]; RAG means adding retrieved passages to a model's prompt at request time.
Retrieve or RetrieveAndGenerate
Retrievequeries the knowledge base and returns source chunks that are relevant to the query[48]. Your application decides what to do with them, for example passing them to a model with its own prompt.RetrieveAndGenerateretrieves chunks and generates a response, returned with citations to the original source data[49].
The choice decides whether the managed call owns only retrieval or the whole retrieve-and-generate path. Calling Retrieve and expecting a synthesized answer with citations asks the retrieval-only operation for a generation step it does not perform.
Both operations accept a retrievalConfiguration whose vectorSearchConfiguration holds the retrieval settings below[50]. Those settings apply to a custom knowledge base, one where you configure and manage some of the underlying infrastructure[51]. A fully managed knowledge base, where Amazon Bedrock manages the ingestion, storage, indexing, and retrieval infrastructure, including embedding and reranking with service-managed models by default[51], uses managedSearchConfiguration instead, always uses hybrid search, and uses a service-managed reranker by default only with managed embedding[48], meaning the service-managed embedding model rather than your own Bedrock embedding model chosen at creation time[51].
Listing: a retrievalConfiguration fragment for a Retrieve request to a custom knowledge base
"retrievalConfiguration": {
"vectorSearchConfiguration": {
"numberOfResults": 10,
"overrideSearchType": "HYBRID",
"filter": { "equals": { "key": "department", "value": "finance" } },
"rerankingConfiguration": { ... }
}
}
The ... marks the omitted reranker settings (the reranker model's ARN among them). The keys are the fields of the vector search configuration[52], each explained in the next subsection: numberOfResults caps the results, overrideSearchType sets the search type, filter restricts which documents may match, and rerankingConfiguration adds a reranker.
The settings, stage by stage
- Query decomposition. In
RetrieveAndGenerate, query decomposition breaks a complex query into smaller subqueries, which may run multiple queries against the knowledge base[50] before the final answer. It suits a question that combines several information needs. Raising the result limit is no substitute, because more results for a compound query still come from searching with the original query. - Search type (
overrideSearchType). Hybrid search combines searching vector embeddings (semantic search) with searching the raw text; semantic search only searches vector embeddings; if you set nothing, Bedrock decides[50]. Hybrid search is only supported for Amazon RDS, Amazon OpenSearch Serverless and MongoDB vector stores that contain a filterable text field; otherwise the query uses semantic search[50]. Verify the existing store before relying on raw-text matching. - Explicit metadata filters (
filter). A filter restricts which documents may satisfy the query, for example one department, a date range or a category. The metadata must exist and be supported: for an S3 data source the bucket needs at least onefileName.extension.metadata.jsonfile for its documents, and an OpenSearch Serverless index must use thefaissengine[50]. Telling the generation prompt to use only one department's documents does not constrain what retrieval returns. - Implicit filtering. Bedrock can generate and apply a retrieval filter from the user query and a metadata schema[50]. In
implicitFilterConfigurationyou supplymetadataAttributes, schemas giving each attribute's key, type and description, plus the ARN of the model that maps user intent to those fields; implicit filtering is supported by Anthropic Claude models[50]. Explicit filters remain the choice when the application already knows the filter values. - Number of results (
numberOfResults). A query returns up to five results by default, andnumberOfResultssets the maximum[50]. With hierarchical chunking (documents split into large parent chunks that contain smaller child chunks), the limit counts the child chunks retrieved, and child chunks that share a parent are returned as that parent chunk, so fewer results than requested can come back[50]. That is retrieval assembling its response, not an ingestion failure. - Reranking (
rerankingConfiguration). A reranker model calculates the relevance of chunks to a query and reorders the results[53], and its ranking overrides the default ranking of the knowledge base[53]. It works only on text[53] and only reorders candidates that search returned, so it cannot recover a keyword match the search missed; lowering generation temperature changes response sampling, not ranking. - Guardrail. For
RetrieveAndGenerate, setguardrailConfigurationwith aguardrailIdandguardrailVersioninsidegenerationConfiguration[50]. Guardrails apply to the input and the generated response, not to the references retrieved from the knowledge base[49]. Safety wording in the prompt does not enable the managed guardrail controls; confirm the chosen model supports the guardrail features you need.
The figure below orders these settings along the query path; query decomposition, like generation and its guardrail, applies only to RetrieveAndGenerate[50].
Each setting owns one stage: decomposition shapes the query, search type and filters decide what can match, the result limit caps how much comes back, reranking orders it, and the guardrail checks the generated answer.
Requirements matched to deployment features
The AWS MLA-C02 exam guide lists 'Task 3.1: Manage deployment infrastructure for ML and AI model types.'[2], with skills that include 'Select deployment orchestrators and multi-model or multi-container deployment strategies' and 'Evaluate and select appropriate foundation model (FM) deployment options'; the patterns below fall under that task, each with its section named in italics; for each requirement, the feature to choose is the one whose mechanism meets it. Task 3.1 also lists the skills 'Select model inference strategies (for example, real-time and batch processing)', 'Deploy models that were built outside of AWS into AWS environments (for example, Amazon SageMaker AI, Amazon Bedrock Custom Model Import)', 'Deploy and configure agents for specific tasks, integration with other services and tools, and agent communication protocols' and 'Apply Retrieval Augmented Generation (RAG) system configurations (for example, retrieval strategies, reranking)' (AWS MLA-C02 exam guide, domain 3[2]).
Inference options and shared endpoints
- Requirement: interactive request; proposed: batch transform. Batch transform returns output files in Amazon S3 when its job finishes, so it cannot answer a transaction synchronously; use real-time inference (Four inference options).
- Requirement: intermittent traffic with large payloads; proposed: Serverless Inference. Serverless Inference does not provide the S3 request-and-result workflow and caps payloads at 4 MB; large inputs that can wait need Asynchronous Inference (Asynchronous Inference).
- Requirement: bursty traffic plus a GPU or VPC configuration; proposed: Serverless Inference. Serverless Inference excludes GPUs and VPC configuration, and Provisioned Concurrency only warms serverless capacity; use real-time inference (Four inference options).
- Requirement: independent tenant models; proposed: inference pipeline. An inference pipeline chains stages for every request; per-tenant models on one framework can use a multi-model endpoint (Sharing one endpoint).
- Requirement: preprocessing chain; proposed: direct invocation. Direct invocation runs only the container a request names; a chain needs an inference pipeline (Sharing one endpoint).
- Requirement: independent models in separate framework-specific containers; proposed: multi-model endpoint. A multi-model endpoint serves every model from one shared serving container[6], so models that each need their own framework container fit a multi-container endpoint with direct invocation; a GPU-backed MME on Triton[54] is the multi-framework exception (Sharing one endpoint).
- Requirement: GPU memory per model; proposed: traffic weights. Production-variant weights route traffic; inference components declare each model's accelerator and memory needs (Sharing one endpoint).
- Requirement: new tenant model; proposed: new production variant. A multi-model endpoint loads a compatible model uploaded under its S3 prefix on first invocation, with no endpoint update (How a multi-model endpoint loads).
External models and foundation models
- Requirement: deploy artifacts from a cross-Region bucket; proposed: broader S3 permissions. The artifacts must sit in the deployment Region; permissions do not change location (Hosting a model trained outside AWS).
- Requirement: Custom Model Import; proposed: a Docker image as its input. The import takes Hugging Face format weights of a supported architecture, not containers (Hosting a model trained outside AWS).
- Requirement: a role for the import job; proposed: invoke permissions only. Invocation permission does not let the job read or decrypt the source files (Hosting a model trained outside AWS).
- Requirement: reserved capacity for synchronous traffic; proposed: Bedrock batch inference. Batch inference creates asynchronous S3 jobs; dedicated online capacity is Provisioned Throughput (Running foundation models on Amazon Bedrock).
- Requirement: multi-Region routing; proposed: a plain model ID. Only a cross-Region inference profile routes across Regions (Running foundation models on Amazon Bedrock).
- Requirement: deploy a Marketplace model; proposed: Custom Model Import. A catalog subscription deploys to a SageMaker AI endpoint; import is for weights customized elsewhere (Foundation models on SageMaker AI hosting).
- Requirement: portable streaming chat code; proposed: InvokeModelWithResponseStream. It streams, but its body follows each model's own format; use ConverseStream (Converse).
Agents and retrieval
- Requirement: run an existing agent on AgentCore Runtime; proposed: rewrite the agent. Runtime is framework agnostic; implement the protocol contract instead (Hosting agent code on AgentCore Runtime).
- Requirement: deploy an MCP-only server; proposed: the HTTP protocol. The runtime protocol and the server must match (Hosting agent code on AgentCore Runtime).
- Requirement: agent discovery; proposed: an MCP tool listing. Agent discovery and communication is A2A, with Agent Cards (Hosting agent code on AgentCore Runtime).
- Requirement: tool authorization; proposed: the inbound session. The agent needs outbound credentials for tools that require authentication (Inbound and outbound authentication).
- Requirement: an API as an agent tool; proposed: its documentation in a knowledge base. Retrieval returns text; AgentCore Gateway executes the backend as an MCP tool (AgentCore Gateway).
- Requirement: an agent that consults a knowledge base; proposed: creating the knowledge base alone. It needs an association plus instructions, then a prepared agent (Configuring an Agents Classic agent).
- Requirement: a code executor; proposed: return control. Return control hands execution to your application; code interpretation runs generated code in a secure environment (Configuring an Agents Classic agent).
- Requirement: recover missing keyword matches; proposed: a reranker. A reranker reorders only what search returned; enable hybrid search on a supported store (Configuring a knowledge base query).
- Requirement: department restriction; proposed: writing it into the prompt. A metadata filter restricts which documents may satisfy the query (Configuring a knowledge base query).
- Requirement: compound question; proposed: higher result limit. More results still come from the original query; enable query decomposition (Configuring a knowledge base query).
- Requirement: explain fewer results than numberOfResults with hierarchical chunking; proposed: an ingestion failure. Child chunks that share a parent come back as that parent; fewer results alone do not indicate an ingestion failure (Configuring a knowledge base query).
Every Task 3.1 skill[2] begins with 'Select', 'Evaluate and select', 'Deploy', 'Configure' or 'Apply', and across all three groups the feature to choose is the one whose mechanism meets the stated requirement.
The four SageMaker AI inference options
| Decision factor | Real-time inference | Serverless Inference | Asynchronous Inference | Batch transform |
|---|---|---|---|---|
| How the caller gets the result | Synchronous response to each request | Synchronous response to each request | Result written to Amazon S3; optional SNS notification | Output files in Amazon S3 when the job finishes |
| Documented size and time limits | Payload up to 25 MB; up to 60 s processing (8 min streaming) | Payload up to 4 MB; memory 1 GB to 6 GB | Payload up to 1 GB; up to 60 minutes processing | Mini-batch payload up to 100 MB |
| Capacity between requests | Instances stay provisioned unless scale-to-zero is configured | Can scale to zero; the next request can hit a cold start | Can autoscale to zero; requests queue until it scales up | Instances start with the job; no persistent endpoint |
| Hosting features (selection) | GPUs, VPC configuration, Model Monitor, data capture, multiple production variants, inference pipelines, among others | None of the features listed for real-time inference | Endpoint accepts only asynchronous invocations | Can run an inference pipeline model |
| Best fit | Sustained traffic needing low, consistent latency | Intermittent or unpredictable traffic that tolerates cold starts | Large payloads or long processing that can be queued | Large datasets available up front |
Decision tree
Sharp facts the exam loves — give these one last read before exam day.
Cheat sheet
Sharp facts the exam loves — scan these before test day.
- Real-time inference fits interactive requests that require immediate predictions
When an application needs synchronous predictions with low latency and sustained throughput, use Amazon SageMaker AI real-time inference. Keep sufficient serving capacity available for the response-time requirement; Asynchronous Inference is appropriate when the caller can collect its result later.
Trap Using batch transform for an interactive transaction, which returns results through an offline job rather than the transaction's synchronous response.
3 questions test this
- A payments company scores every card authorization with an XGBoost fraud model before the checkout API responds to the merchant. Traffic is steady at about 900 requests per second throughout the day,
- A logistics company serves a route-delay model from a SageMaker AI real-time endpoint that runs on two instances with no scaling policy. Delivery tablets wait for each prediction before they show the
- An insurance company's claims portal sends a 6 MB scanned form to a document classification model and must show the predicted claim category on the same page before the user continues. Inference takes
- Batch transform scores stored datasets without a persistent endpoint
When predictions are needed for a stored dataset rather than individual online requests, use Amazon SageMaker AI batch transform. The job provisions compute for the workload and writes results to Amazon S3, avoiding the need to maintain a continuously running inference endpoint.
Trap Keeping a real-time endpoint running between scheduled scoring jobs, which reserves serving infrastructure even when the offline workload has no requests.
3 questions test this
- A retailer stores the full customer table of 40 million rows in Amazon S3. Each night, an ML engineer must generate a propensity score for every row and write the scores back to Amazon S3 for the mark
- An insurer must score a five-year archive of 30 million claims with a trained SageMaker AI fraud model as a one-time backfill. The full archive is already stored in Amazon S3, and results must be writ
- A bank serves live loan decisions from a SageMaker AI real-time endpoint. Each month, the risk team also needs predictions for the full 40-million-row customer table exported to Amazon S3. The bulk sc
- Asynchronous inference queues large or long-running inference requests
When an application can wait for a result and submits large or long-running requests, use Amazon SageMaker AI Asynchronous Inference. Requests identify input in Amazon S3, and outputs are written to S3 rather than returned as synchronous predictions. Optional Amazon SNS notifications tell the application when processing succeeds or fails.
Trap Using Serverless Inference merely because traffic is intermittent, which does not supply the asynchronous S3 request-and-result workflow.
3 questions test this
- An ML engineer has deployed a video-analysis model to a SageMaker AI asynchronous endpoint. A web application must submit each uploaded video for analysis without holding an HTTP connection open while
- A developer integrated an application with a SageMaker AI asynchronous endpoint that analyzes long audio recordings. The InvokeEndpointAsync call returns quickly, but its response does not contain the
- A medical imaging company runs a segmentation model on 3D scans. Each scan is about 600 MB, and inference takes 15 to 25 minutes. Radiology systems upload scans throughout the day and can wait for res
- On-demand Serverless Inference trades cold starts for lower idle cost
When inference traffic is intermittent and the application tolerates cold starts, use on-demand Amazon SageMaker AI Serverless Inference. SageMaker AI launches and scales compute with traffic and scales it to zero when idle, without requiring instance selection or instance-scaling policies.
Trap Choosing a continuously provisioned real-time endpoint for an idle-cost requirement despite accepting cold starts, which retains provisioned capacity between traffic bursts.
3 questions test this
- An ML engineer reviews four CPU-based models that each run on a dedicated real-time endpoint with one instance. The company wants to move models to on-demand Serverless Inference only where idle-time
- A payroll company hosts a small CPU-based intent classifier for its employee help chatbot. Traffic is heavy for 3 days at month end and sporadic for the rest of the month, with idle periods of many ho
- A data science team keeps a model on a SageMaker AI real-time endpoint for an internal labeling tool. The tool is used a few times each day, with idle hours in between, and users accept a few seconds
- Serverless Inference is unsuitable when required hosting features are excluded
Amazon SageMaker AI Serverless Inference does not support, among other features, GPUs, VPC configuration, Model Monitor, data capture, multiple production variants, or inference pipelines. When any of these is a deployment requirement, choose a compatible hosting mode such as real-time inference rather than treating all endpoint modes as interchangeable.
Trap Adding provisioned concurrency to a serverless endpoint to obtain GPU support, which warms serverless capacity without changing the endpoint's feature support.
3 questions test this
- A lender already uses SageMaker Model Monitor, and its compliance policy requires every production credit model to log its request and response payloads to Amazon S3 and to run scheduled SageMaker Mod
- A hospital's security team requires that its patient-triage model run with a VPC configuration in private subnets and with network isolation so that the container has no internet access. The model is
- An ML engineer must deploy a computer vision model whose inference code requires a GPU to meet its latency target. The application calls the model a few hundred times a day at unpredictable times and
When many models use the same ML framework and have compatible serving requirements, a SageMaker AI multi-model endpoint can host them in a shared serving container and instance fleet. Sharing raises utilization compared with a separate endpoint for every model. The application must tolerate loading delays for infrequently used models.
Trap Using an inference pipeline to host independent tenant models, which chains processing stages rather than selecting one model for each tenant request.
4 questions test this
- A media company runs 150 PyTorch image-tagging models, and each model is deployed to its own SageMaker AI endpoint on an ml.g5.xlarge instance. Each model is invoked a few times per minute, so GPU uti
- A software company trains a separate XGBoost churn model for each of its 3,000 tenants, and each model has its own SageMaker AI real-time endpoint. Most tenants send only a few requests each day. The
- A retailer has 900 demand-forecasting models that were trained with LightGBM, a framework that has no prebuilt SageMaker AI container with multi-model support. Each model runs on its own endpoint on C
- An insurance company plans to consolidate 400 regional pricing models that use the same TensorFlow serving container onto one SageMaker AI multi-model endpoint. During design review, an architect asks
- Multi-model endpoint latency depends on whether the requested model is already loaded
A SageMaker AI multi-model endpoint loads models on demand and caches them in memory. Under memory pressure it unloads unused models, which can remain on the instance's storage volume for faster reloading. A model with strict latency requirements or disproportionately high traffic is a better candidate for dedicated hosting than for competing with infrequent models in this cache.
Trap Increasing the total number of model files in S3 to warm the endpoint, which does not load those models into serving memory.
5 questions test this
- An ML engineer investigates latency on a SageMaker AI multi-model endpoint. The first request ever made to a newly uploaded model takes several seconds. A model that was idle for a day and then invoke
- A marketing company serves 1,200 propensity models from a SageMaker AI multi-model endpoint on two ml.m5.xlarge instances. Latency has become unpredictable. Amazon CloudWatch shows a low Average for t
- A logistics company hosts 300 route models on a SageMaker AI multi-model endpoint that uses ml.m5.2xlarge instances. Most latency complaints come from first requests to models that must be copied from
- A bank hosts 250 credit-risk models on a SageMaker AI multi-model endpoint. One model, which scores card authorizations, now receives about 70% of all requests and must answer within a strict 50-milli
- A tax-software company hosts a separate scoring model for each of 200,000 customers on a SageMaker AI multi-model endpoint. During filing season, each customer's model is invoked exactly once to score
- Adding a multi-model endpoint model does not require rebuilding the endpoint
To add a compatible model to an existing SageMaker AI multi-model endpoint, upload its artifact to the endpoint's configured S3 location and invoke that model. SageMaker AI loads the requested artifact dynamically, so adding a model does not require an endpoint update.
Trap Creating a production variant for every newly added tenant model, which uses variant-based deployment instead of the endpoint's dynamic model-loading mechanism.
4 questions test this
- An ML engineer adds a new compatible model to an existing SageMaker AI multi-model endpoint by uploading its artifact to the endpoint's Amazon S3 prefix. Before the release, the product owner asks wha
- A fintech company serves per-merchant fraud models from a SageMaker AI multi-model endpoint. Clients call only this endpoint name and pass the target model file name. When a merchant signs up, a pipel
- A company retires the scoring model for a discontinued product line from a SageMaker AI multi-model endpoint that hosts 500 other models. The ML engineer must make sure that the retired model is no lo
- A developer is writing the client code for a SageMaker AI multi-model endpoint after a new churn model was copied to the endpoint's Amazon S3 location as churn-v3.tar.gz. The client already calls Invo
- An inference pipeline runs dependent serving stages in sequence
When inference requires preprocessing, prediction, and postprocessing as a connected sequence, use a SageMaker AI inference pipeline. The containers run in order, passing each stage's output to the next. This keeps the serving transformations with the model instead of requiring the client to coordinate separate stage invocations.
Trap Using direct invocation of one container to run the entire chain, which addresses an individual container rather than serially executing all stages.
4 questions test this
- A healthcare company runs text normalization, a classification model, and label mapping as three containers on three separate SageMaker AI endpoints. Profiling shows that most of the 400-millisecond r
- A retailer trained a demand model with feature transformations written in Spark ML. The same transformations must be applied to individual requests from the ordering application in real time and to a
- A company serves a loan-approval model that needs a scikit-learn featurizer before prediction and a postprocessing step that converts scores to decision codes. Today the client application calls three
- An ML engineer uses the CreateModel API to define a model that must run a feature-encoding container, a prediction container, and a calibration container in sequence on one SageMaker AI endpoint. The
- Direct invocation lets independent containers share an endpoint
When separate models use different frameworks but should share SageMaker AI endpoint resources, a multi-container endpoint can expose containers through direct invocation. Each request selects its intended container rather than traversing an inference pipeline.
Trap Putting incompatible serving frameworks into one multi-model serving container, which assumes the shared-container compatibility that the models do not have.
4 questions test this
- A company hosts an image-quality model and a fraud model, which use different frameworks, on one SageMaker AI multi-container endpoint. The endpoint was configured to run the containers in sequence, s
- A company hosts a claims model and a marketing model, which use different frameworks, on one SageMaker AI multi-container endpoint configured for direct invocation. The marketing analytics application
- A company has four independent models built with TensorFlow, PyTorch, XGBoost, and a custom C++ runtime. Each model runs on its own SageMaker AI endpoint and receives low, steady traffic, so the insta
- An ML engineer deployed a SageMaker AI multi-container endpoint configured for direct invocation that hosts a sentiment container and a topic container. Client requests that call InvokeEndpoint with o
- Inference components give each hosted model its own resource specification
SageMaker AI inference components describe a model and its CPU, accelerator, and memory requirements separately from the endpoint. Use them when several models should share endpoint infrastructure while being added, removed, or updated independently. The resource specification makes allocation explicit rather than assuming every model needs the same share of the host.
Trap Using endpoint traffic weights as GPU-memory reservations, which changes request routing rather than specifying a model's accelerator and memory requirements.
4 questions test this
- A SageMaker AI endpoint hosts four models as separate inference components on shared GPU instances. The data science team retrained one of the models on new data and must roll out the new version this
- A company hosts three fine-tuned language models on one SageMaker AI endpoint that runs on ml.g5.12xlarge instances with four GPUs each. The largest model needs two GPUs and much more memory than the
- A support chatbot model is deployed as an inference component on a shared SageMaker AI endpoint with several other models. During business hours, the chatbot must always have at least two loaded copie
- An ML team wants to consolidate five models on shared SageMaker AI endpoint infrastructure. Two are small CPU-bound classifiers, and three are large language models that need different numbers of GPUs
- SageMaker AI can host compatible models trained outside AWS
A model does not need a SageMaker AI training job to be hosted by SageMaker AI. For an externally trained model supported by an AWS-provided inference container, supply the model artifacts in Amazon S3 and select a compatible framework and version. The hosting configuration also needs a SageMaker AI execution role with access to the required resources.
Trap Retraining an otherwise compatible model solely to obtain a SageMaker AI training-job record, which is not a prerequisite for deployment.
3 questions test this
- An ML engineer creates a SageMaker AI model for an XGBoost model that was trained outside AWS. The model.tar.gz file is in an Amazon S3 bucket in the same Region, and the model uses the SageMaker AI X
- A data scientist trained a model outside AWS with a specific XGBoost version and packaged the model file as model.tar.gz in an Amazon S3 bucket in the deployment Region. The team must host the model o
- A company trained a PyTorch image classifier on its own on-premises GPU cluster. The company now wants to serve the model from a SageMaker AI real-time endpoint without retraining it. The model uses a
- SageMaker AI model artifacts must be in the deployment Region
The S3 bucket containing a SageMaker AI model's artifacts must be in the same AWS Region as the model being created. When moving an externally trained model to another Region, place the artifacts in an appropriate regional bucket before creating the hosting model.
Trap Granting broader S3 permissions to compensate for a cross-Region artifact bucket, which changes authorization but not the regional deployment requirement.
3 questions test this
- A bank hosts an externally trained fraud model on a SageMaker AI endpoint in us-east-1, and its model artifacts exist only in a us-east-1 S3 bucket. The disaster recovery plan requires recreating the
- To serve users in Brazil, an ML engineer copied an externally trained model's model.tar.gz file from a bucket in us-east-1 to a new bucket in sa-east-1. The engineer then ran CreateModel in sa-east-1,
- A European bank trained a credit model outside AWS and uploaded its model.tar.gz file to an S3 bucket in eu-central-1. A data residency rule forbids copying the artifacts to any other Region. A produc
- Custom Model Import brings supported external model weights into Bedrock
When a supported foundation-model architecture has been customized outside Amazon Bedrock and managed Bedrock inference is required, use Custom Model Import. Compatibility with the documented architecture and configuration is a prerequisite; this is an import of model weights, not a generic container-hosting service. Imported models can be invoked with on-demand inference.
Trap Uploading an arbitrary inference Docker image to Custom Model Import, which expects compatible model artifacts rather than a general-purpose serving container.
2 questions test this
- A research team trained a text-embedding model with a custom transformer encoder that it designed itself. The team wants managed, serverless inference and asks whether Amazon Bedrock Custom Model Impo
- A company imported a fine-tuned Mistral model into Amazon Bedrock with Custom Model Import and uses it for interactive chat. The company now wants to run a nightly job that sends 500,000 prompts to th
- Bedrock imports from S3 require supported model files and source access
For a Custom Model Import job whose source is Amazon S3, prepare the model files in Hugging Face weights format and give the import service role access to them. Cross-account buckets and KMS keys require corresponding access grants. A correct file format does not substitute for permission to read or decrypt the source.
Trap Granting only model-invocation permission to the import job role, which authorizes inference rather than reading the source artifacts.
3 questions test this
- An ML engineer starts an Amazon Bedrock Custom Model Import job for a fine-tuned Llama model. The S3 source folder contains only a single PyTorch checkpoint file named model.pt that was saved during t
- An Amazon Bedrock Custom Model Import job in account A reads Hugging Face model files from a bucket in account B. The bucket policy and the import role policy already grant s3:ListBucket and s3:GetObj
- A company's data science account stores fine-tuned model files in Hugging Face format in an S3 bucket. An ML engineer runs a Custom Model Import job from a separate production account, and the job fai
- Existing Kubernetes ML services can move to EKS without model retraining
When an existing Kubernetes deployment already packages ML services as standalone container images, publish those images to Amazon ECR and deploy them to the specified Amazon EKS cluster. Reference the complete ECR image location and provide image-pull permissions. Moving the hosting platform does not itself require changing the trained model or rewriting the workflow into another ML framework.
Trap Rebuilding the services in a new ML orchestration framework for a lift-and-shift requirement, which adds application changes that the existing container deployment does not need.
3 questions test this
- A company moved its ML inference containers to an Amazon EKS cluster that uses managed node groups of EC2 instances. The images are in a private Amazon ECR repository and are referenced by full regist
- A team migrated its Kubernetes model-serving workloads to an Amazon EKS cluster that runs every pod on AWS Fargate. The manifests use full Amazon ECR image names, but pods cannot pull images from the
- A company moved its ML scoring services from an on-premises Kubernetes cluster to an Amazon EKS cluster with managed nodes. The images were pushed unchanged to a private Amazon ECR repository, and the
- Bedrock Provisioned Throughput reserves capacity for supported models
When a supported Bedrock model needs dedicated capacity and consistent throughput, use Provisioned Throughput. On-demand inference is the alternative when usage-based access without a provisioned-capacity commitment meets the workload requirements. Verify the chosen model and Region support the intended provisioning option.
Trap Selecting batch inference to reserve capacity for synchronous application requests, which creates asynchronous jobs instead of a dedicated online serving resource.
3 questions test this
- A contact-center analytics company sends a steady, high volume of summarization requests to a supported Amazon Bedrock base model around the clock. The company needs a guaranteed level of throughput f
- A startup is prototyping an internal writing assistant on a supported Amazon Bedrock base model. Usage is low and irregular, with a few hundred requests on some days and none on others. A team member
- A retailer runs a product-assistant chatbot on a Bedrock base model. For a three-week holiday campaign, the team needs dedicated model capacity with consistent throughput, and on-demand quotas have al
- Bedrock batch inference processes independent prompts through S3 jobs
When a large collection of prompts can be processed asynchronously, submit a Bedrock batch inference job with input files in Amazon S3 and collect the output files from S3. Each input record is processed independently. This mode is not suited to tool-calling conversations that require exchanges between the model and the client.
Trap Submitting an interactive agent tool-use conversation as a batch job, which cannot perform the required back-and-forth tool interactions.
3 questions test this
- A bank serves a live advisory chatbot from a Bedrock Provisioned Throughput purchased for a base model. The team now needs to classify 300,000 historical emails overnight by using the same base model.
- A company wants to run 300,000 support tickets through an Amazon Bedrock model overnight. For each individual ticket, the model must call a get_order_details tool, wait for the order data from the com
- A media company must generate summaries for 400,000 archived articles by using a Bedrock model. Each article is summarized independently, results are needed within a few days rather than in real time,
- Deleting a custom model deployment preserves the underlying custom model
Deleting a Bedrock custom model deployment removes that on-demand serving resource but does not delete its underlying custom model. If inference is needed again, create a new deployment from the retained model. This separates serving-resource cleanup from model retention.
Trap Deleting the underlying custom model to stop using one deployment, which removes the retained model rather than only its serving resource.
3 questions test this
- A company is retiring a fine-tuned Bedrock custom model that was served through an on-demand custom model deployment. The compliance team requires that no Bedrock resource for this model remain afterw
- A team serves a fine-tuned Bedrock custom model through an on-demand custom model deployment. The pilot has ended, and the team must stop the deployment from serving inference without adding any other
- Three months ago, an ML engineer deleted the custom model deployment that served a fine-tuned Amazon Bedrock model for on-demand inference, but kept the custom model itself. A new customer-support pro
- Cross-Region inference profiles route supported model requests across Regions
When the stated deployment permits inference across multiple AWS Regions, a system-defined Bedrock cross-Region inference profile can distribute supported model requests among its defined Regions. The application invokes the profile instead of managing separate regional model invocations itself. Choose a profile whose routing scope meets the application's location requirements.
Trap Using an arbitrary single-Region model identifier to obtain multi-Region routing, which does not select a cross-Region inference profile.
3 questions test this
- A European insurer uses an on-demand Bedrock foundation model from eu-central-1 for claims triage. During monthly peaks, many requests are throttled. Regulations require that inference data is process
- An application calls a Bedrock model with the Converse API. To survive regional throttling, developers maintain separate SDK clients for three US Regions and custom code that retries each throttled re
- A Canadian public agency must process all Bedrock inference requests only in ca-central-1 under its data sovereignty mandate; no other Region may handle the data. Its assistant model supports Provisio
- JumpStart deployment fits foundation models that need control of the hosting environment
When a reusable foundation model must run with explicitly selected SageMaker AI hosting compute and deployment settings, choose a compatible model from SageMaker JumpStart and deploy it to a SageMaker AI endpoint. JumpStart supplies pretrained models while SageMaker AI provides configurable managed hosting. Choose Amazon Bedrock's serverless model access instead when the requirement is to invoke a supported foundation model through an API without selecting and managing its serving infrastructure.
3 questions test this
- A marketing team wants to add text generation to a web application within days. The team has limited ML expertise, does not want to select or manage any servers or instances, and wants to pay per toke
- An ML team wants to deploy an open-weight foundation model from SageMaker JumpStart for a document-classification service. The team must choose the GPU instance type and the instance count, place the
- A company is adding two generative AI features. The first, a contract summarizer, must run an open-weight JumpStart model on a GPU instance type that the security team approved, with an instance count
When a conversational application must use a consistent message-based invocation contract across supported Amazon Bedrock models, use Converse, or ConverseStream when responses must stream. This lets the application reuse its message-handling code across models that support the interface instead of adopting each model's base inference request format. Model-specific inference options can still be supplied separately, so a shared interface does not make every model's capabilities identical.
Trap Using InvokeModelWithResponseStream as the cross-model message abstraction because it streams output, although its request body still follows the selected model's inference format.
3 questions test this
- A software company's chat assistant must let customers choose among several Amazon Bedrock models from different providers. Today the application builds a different InvokeModel request body for each p
- A product team uses the Bedrock Converse API across several foundation models through one shared message-handling module. For one of the models, they need to set an inference parameter that the model
- A support application uses the Bedrock Converse API with messages, a system prompt, and inference settings for several different models. Users now want answers to appear incrementally as the model gen
- Bedrock Marketplace exposes subscribed models through Bedrock APIs with SageMaker AI hosting
When a required foundation model is offered through Amazon Bedrock Marketplace, subscribe to the catalog model and deploy it to a SageMaker AI-managed endpoint. Select the endpoint's instance type and instance count rather than treating this as ordinary serverless Bedrock model access. Invoke the deployment through Bedrock InvokeModel, or Converse for compatible models, using the endpoint ARN to identify the deployment.
Trap Using Custom Model Import to activate a Marketplace catalog subscription, although import requires model artifacts from an external customization environment rather than a catalog subscription.
3 questions test this
- A biotech company needs a specialized protein-sequence foundation model that is offered only through Amazon Bedrock Marketplace. The company wants to call the model through Amazon Bedrock APIs so that
- An application team uses the Amazon Bedrock Converse API for all of its serverless models. The team subscribed to a Bedrock Marketplace model, deployed it to a SageMaker AI endpoint, and confirmed tha
- A company deployed an Amazon Bedrock Marketplace model to a SageMaker AI endpoint with one instance, and its application calls the model through the Bedrock Converse API with the endpoint ARN. Load te
- AgentCore Runtime hosts agent code without requiring a specific framework
When existing agent code needs managed deployment, Amazon Bedrock AgentCore Runtime supports agents built with supported frameworks or custom agent implementations. It is not restricted to foundation models accessed through Amazon Bedrock. This lets a deployment preserve its chosen agent framework and model integration within the Runtime service contract.
Trap Rewriting a working agent to a different framework solely to use AgentCore Runtime, which is framework agnostic.
3 questions test this
- A company built a customer-support agent with LangGraph that calls an OpenAI model through the provider's API. The agent works locally, and the company now needs managed, serverless hosting on AWS wit
- A startup wrote its own lightweight agent loop in plain Python without any agent framework. The loop calls a foundation model, decides which internal functions to run, and keeps conversation state. Th
- A research firm runs a CrewAI multi-agent workflow that can reason over large documents for several hours per request and accepts payloads that combine text and images. The firm needs managed hosting
- AgentCore Gateway exposes existing backends as agent tools
When an agent must use an existing Lambda function or an API described by an OpenAPI specification, AgentCore Gateway can expose that backend through tools compatible with Model Context Protocol. The gateway adapts access to the existing capability; it does not replace the backend's business logic.
Trap Importing API documentation into a knowledge base as a substitute for a tool integration, which makes descriptions retrievable but does not execute the backend action.
3 questions test this
- A retailer has AWS Lambda functions that look up orders, issue refunds, and check inventory. The functions contain tested business logic used by other systems. A new agent must call these capabilities
- A company is building an agent that must call two existing backends: a Lambda function that calculates shipping rates and an inventory REST API that is described by an OpenAPI specification. The agent
- A bank's payments team publishes a REST API with a complete OpenAPI specification. A new loan-servicing agent that the bank is building must call two of the API's operations as tools. The payments tea
- MCP and A2A address different agent communication needs
Use Model Context Protocol when an AgentCore-hosted service exposes tools to agent clients. Use the Agent-to-Agent protocol when the requirement is agent discovery and communication between agents. AgentCore Runtime supports both protocols, but a tool server and a collaborating agent are different integration roles.
Trap Selecting an MCP tool-listing interface as an A2A agent-discovery interface, which substitutes tool discovery for the agent communication contract.
3 questions test this
- A fintech company builds a currency-conversion service that many different agent applications will call to convert amounts and fetch exchange rates. The service performs a fixed set of operations and
- A logistics company is building a customs-clearance agent on AgentCore Runtime. A partner's orchestrator implements only the A2A protocol: it discovers collaborators by fetching their Agent Cards and
- A team built an MCP server that exposes product-search tools to several agent clients. An engineer plans to run it on a self-managed EC2 fleet because the engineer believes AgentCore Runtime hosts onl
- Agent access and tool access require separate authentication paths
AgentCore Runtime supports inbound authentication for clients invoking an agent and outbound authentication for the agent accessing other services. Configure each path for its caller and target, including delegated user access when required. Successful authentication into the agent does not itself establish the agent's credentials for a third-party tool.
Trap Reusing the existence of an inbound authenticated session as proof of downstream API authorization, which leaves the tool's outbound authentication requirement unresolved.
3 questions test this
- A company runs an agent on Amazon Bedrock AgentCore Runtime. Internal batch jobs that run with IAM roles must invoke the agent by using SigV4, and a customer web application must invoke the same agent
- Users sign in with Amazon Cognito to invoke a productivity agent on Amazon Bedrock AgentCore Runtime, and the JWT inbound authorizer works correctly. The agent must now read each user's Google Drive f
- A company hosts an HR assistant agent on Amazon Bedrock AgentCore Runtime. Employees sign in through the company's Amazon Cognito user pool, and only tokens issued to the company's web client should b
- AgentCore applications must implement the selected protocol's service contract
An AgentCore Runtime application must expose the endpoints and message format required by its selected protocol. For example, HTTP request handling and an MCP tool server follow different contracts. Configure the runtime protocol and the application's server consistently rather than deploying a container that merely starts successfully.
Trap Choosing the HTTP runtime protocol for an application that exposes only an MCP server, which mismatches the runtime's expected request interface.
3 questions test this
- A team deploys an MCP tool server to Amazon Bedrock AgentCore Runtime with the MCP protocol selected. The ARM64 container starts without errors and passes its own local tests, but agent clients cannot
- A team deploys a contract-review agent to Amazon Bedrock AgentCore Runtime with the A2A protocol selected so that other agents can collaborate with it. The container listens on port 9000 and accepts J
- An ML engineer deploys an HTTP-protocol agent to Amazon Bedrock AgentCore Runtime. The ARM64 container implements POST /invocations on port 8080, but the server binds to 127.0.0.1 and has no health en
- Bedrock agent action groups separate action definitions from action execution
An Amazon Bedrock Agents Classic action group defines available actions and their inputs through an OpenAPI schema or function details. Configure Lambda execution when Bedrock should pass the selected action and elicited parameters to a Lambda function. Choose return control when the calling application should execute the action instead; Bedrock returns the selected action and parameters in the agent invocation response. The schema describes the available operation, while the chosen execution path supplies its implementation.
Trap Using an AgentCore Gateway tool definition as the Bedrock Agents Classic action-group configuration, even though Gateway adapts backends into MCP tools rather than defining this agent's action group.
3 questions test this
- An ML engineer adds a refundOrder operation to the OpenAPI schema of an existing Amazon Bedrock Agents Classic action group and then prepares the agent. The action group already uses an AWS Lambda fun
- An application calls InvokeAgent on an Amazon Bedrock Agents Classic agent whose WeatherAPIs action group uses return control. The response contains a returnControl object with invocationInputs for ge
- A field-service company uses an existing Amazon Bedrock Agents Classic agent in its tablet app. An action group defines a readLocalWorkOrder function. Work orders are stored only on each tablet, and t
- Client-side Bedrock tool calling requires the application to execute and return tool results
For client-side tool calling in Amazon Bedrock, supply tool definitions with the model request so the model can select a tool and return the inputs it needs. Application code then executes the requested tool and sends its result back in the conversation, allowing the model to continue generation using that result. This model-level interaction is distinct from configuring fulfillment for a Bedrock Agents Classic action group. In supported server-side tool-use configurations, Bedrock executes registered tools on the application's behalf instead; execution ownership depends on the selected mode.
3 questions test this
- An application uses client-side tool calling with the Amazon Bedrock Converse API. The model requests a top_song tool for a radio station call sign that does not exist, and the application's tool code
- A team uses client-side tool calling, so its application code executes every tool that a Bedrock model requests. The security team now wants tool execution centralized in AWS: the team will register a
- A developer uses the Amazon Bedrock Converse API with a toolConfig that defines a get_order_status tool. For a customer question, the response has stopReason set to tool_use and contains a toolUse blo
- A Bedrock agent needs a knowledge-base association and instructions to guide retrieval
When an existing Amazon Bedrock Agents Classic deployment should answer from a Bedrock knowledge base, associate that knowledge base with the agent and provide instructions describing its contents and when to query it. The agent includes these instructions in its prompt context to decide whether retrieval is appropriate for the user's request. Creating and populating the knowledge base alone does not establish this agent integration. Prepare the agent after changing its configuration before testing the retrieval behavior.
Trap Adding an action-group schema as the native knowledge-base integration, although action definitions describe operations and inputs rather than establishing the agent's knowledge-base association.
3 questions test this
- A company runs an Amazon Bedrock Agents Classic agent that handles employee requests. The team created and synced a knowledge base of HR policies, but the agent still answers policy questions from the
- A team edits an existing Amazon Bedrock Agents Classic agent in the agent builder to add a knowledge base of warranty terms with clear instructions on when to use it. In the test window, the agent con
- A company's Amazon Bedrock Agents Classic agent has two associated knowledge bases: one holds HR policies, and the other holds IT runbooks. Both associations use the same instructions, "Company docume
- Code interpretation lets a Bedrock agent execute generated code for analysis and calculations
When an existing Amazon Bedrock Agents Classic deployment must analyze uploaded files, produce visualizations, or perform calculations, enable code interpretation so the agent can generate and run code in a secure test environment. The agent can return results from actual execution rather than only generating code text. Enable Code Interpreter in the agent builder, then save and prepare the agent before testing the changed configuration.
Trap Using an action group's return-control mode as a managed code executor, although that mode sends the selected action and inputs back to application code for fulfillment.
3 questions test this
- A team opens an existing Amazon Bedrock Agents Classic agent in the agent builder, expands Additional settings, and selects Enable for Code Interpreter. Without taking any other action, the team switc
- An ML engineer manages an Amazon Bedrock Agents Classic agent through infrastructure-as-code scripts that call the build-time API. The engineer must turn on the agent's ability to generate and run Pyt
- A finance team uses an existing Amazon Bedrock Agents Classic agent. Analysts want to upload transaction CSV files and receive calculated quarterly totals and charts. The team must not build or operat
- Hybrid retrieval combines semantic similarity with raw-text matching
When knowledge-base queries need both meaning-based matching and raw-text matches, configure hybrid search on a supported vector store with a filterable text field. Semantic search uses vector embeddings alone. Verify the existing store and text-field configuration support hybrid retrieval instead of assuming every vector index can execute it.
Trap Adding a reranker as a substitute for raw-text retrieval when lexical candidates are missing, which only reorders the candidates already retrieved.
3 questions test this
- A team set overrideSearchType to HYBRID on Retrieve requests to an Amazon Bedrock knowledge base whose vectors are stored in a Pinecone index. Queries that contain exact product codes behave the same
- A manufacturer's maintenance assistant queries an Amazon Bedrock knowledge base that is stored in Amazon OpenSearch Serverless with a filterable text field. Technicians ask natural language questions
- A support assistant queries an Amazon Bedrock knowledge base in Amazon OpenSearch Serverless with a filterable text field. Users type questions such as "How do I reset the controller that shows error
- Retrieve separates document retrieval from response generation
Use the Bedrock Knowledge Bases Retrieve operation when the application needs relevant source chunks but will manage generation itself. Use RetrieveAndGenerate when Bedrock should retrieve context and generate an answer with citations. This choice determines whether the managed knowledge-base call owns only retrieval or the combined retrieval-and-generation path.
Trap Calling Retrieve and expecting a synthesized answer with generated citations, which adds a generation responsibility that the retrieval-only operation does not perform.
3 questions test this
- A developer connected an employee FAQ assistant to an Amazon Bedrock knowledge base by calling the Retrieve operation and sending the response to the chat window. Employees now see lists of raw docume
- An internal help desk application must answer employee questions from an Amazon Bedrock knowledge base that indexes policy documents. The team wants one managed API call that retrieves the relevant ch
- A company built an Amazon Bedrock knowledge base over its engineering manuals. Answers must be generated by a fine-tuned model that the company already hosts on a SageMaker AI endpoint, and the applic
- Reranking reorders retrieved candidates for relevance to the query
When retrieval finds candidate documents but their ordering is insufficient, configure a supported reranking model in the Bedrock knowledge-base query. The reranker assesses retrieved candidates for relevance before the selected context is used. It refines retrieval results rather than changing the generation model's sampling behavior.
Trap Lowering generation temperature to improve document ranking, which changes response sampling rather than the ordering of retrieved candidates.
3 questions test this
- A company uses a fully managed Amazon Bedrock knowledge base with managed embedding. Retrieve requests use the default reranking behavior. After an evaluation, the team decides that its relevance resu
- An ML engineer must add a reranker model to existing RetrieveAndGenerate calls on an Amazon Bedrock knowledge base so that retrieved chunks are reordered by relevance before the answer is generated. T
- A support team queries an Amazon Bedrock knowledge base of troubleshooting articles. Evaluation shows that the article that answers a question is usually among the top 20 retrieved chunks but is rarel
- Metadata filters restrict which documents may satisfy a retrieval query
When answers must use documents from a specified department, date range, or category, apply a Bedrock knowledge-base metadata filter. The document metadata must be ingested and supported by the vector store. Filtering constrains the eligible results rather than merely requesting that the language model ignore unwanted sources after retrieval.
Trap Adding a department instruction only to the generation prompt, which does not constrain the documents returned by the retrieval query.
3 questions test this
- A company stores policy documents from several departments in one Amazon Bedrock knowledge base, and each document has a department metadata attribute that was ingested. The HR assistant must answer o
- A news analytics application queries an Amazon Bedrock knowledge base of market reports. Each document has a numeric metadata attribute named epoch_modification_time that stores the last update time i
- An ML engineer adds an equals filter on a region attribute to Retrieve requests for an Amazon Bedrock knowledge base whose data source is an Amazon S3 bucket. Every filtered query returns no results,
- A retrieval result limit is a maximum rather than a guaranteed result count
Bedrock knowledge-base retrieval returns up to the configured number of results. With hierarchical chunking, the limit counts retrieved child chunks, and children sharing a parent can be consolidated into the parent chunk in the response. Consequently, fewer final results can be correct behavior even when the requested limit is higher.
Trap Treating parent-chunk consolidation as missing indexed documents, which mistakes retrieval assembly for an ingestion failure.
3 questions test this
- A knowledge base in Amazon Bedrock uses hierarchical chunking. An ML engineer sets numberOfResults to 10 in Retrieve requests, but many responses contain only 6 results, and several of those results a
- A RetrieveAndGenerate application on an Amazon Bedrock knowledge base fails for some long questions with an error that the prompt exceeds the character limit. The knowledge base uses large fixed-size
- A QA engineer writes an automated test for a RAG service that calls Retrieve on an Amazon Bedrock knowledge base with numberOfResults set to 8. The test fails whenever the response contains fewer than
- Query decomposition breaks a multifaceted question into retrieval subqueries
When one knowledge-base query combines multiple information needs, enable query decomposition to break it into smaller subqueries. Bedrock can execute several retrieval queries and use their results to form the final response. This addresses a broad or compound query rather than simply requesting more candidates for the unchanged query.
Trap Increasing the retrieval result limit as a substitute for separating multiple information needs, which still searches with the original compound query.
3 questions test this
- A company enables query decomposition on RetrieveAndGenerate calls to an Amazon Bedrock knowledge base so that complex comparison questions receive complete answers. The operations team asks what chan
- A company's HR assistant calls RetrieveAndGenerate on an Amazon Bedrock knowledge base. For questions such as "What is the parental leave policy in Germany, and how do I file a relocation expense clai
- An ML engineer is reviewing four types of questions that users send to a RetrieveAndGenerate application on an Amazon Bedrock knowledge base before enabling query decomposition. The engineer wants to
- Implicit filtering uses a metadata schema to derive filters from a query
When users express document constraints in natural language, Bedrock Knowledge Bases can use a supported model and a supplied metadata schema to generate retrieval filters. Describe the available metadata attributes so the model can map user intent to actual fields. Explicit filters remain appropriate when the application already knows the required filter values.
3 questions test this
- A financial research assistant queries an Amazon Bedrock knowledge base of company filings. Documents have company, ticker, and fiscal_year metadata. Users type requests such as "What did Amazon say a
- An ML engineer enabled implicit filtering on Retrieve requests to an Amazon Bedrock knowledge base. The metadata schema lists attributes named cc, fy, and seg, each with an empty description. Generate
- An ML engineer is adding implicit metadata filtering to Retrieve requests for an Amazon Bedrock knowledge base. The engineer has written metadataAttributes schemas for product, region, and release_yea
- Knowledge-base generation can use an explicitly selected guardrail version
When a RAG response path requires Bedrock Guardrails, configure the chosen guardrail identifier and version for knowledge-base response generation. This applies the specified controls to that generation path rather than relying only on prompt wording. Verify that the intended model and guardrail features are supported together.
Trap Adding safety instructions to a prompt as an equivalent to attaching the configured guardrail, which does not enable the managed guardrail controls.
3 questions test this
- A company wants a contextual grounding check from Amazon Bedrock Guardrails on its RetrieveAndGenerate knowledge base application so that answers not supported by the retrieved sources are blocked. Th
- A bank's customer assistant uses RetrieveAndGenerate on an Amazon Bedrock knowledge base. Compliance requires that answers never provide individualized investment advice. The team has added a sentence
- A team configured a guardrail with a sensitive information filter on RetrieveAndGenerate calls to an Amazon Bedrock knowledge base. Testers notice that the generated answers are masked correctly, but
References
- https://docs.aws.amazon.com/sagemaker/latest/dg/hosting-faqs.html
- https://docs.aws.amazon.com/aws-certification/latest/machine-learning-engineer-associate-02/machine-learning-engineer-associate-02-domain3.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/serverless-endpoints.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/async-inference.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/multi-model-endpoints.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/multi-container-endpoints.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/multi-container-direct.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/triton.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/deploy-model-advanced.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/inference-pipelines.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/realtime-endpoints-deploy-models.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/invoke-multi-model-endpoint.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/custom-model-import-prereq.html
- https://docs.aws.amazon.com/AmazonECR/latest/userguide/ECR_on_EKS.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/deploy-custom-model-on-demand.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles.html
- https://docs.aws.amazon.com/decision-guides/latest/decision-guides/bedrock-or-sagemaker.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/jumpstart-foundation-models-use-studio-updated-deploy.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/amazon-bedrock-marketplace.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-marketplace-deploy-a-model.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-marketplace-call-the-endpoint.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use-client-side.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/inference-chat-completions.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/agents-classic-maintenance-mode.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/agents-kb-add.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/action-define.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/action-handle.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/agents-code-interpretation.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/agents-enable-code-interpretation.html
- https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agents-tools-runtime.html
- https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-service-contract.html
- https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-http-protocol-contract.html
- https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-mcp-protocol-contract.html
- https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway.html
- https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-oauth.html
- https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-outbound-auth.html
- https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-inbound-auth.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-retrieve.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-retrieve-generate.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/kb-build-managed.html
- https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_KnowledgeBaseVectorSearchConfiguration.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/rerank.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/multi-model-support.html