Skill 1.1.10
Integrate managed AWS AI services into applications.
Key Concepts
The Amazon Bedrock Runtime API offers two ways to call a model. Converse (and ConverseStream for token-by-token output) uses one request format for every supported model: a list of messages with roles, an optional system prompt, inferenceConfig settings such as maxTokens and temperature, and an optional toolConfig that describes tools the model may ask the application to call. The response contains the output message, a stopReason and token usage. InvokeModel sends the provider's native JSON body, so code must change when the model changes. New code normally uses Converse.
A request names a model ID or an inference profile. Cross-Region inference profiles, such as a geographic profile that starts with us. or eu., or a global profile, route requests to other Regions with spare capacity, which raises throughput but means prompts may be processed outside the source Region. Applications handle ThrottlingException with retries and backoff, ValidationException by fixing the request, and AccessDeniedException by checking IAM and model access.
Bedrock also provides higher-level features that an application calls rather than builds. Knowledge Bases answer questions from the company's documents through the Retrieve and RetrieveAndGenerate APIs. Agents for Amazon Bedrock plan multi-step tasks and call action groups backed by Lambda functions through InvokeAgent. Batch inference processes large JSONL files from S3 asynchronously at a lower price, and prompt caching reduces cost and latency for prompts that repeat a long prefix. The bedrock-mantle endpoint offers OpenAI-compatible APIs, so existing OpenAI SDK code can call Bedrock models by changing the base URL and key.
Amazon Bedrock AgentCore hosts agents built with any framework. AgentCore Runtime runs each session in an isolated microVM and is called with InvokeAgentRuntime, while Memory, Gateway, Identity and Observability add conversation memory, tool access, authentication and tracing. Amazon Quick is an agentic workspace in which business users chat with company data, run research and automate workflows; developers connect applications to it through its integrations rather than calling a model API.
Integration code follows the usual AWS patterns. A Lambda function or container calls Bedrock with its IAM role, never with keys in code. Long generations are streamed to the client, for example through Lambda response streaming or an API Gateway WebSocket API, or handled asynchronously through a queue, because synchronous API integrations time out. Prompts are versioned like code, and model output is validated before the application acts on it.