Building natural voice conversations with AI agents has traditionally required complex infrastructure and months of engineering work. Text-based agent interactions follow a turn-based pattern — a user sends a complete request, waits for processing, and receives a complete response before continuing. Bi-directional streaming removes that constraint by establishing a continuous connection that carries data in both directions at once. Amazon Bedrock AgentCore Runtime now supports this capability for real-time, two-way communication between users and AI agents, as detailed in the AWS announcement.
Why bi-directional streaming matters
With a full-duplex connection, an agent can listen to user input while generating a response — beginning to answer before the user finishes, handling mid-conversation interruptions, and adjusting output based on real-time feedback. That is what makes voice agents feel human: users expect to interrupt, correct themselves, clarify, or change subject without awkward turn-taking. These agents process audio input and output simultaneously while preserving conversation state, even when the direction of the conversation changes.
Building this from scratch means managing low-latency connections, concurrent audio streams, context preservation across exchanges, and scaling across many simultaneous conversations — typically months of specialized real-time systems engineering. AgentCore Runtime addresses this with a secure, serverless, purpose-built hosting environment, handling connections, message ordering, and conversation state so developers do not build custom streaming infrastructure.
Beyond voice: other interaction patterns
Voice is the flagship use case, but the pattern generalizes. Interactive debugging sessions let developers guide agents through problem-solving in real time. Collaborative agents can work on shared tasks with continuous input rather than complete upfront instructions. Multimodal agents can process streaming video or sensor data while simultaneously returning analysis. Long-running asynchronous operations can stream incremental results over minutes or hours.
WebSocket implementation requirements
Per the AgentCore documentation, containers must implement a WebSocket endpoint on port 8080 at the /ws path — allowing a single agent container to serve both the traditional InvokeAgentRuntime API and the new streaming API — plus a /ping endpoint for health checks. Clients connect to the service endpoint over the WebSocket protocol:
wss://bedrock-agentcore..amazonaws.com/runtimes//ws Connections must use one of the supported authentication methods — SigV4 headers, SigV4 pre-signed URLs, or OAuth 2.0 — and the agent application must implement the WebSocket service contract specified in the HTTP protocol contract.
Two implementation paths
The sample repository offers two approaches. The first is a native Amazon Nova Sonic Python WebSocket server deployed directly on AgentCore Runtime — Nova Sonic integrates speech understanding and generation in a single model, and the native implementation gives full control over its protocol with direct event handling and complete visibility into session management, audio streaming, and response generation.
The second is the Strands bi-directional agent, a high-level framework abstraction that simplifies streaming, automates session management, and integrates tools. The following snippet shows the simplification:
from strands.experimental.bidi.agent import BidiAgent
from strands.experimental.bidi.models.nova_sonic import BidiNovaSonicModel
from strands_tools import calculator
@app.websocket("/ws")
async def websocket_endpoint(websocket: WebSocket, model_name: str):
# Define a Nova Sonic BidiModel
model = BidiNovaSonicModel(
region="us-east-1",
model_id="amazon.nova-sonic-v1:0",
provider_config={
"audio": {
"input_sample_rate": 16000,
"output_sample_rate": 24000,
"voice": "matthew",
}
}
)
# Create a Strands Agent with tools and system prompt
agent = BidiAgent(
model=model,
tools=(calculator),
system_prompt="You are a helpful assistant with access to a calculator tool.",
)
# Start streaming conversation
await agent.run(inputs=(receive_and_convert), outputs=(websocket.send_json))
The framework handles protocol complexity internally. The agent declaration is equally compact:
agent = BidiAgent(
model=model,
tools=(calculator, weather_api, database_query),
system_prompt="You are a helpful assistant..."
)Tools are passed directly to the agent’s constructor, and Strands orchestrates function calling automatically. The contrast is striking: a basic WebSocket implementation of the same functionality takes roughly 150 lines of code, while the Strands version needs about 20 lines focused on business logic. Developers define agent behavior, tools, and system prompts instead of managing WebSocket connections, parsing events, handling audio fragments, or orchestrating async tasks. Note that the Strands bi-directional feature currently supports only the Python SDK.
Conclusion, limitations, and what to watch
Bi-directional streaming in AgentCore Runtime changes the economics of building conversational agents: WebSocket-based real-time infrastructure comes managed, and teams can choose between low-level protocol control with Nova Sonic or the high-level Strands abstraction in a single serverless environment.
Practical caveats: streaming voice agents are billed while sessions run, and long-lived connections have idle-timeout behavior worth understanding before production use; the Strands path is Python-only for now; and the native path requires real familiarity with the Nova Sonic event protocol. As with any newly released capability, API contracts and SDK support may evolve — the AWS documentation is the authoritative reference. Related reading on this site: deploying Mistral’s Voxtral speech models on SageMaker and the AWS AI League 2026 agentic challenge.