The application layer: UIs, chaining, log analysis
Lesson 4 of 4 in FM APIs, Streaming, and Application Wiring.
The last mile is everything between a working FM call and a shipped product. The API front is API Gateway doing GenAI-shaped work: handling streaming responses, token-limit management — budgeting input (trim, summarize, or reject oversized context before the model sees it) and capping output (maxTokens) so one request cannot blow the window or the bill — and retry strategies tuned for model timeouts, which run long and deserve different budgets than CRUD calls.
Above that sits a toolbox the exam names item by item: AWS Amplify for declarative UI components that wire frontends to GenAI backends; OpenAPI specifications for API-first development (the spec is the contract — docs, SDKs, and API Gateway request validation all generate from it); Amazon Bedrock Flows as the no-code visual builder chaining prompts, models, Knowledge Bases, and Lambda into an invocable workflow; Bedrock Data Automation turning documents, images, audio, and video into structured output; Amazon Q Developer generating and refactoring the code itself; and prompt chaining decomposing big tasks into sequenced model calls. Beside Q Developer in the AI-developer-tools drawer sits Kiro, AWS's agentic IDE, whose lane is spec-driven development: requirements become specs and task plans that coding agents execute.
Interactive sorting exercise: The application layer is a toolbox exam. Match each requirement to the named tool.
Two of those tools deserve a closer look. Prompt chaining replaces one heroic prompt with a pipeline: extract → analyze → draft → review, each step a model call whose output feeds the next prompt. Chains are more controllable (each step is small and testable), more debuggable (you can see which step went wrong), and cheaper to fix (re-run one link, not the saga) — orchestrated by Step Functions when you want state-machine rigor, by Flows when you want the visual builder, or by Strands/Agent Squad when steps need agentic autonomy. For business-system wiring, the shapes repeat: Lambda enriching CRM records, Step Functions orchestrating document pipelines, BDA doing the heavy multimodal lifting inside them.
When quality drifts, the diagnosis kit is this: enable Bedrock model invocation logging, then use CloudWatch Logs Insights to query prompts and responses in bulk — which prompt versions correlate with refusals, which inputs produce the longest outputs, what changed on Tuesday. X-Ray answers the latency half, and Q Developer helps recognize GenAI-specific error patterns in code and logs. Deeper observability lives in Performance and monitoring.
Key terms: Amazon Bedrock Flows, Amazon Bedrock Data Automation (BDA), Amazon Q Developer, Prompt chaining
Interactive checkpoint quiz (3 questions) — open this page in a browser to take it.