QuestionQ104

VerifiedImplementation and Integration

A company built a multimodal content-analysis application on Amazon Bedrock. The application routes different content types (text, images, and code) to specialized foundation models (FMs).

The application must handle multiple types of routing decisions:

  • Simple routing based on file extension must have minimal latency.
  • Complex routing based on content semantics requires analysis before FM selection.
  • The application must provide detailed history and support fallback options when primary FMs fail.

Which solution will meet these requirements?

Explanation

A hybrid approach best fits the differing needs of the two routing scenarios. Handling extension-based routing directly in application code avoids the overhead of an orchestration service call, keeping latency minimal for the simple case. For complex, semantics-driven routing, an AWS Step Functions state machine can use JSONata expressions to analyze and transform the content/state data before selecting a model, then invoke the chosen specialized FM through the Bedrock optimized service integration (the InvokeModel API action, arn:aws:states:::bedrock:invokeModel). Step Functions state machines inherently log every state transition, giving detailed execution history, and support built-in Retry and Catch error-handling constructs, which provide automatic fallback to alternate FMs when a primary model invocation fails. This combination — lightweight code-based routing for the simple case and a Step Functions/JSONata/InvokeModel workflow for the complex case — satisfies all the stated latency, analysis, auditability, and fallback requirements.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!