AWS Builder Center
A Deep Dive into Implementing real-time AI Interviews with AWS Bedrock's Newest Model "Nova 2 Sonic"

A Deep Dive into Implementing real-time AI Interviews with AWS Bedrock's Newest Model "Nova 2 Sonic"

Discover the undocumented technical hurdles and practical workarounds required to build a production-ready, real-time AI interview system using Amazon's newest speech-to-speech model "Nova 2 Sonic". This deep dive shares essential lessons on stream management, event sequencing, and WebSocket handling to save developers weeks of trial and error.

Building the future of professional networking with AI | AWS & Data Architect | CTO @ JuntoAI

Introduction

When Amazon announced Nova 2 Sonic at re:Invent 2025, I knew it was exactly what we needed for JuntoAI Kinetic: a speech-to-speech AI model that could conduct natural, real-time interviews without the latency of traditional STT → LLM → TTS pipelines. The promise was compelling: native voice activity detection, natural conversation flow, and sub-second response times.
Weeks of intense development and countless debugging sessions later, we have a production-ready implementation conducting 15-minute AI-powered career interviews. But getting there required discovering patterns, workarounds, and undocumented constraints that aren't obvious in the AWS documentation.
This post shares everything we learned - the good, the challenging, and the "why didn't the docs mention this?" - to help you avoid the pitfalls we encountered.

The Vision: AI Career Interviews at Scale

JuntoAI Kinetic acts as an "AI Chief of Staff" that transforms a professional's career history into a strategic portfolio through a high-velocity, speech-to-speech interview. Our requirements were strict:
  • 15-minute sessions with hard timeouts for cost control
  • Real-time interaction with natural conversation flow
  • Multi-category structure (Values, Experience, Dream Position)
  • Proactive stream management to avoid Bedrock connection limits
  • Cost target: <$0.15 per completed session
Amazon Nova 2 Sonic seemed perfect. But building a resilient production system revealed significant gaps between basic examples and reality.

The Documentation Gap

AWS Bedrock documentation shows you the API signature and basic examples. What it doesn't clearly map out for production use cases:
  1. The silent "55-second inactivity" timeout that kills sessions.
  1. How to actually steer the AI's behavior mid-session (The "3 Levers").
  1. How to gracefully handle the hard ~8-minute stream limit.
  1. The exact event sequencing required for bidirectional streaming.
  1. Why you need async event queue patterns (like an RxJS Subject).
Here is how we solved each of these challenges.

Critical Learning #1: The 55-Second Silent Killer (Keepalive Hack)

The Undocumented Constraint: Nova 2 Sonic will silently drop the connection if it doesn't receive audio or interactive content for 55 seconds. In a natural interview where a user might pause to think deeply about a complex career question, a 55-second silence is entirely possible and it will crash your session.
Our Solution: The Keepalive Hack - To keep the connection alive without interrupting the user's thought process, we implemented a background keepalive interval. Every 20 seconds, if no real audio has been sent, we inject a tiny chunk of absolute silence.
// Keepalive interval \- sends silence chunks to prevent Nova Sonic timeout
const KEEPALIVE\_INTERVAL \= 20000; // 20 seconds
setInterval(() \=\> {
const timeSinceLastAudio \= Date.now() \- session.lastAudioInputTime;
if (timeSinceLastAudio \> KEEPALIVE\_INTERVAL) {
// Send 100ms of silence (1600 samples at 16kHz)
const silenceBuffer \= Buffer.alloc(3200); // 1600 samples \* 2 bytes
this.processAudioChunk(sessionId, silenceBuffer);
}
}, KEEPALIVE\_INTERVAL);
By feeding the model 100ms of PCM 16kHz silence (an array of zeros), the connection stays open indefinitely without the AI thinking the user has spoken.

Critical Learning #2: Mid-Session Flow Control (The 3 Levers)

The Problem: In a 15-minute interview, you need to force the AI to move from "Values" to "Experience", or tell it to wrap up. How do you inject commands mid-stream?
Through rigorous testing, we discovered there are exactly 3 levers for mid-session flow control, and they behave very differently:
  1. Lever 1: Non-Interactive ASSISTANT Context (interactive: false)
  • What happens: Sonic treats this as background context. It "sees" it, but has no obligation to act on it immediately.
  • Verdict: Fails for behavioral directives (like "Move to the next section"). Excellent for silent context injection (like injecting a parsed CV summary).
  1. Lever 2: Tool Use (role: TOOL)
  • What happens: 100% reliable, but the protocol is strictly request-response. Sonic must initiate a toolUse event first; you cannot push an unsolicited toolResult to force a transition.
  1. Lever 3: Cross-Modal USER Text (interactive: true)
  • What happens: You inject a text message masquerading as the user. Sonic is contractually obligated to respond to interactive USER messages immediately.
  • Verdict: The Secret Weapon.
Our Solution for Pillar Transitions: When it's time to move to the next section, we wait for the user to finish speaking, add a 50-150ms debounce delay (to ensure ASR finalization), and inject a synthetic USER message:
const transitionMessage = "[INTERVIEWER NOTE: We've spent enough time on the current section. Please transition now to experience and achievements. Briefly signal the shift to the user, then immediately ask your first question.]";
await this.injectUserText(sessionId, transitionMessage);
Sonic reads this, naturally wraps up the thought, and seamlessly transitions to the next pillar.

