On a plant floor the natural way to ask a question is to say it, in the language you think in. For the manufacturer we work with that is Tamil, Hindi and English. The query engine itself works in English. Bridging the two without the system feeling like a translator sitting between you and the answer took two attempts.
The first design: three round trips
Our first version was the obvious one. The browser sent audio to a transcription endpoint and got English text back. It sent that text to the existing query stream, unchanged, and English answer tokens streamed in. When the stream ended the browser made two more calls: translate the answer, then synthesise speech. It worked. It also felt wrong.
- The user saw the answer appear in English and then flip to their language. The flash undermined the feeling that the system had understood them.
- Two extra HTTP round trips after the stream ended added seconds at the worst possible moment.
- The translation and speech steps lived in separate traces, so when a voice answer went wrong nobody could find all of its parts in one place.
The second design: fold it into the stream
The query request gained one field: the language the answer should come back in. When it is set, the same streamed response does more work after the answer is ready. It translates, synthesises speech, and emits translated-text and audio events on the connection that is already open. For a voice turn the English tokens are suppressed entirely and the spoken-language answer streams token by token instead. The user watches the answer type out in Tamil.
Why this matters beyond voice
The lesson generalised. Anything that is part of answering a question belongs inside that question's request and trace. The moment a step lives somewhere else, it becomes slower for the user and invisible to the engineer. One connection, one trace, one answer.
