A voice AI agent is an AI that talks on the phone for someone: it calls a restaurant to book a table, or a support line to ask for a refund, and handles the conversation on its own.
This article covers what such an agent is made of, why response time decides whether a call feels natural, and the order we recommend building it in.
What can a voice AI agent do?
It can finish tasks that only have a phone number, not an API. Plenty of businesses still take bookings and requests by phone only, so an agent that can call them reaches services that no integration covers:
- Booking a table at a restaurant
- Asking a support line for a refund
- Changing a phone plan
- Confirming a doctor's appointment
How does an AI hold a phone conversation?
Most voice agents chain four parts, one after another:
- Telephony: places and receives real phone calls.
- Speech-to-text (STT): turns what the other person says into text.
- LLM: reads that text and decides what to say or do next.
- Text-to-speech (TTS): turns the reply into a natural voice.

When the restaurant says "We only have 8 pm," STT transcribes it, the LLM decides how to answer, and TTS speaks the answer. The loop repeats until the booking is done.
This is called a pipeline (or cascaded) design. You can pick each part separately, and because every turn passes through text, you can log and inspect what the model decided.
How fast does a voice agent need to respond?
Fast enough that the other person never wonders whether the line dropped. People expect a reply within about a second of finishing a sentence, and in that time the agent has to detect the end of the turn, transcribe, generate a reply, and start speaking.
The LLM's time to first token (how long before the first word of the reply comes back) is usually the largest part you control. Two habits keep it short:
- Stream the reply. Start TTS on the first sentence instead of waiting for the whole answer.
- Turn off reasoning for conversational turns. Reasoning models write out their thinking before answering, which adds delay. On DeepSeek V4.1 Flash you can switch it off per request; see Reasoning.
Measure the whole turn, from the end of the caller's speech to the first audio out, on your own network. Model benchmarks alone won't tell you how a call feels.
Which tools should you use?
Open-source frameworks handle the hard real-time parts, such as audio streaming, turn detection and interruptions, so you can focus on the agent's logic:
- Frameworks: Pipecat, LiveKit Agents
- Telephony: a SIP trunk or a phone provider such as Twilio
- STT and TTS: any provider your framework supports; test it with the accents and the call audio quality your users actually have
- LLM: any OpenAI-compatible endpoint, including Mango Inference
Before you go live, check where each provider processes call audio and transcripts. A phone call carries names, phone numbers and sometimes payment details.
How do you build one step by step?
Start without a phone line and add one layer at a time:
- A text agent first. Build an agent that understands the request and calls tools: search restaurants, check availability, confirm the booking. See Tool calling.
- Then voice in the browser. Put STT and TTS in front of the same agent and talk to it through your microphone. This is where you tune latency.
- Then a real phone number. Connect telephony last. Real calls bring background noise, hold music and people talking over the agent, so test those separately.
How do you stop the agent from acting on its own?
Give it a clear boundary for actions that matter. If the user asked for 7 pm and the restaurant offers 8 pm, the agent should check with the user before it books 8 pm.
- Changing a booking, paying, or sharing personal details should only happen within limits the user set in advance.
- Have the agent say up front that it is an AI calling on someone's behalf.
Can you use Mango Inference with code you already have?
Yes. Mango Inference exposes an OpenAI-compatible API, so with the OpenAI SDK you change the base URL and the API key. Check model-specific features such as tool calling before you switch.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.mangoboost.io/v1",
api_key=os.environ["MANGOINFERENCE_API_KEY"],
)
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V4.1-Flash-1017",
messages=[{"role": "user", "content": "Can I book a table for four at 7 pm tomorrow?"}],
extra_body={"chat_template_kwargs": {"enable_thinking": False}}, # no reasoning, faster first token
)
print(response.choices[0].message.content)To get an API key and make your first request, follow the Quickstart.
Building a voice agent for your business?
If you are planning a voice agent or another AI service and want to talk through models, latency or deployment options for your workload, contact us. Our team will get back to you.