Critical Learning #3: Beating the 8-Minute Limit

The Constraint: AWS Bedrock enforces an ~8-minute limit (in some cases we found 8:07 min) on  InvokeModelWithBidirectionalStreamCommand  connections.
The Reactive Mistake: Initially, we checked a timer and frantically recreated the stream when we got close to 8 minutes. This caused awkward cut-offs mid-sentence.
The Production Solution: Proactive Rotation
Instead of waiting for the limit, we proactively rotate the stream at natural conversation breaks (our "Pillar Transitions" every 6-7 minutes).
Here is our exact AWS Best Practice sequence for rotating a stream without the AI losing context:
  1. Detect Transition: User finishes answering a question near a transition boundary.
  1. Close & Create: Gracefully close the stream and immediately open a new one.
  1. Global Prompt: Send the system prompt.
  1. Replay History: Iterate through your saved transcript and inject previous turns as interactive: false text blocks so the AI remembers the chat.
  1. Re-inject CV: Send the user's resume summary again.
  1. Trigger AI: Send a synthetic USER text: "Continue the conversation naturally from where we left off. Don't re-greet me."
The user experiences a tiny ~2-second pause, and the AI continues perfectly seamlessly into a fresh 8-minute window.

Critical Learning #4: Global System Prompting

The Mistake: We initially tried swapping out system prompts dynamically per pillar, or giving the model massive lists of example phrases to use. Nova 2 is highly sensitive; if you give it a list of phrases, it will overuse them robotically.
The Solution: Use a single, global system prompt (~1,250 tokens) for the entire session. Use bulleted instructions, avoid numbered lists (which the AI might read aloud), and use exactly one "One-Shot" example to dictate pacing.
You are the "Chief of Staff" for JuntoAI Kinetic conducting a partnership interview.
USER NAME: {{userName}}
## Instructions
- Keep spoken responses under 15 seconds
- Dig deeper: If user says "I managed a team," ask "How many people? What was the budget?
- Handle interruptions: If user interrupts, stop immediately and listen
## Response Style
After a high-density response, provide a brief summary before your next question.
Example:
User: I need autonomy in execution. Managers should only step in for major decisions.
Assistant: Got it - autonomy in execution is essential for you. [2 second pause] Let's move to Pillar 2. What was the budget of your last project?
## Interview Structure
Cover 3 pillars in order:
1. Values & Red Flags
2. Experience & Highlights
3. Dream Position
Notice the [2 second pause] in the example? Sonic will actually adopt this timing, making the conversation feel vastly more human. We didn't expect that this is working as Nova 2 Sonic has no internal timing, but it works :-)

Critical Learning #5: Transcript Filtering is Critical

The Gotcha: Nova 2 Sonic emits TWO types of transcripts during speech recognition: SPECULATIVE (real-time, shifting ASR guesses) and FINAL (confirmed).
If you store SPECULATIVE transcripts, your database will be polluted with duplicates:
SPECULATIVE: "I worked at..."
SPECULATIVE: "I worked at Google..."
FINAL: "I worked at Google for five years."
The Fix: Only store text chunks where  generationStage !== 'SPECULATIVE' . This reduced our transcript storage costs by 70% and drastically improved the quality of our post-interview JSON extraction.

Architecture & Cost Reality Check

Here is our production architecture for 15-minute interviews:
┌─────────────────────────────┐
│ React Frontend │
│ • Microphone capture │
│ • WebSocket audio stream │
└──────────────┬──────────────┘
│
┌──────────────▼──────────────┐
│ JuntoAI Kinetic Service │
│ • Event protocol handler │
│ • Proactive stream rotation│
│ • Cross-modal injections │
│ • 55s Keepalive pings │
└──────────────┬──────────────┘
│
┌──────────────▼──────────────┐
│ Amazon Nova 2 Sonic │
│ (us-east-1 strictly) │
└─────────────────────────────┘
Real-World Data:
  • Latency (TTFAB): 2-3 seconds (target was <600ms, but 2s feels natural for complex interview questions).
  • Nova Sonic Interview: ~$0.10 per 15-minute session.
  • Nova Lite Analysis (Post-Processing): ~$0.05 per session.
  • Total per session: ~$0.15 ✅ (Well within startup budget constraints).

Conclusion

Amazon Nova 2 Sonic is powerful. When it works, it's magical: natural conversation, great emotional tone, and native barge-in support. But getting there requires navigating undocumented patterns and learning through trial and error.
Our implementation is now stable, resilient, and cost-effective, conducting highly structured 15-minute interviews seamlessly.
For fellow builders: Don't be discouraged by the learning curve. The end result is worth it. Study the event protocol, implement comprehensive logging, utilize cross-modal text for flow control, and make sure you have that keepalive hack running!

About JuntoAI Kinetic

JuntoAI Kinetic is an AI Chief of Staff that transforms career history into strategic portfolios through high-velocity speech-to-speech interviews. We're creating the future of professional identity and career development.
Have you implemented Nova 2 Sonic in production? What patterns did you discover? Let's continue the conversation in the comments or reach out directly.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article