AWS Builder Center
Building a voice-first AI assistant on AWS: Bedrock, Lambda, Fargate and lessons from a solo build

Building a voice-first AI assistant on AWS: Bedrock, Lambda, Fargate and lessons from a solo build

How I built Beep Ai, an Android AI assistant with real-time voice, 25+ tools and maps, using Amazon Bedrock, Lambda, DynamoDB, Fargate, CloudFront and Amazon Location Service. Architecture, costs, and the bugs that taught me the most.





 https://www.beepai.cloud 

Building a voice-first AI assistant on AWS

Beep Ai is an Android app: a pocket robot you talk to. It finds places and guides you like a GPS, sets spoken reminders, searches the web, creates PDFs and charts, and remembers who you are. I built it alone. This article covers the AWS side: what runs where, what it costs, and what broke.

Architecture in one minute

The app (Expo / React Native) talks to two backends in  us-east-1 :
  • A serverless text backend. Amazon API Gateway → AWS Lambda → Amazon DynamoDB, deployed with AWS SAM. A second, scheduled Lambda (the "tick") sends push notifications such as reminders and important dates.
  • A voice backend. A WebSocket server on AWS Fargate behind an Application Load Balancer and Amazon CloudFront, giving the app a fixed  wss://  endpoint. Code goes out through AWS CodeBuild and Amazon ECR.
Both call Amazon Bedrock, and both share the same agent logic and tool set.

The models

Job
Model
Chat and tool use
Claude Haiku 4.5 on Bedrock
Real-time voice
Amazon Nova 2.5 Sonic (speech-to-speech)
Cheap background work (profile extraction, proactive pushes)
Amazon Nova Lite
Splitting the models by job kept cost down. Early on, everything ran on Nova Lite. It was cheap, but unreliable at deciding when to call tools and at getting weekdays right. Moving the text brain to Haiku fixed that, while Nova Lite stayed on low-stakes tasks.

Tools make it an agent

The assistant has more than 25 tools defined as Bedrock tool specs: reminders (create, edit, list, delete), weather, news, books, movies, web search, link reading, places, routes, file creation (image, chart, PDF), calendar, memory, and friends' messages.
Maps and routes use Amazon Location Service (Maps, Places and Routes). The app renders the map with MapLibre, and the key stays server-side until a logged-in user asks for it.

Real-time voice: where the hard part lived

Nova Sonic is bidirectional streaming, so the server holds a long-lived WebSocket per conversation. Things I had to solve:
  • Echo and dead microphones. On the speaker, the assistant heard itself, and on some phones the recorder went silent after the first reply. The fix was a native patch to use the voice-communication audio preset plus a watchdog that only treats the mic as dead when the signal is frozen.
  • Conversation continuity. On reconnect, the server replays the last ten turns as text before audio, and the prompt tells the model not to greet again if the last exchange was recent.
  • Late transcripts. The final assistant text arrived 8–13 seconds after the audio, so the server stores the speculative text and uses it if the session ends first.

The bug that taught me the most: "Done!" (and did nothing)

Asked to schedule a long list of classes, the model created a few reminders and announced that everything was scheduled. Three causes:
  1. A request that only mentioned the calendar was treated as "open the calendar".
  1. When a response hit the max-token limit mid tool call, my code discarded all tool calls. Now it runs the complete ones, drops the truncated last one, and lets the model continue for up to eight rounds.
  1. A long spoken request arrives as several transcript chunks, so I merge the chunks.
On top of that, I added a verification pass: for long "create many items" requests, after the model says it's finished, the backend sends it the original request plus the real list of reminders and asks it to create only what's missing. Models are good at saying they did something; the backend should check.

Security and cost controls

  • IAM by resource name. The deploy user has narrow policies and a permissions boundary. I tested the policy with a simulation script (78 cases).
  • Budgets and anomaly detection. A monthly Bedrock budget with 50/80/100% alerts and a daily anomaly digest. Budgets only warn; they don't stop anything, so I keep a manual brake (scaling the Fargate service to zero).
  • Daily limits. Voice is capped per account at 900 seconds a day, with web search and link-reading caps too.
  • Cost. The voice stack (ALB plus one small Fargate task) is the fixed cost, about US$27–32 a month while running. The serverless side scales to near zero when idle.

What I'd do next

The app currently authenticates with a shared app key. Before a public launch I plan to move to Amazon Cognito with Play Integrity, add a trail in CloudTrail, and finish the second phase of the IAM hardening.

Takeaways

  1. Pick the model per job, not one model for everything.
  1. Always verify tool-calling agents against real state.
  1. Real-time voice needs real phones, not just emulators.
  1. Put budgets and daily limits in place before you have users.
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