Architecture and models
How do you preserve a voice-agent session after a connection drops?
Distinguish transport reconnection from recovery of business state. Where the provider supports a resume mechanism, use it for conversational continuity while keeping authoritative action state outside the audio session.
Use the documented lifetime rules
Handle notices and resume identifiers only for the model and transport that document them. Do not assume a fresh connection always inherits the previous conversation.
Save a narrow checkpoint
Persist only the minimal stable conversation state, such as intended task, confirmation stage and whether a request completed. Avoid storing long audio or credentials merely to resume.
Test the mid-action boundary
Disconnect before and after receipt of a completion record. On reconnect, reload the result from the source of truth instead of re-performing a possibly completed action.
Sources and scope
Sources checked: .
- Google: Live API session management
Explains connection lifetime, resumption, notices and context window management.
- OpenAI: Realtime API overview
Introduces the Realtime API, bidirectional transports and media/application responsibilities.