AI Cloud Architect

Structured outputs on Amazon Bedrock: Schema-compliant AI responses

AWSHow-to by Jeffrey Zeng and Jonathan EvansAWS Artificial Intelligence Blog

Today, we’re announcing structured outputs on Amazon Bedrock—a capability that fundamentally transforms how you can obtain validated JSON responses from foundation models through constrained decoding for schema compliance. In this post, we explore the challenges of traditional JSON generation and how structured outputs solves them. We cover the two core mechanisms—JSON Schema output format and strict tool use—along with implementation details, best practices, and practical code examples.

Read the original (opens the source's page in a new tab)

AI: Summary

What it is

Bedrock now constrains model responses to a supplied JSON schema via JSON Schema output format and strict tool use, so output parses and matches types without retry logic.

Who it is for

Developers building extraction pipelines or agents on Amazon Bedrock that currently validate and retry model JSON.

Key points

  • Requires additionalProperties set to false on all objects; recursive and external $ref schemas are not supported.
  • Compiled grammars are cached per account for 24 hours; changing schema structure invalidates the cache.
  • Post says the feature is generally available in all commercial AWS Regions for select model providers, with cross-region inference and batch supported.
  • Check stopReason, since refusals and token limits can still yield non-conforming responses.

The same at other vendors

Timeline

  1. What it explainsStructured outputs now available in Amazon Bedrock · AWS · Announcement
  2. This postStructured outputs on Amazon Bedrock: Schema-compliant AI responses

Go deeper