I’ve built multiple Voice AI systems, and the answer to your question really depends on what technical constraints you have, though I can try to point you to some common techniques
Latency
Latency in Voice AI systems is less about the speed of the underlying agentic process than about how quickly the person you’re speaking with receives an acknowledgment. If you’re building a one-shot agent, you can stream tokens to your preferred TTS and send partial audio chunks. Now, of course, your agent is unlikely to be one-shot; fortunately, other techniques can help here too.
If you have to wait for an underlying agentic process to complete, you can use “filler phrases” to significantly reduce the perceived latency of your Voice AI. While it sounds very simplistic on the surface, it genuinely has a massive impact on the user experience, and you can take advantage of many different approaches to make those filler phrases relevant.
For example: transcript → classifier → filler phrase selection
Suppose you’re building a drive-thru, and the customer asks whether an item is in stock. Clearly, the voice agent doesn’t know the answer itself, so it has to use a tool call to check the current menu state. You would have a menu_question classification that can reply with multiple different phrases, such as:
Let me check that for you
I'll check, one moment
That will buy you some time while the rest of the agent process is happening, though if that process is long-lived or responds with a structured response that you need to parse, there are now tools for reading partial JSON/YAML/etc so once the relevant field you need to read is present, you can start reading that response rather than having to wait for the entire structured response. PyndaticAI for example has some functions for this.
Speech Quality
This is highly subjective and depends on the target audience, not just what sounds “good” to your or my ears, as well as the speech requirements. For example, some people test what they’re speaking to by having the agent repeat what it just said and listening to see whether it sounds identical. If the response sounds identical, they’ll know they’re speaking to a bot and either leave the interaction or request a human.
Cost-Effective Scaling
This is again a difficult question to answer, as multiple factors drive the cost of your voice agent.
- LLM Token costs
- ASR audio time cost
- TTS chunk time cost
You can reduce this with clever caching, so you don’t always have to recompute responses in real time, though that is not always possible. So, reducing your cost will require multiple steps, depending on where you are in your application’s life cycle.
- Fine-tuning smaller LLMs
- Prompt engineering to optimize token usage
- Branching agentic logic
- Using the drive-thru example, an intent classifier to send requests to specialist agents
In my experience, one major component people often overlook in this process is: “Who is this voice agent interacting with that drives the most value?” Starbucks is a great example; their agent doesn’t interact directly with the customer, but with the barista. It helps them remember recipes, customer preferences, and inputs the order for the barista into the point-of-sale. This cycle creates a low-cost system that still meets key KPIs by speeding up order taking and improving order accuracy.
Orchestration Frameworks
The majority of tools like PipeCat provide relatively robust orchestration, though you’ll be responsible for exposing that orchestration to whoever needs to have control over it. These platforms do come with the cost of living in their ecosystem and paradigms. They also expose your Voice AI to the risk that these platforms fail and become unsupported, requiring a ground-up rebuild.
I make my choice based on the engineering, capital, and time resources available to me. If it’s a personal project, I will tend to lean on PipeCat. If it’s for an enterprise-scale system, I almost always go with a custom-built platform, because I want to own the control plane and not rely on a third party to make design decisions for my team or me.
Websocket versus WebRTC
Does every chunk of audio matter? If so, then websockets are likely your best option since they enforce ordered responses from the TTS. If losing audio is acceptable, then WebRTC is a great choice, as it ensures that the Voice AI’s response state is not significantly behind the current conversational state.
The Challenging Parts
Honestly, all of the above breaks down to design decisions; you will regret some, and you won’t regret others. Fortunately, that’s the beauty of code; we can always rescaffold something if it was a mistake.
The real challenge is understanding how your Voice AI impacts your KPIs. This requires a comprehensive understanding of the domain you’re working in, as well as realizing that high-level KPI’s are no longer as powerful as they used to be. Again, using the drive-thru example, the accuracy KPI isn’t really a single metric, as it is made up of multiple smaller ones. Specifically, the cases of modification, removal, and addition accuracy.
I hope this was helpful.