← Questions

Design a resumable streaming voice reply for an AI chat

0
SierraSystem designLast asked Oct 2026

Users talk to an AI agent in a chat box over a WebSocket. The service streams the model's output from an LLM API (over SSE) and turns it into audio that it plays back to the user frame by frame. A user can drop off mid-reply, so the client reports the last frame it actually played, and after reconnecting it should pick up right after that frame.

Cover:

  • how a message flows from the user to the LLM and back as ordered audio frames
  • where reply and session state live so app servers stay stateless and can scale out
  • reconnecting to a different server and resuming from the last acknowledged frame
  • deploys on Kubernetes: handling SIGTERM, draining or handing off open sockets, and choosing the termination grace period without losing what a reconnect needs
Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing