Andres Moreno Profile Picture

Andres Moreno

I'm Andres Moreno, Principal Software Architect at Caylent. I focus on serverless techonology in AWS

Skip the Middleman: Connecting Your UI Directly to an AI Agent via WebSocket

Learn how to connect your browser directly to an AI agent over WebSocket using Amazon Bedrock AgentCore, skipping the traditional Lambda proxy and enabling real-time token streaming.

9-Minute Read

Title image for Skip the Middleman: Connecting Your UI Directly to an AI Agent via WebSocket

I’ve been building AI agents for a while now, and streaming responses to a UI has always been the painful part. In previous projects I tried API Gateway streaming, Lambda response streaming, and even AppSync Events via an agent tool call to notify the UI. I also looked at adding my own WebSocket API through API Gateway, which requires managing $connect, $disconnect, and $default routes, storing connection IDs in DynamoDB, and posting messages back through @connections. All of these…

Recent Posts