Skip to content
MangoBoost

How to Build a Voice AI Agent That Makes Phone Calls

How to Build a Voice AI Agent That Makes Phone Calls

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.
Voice AI agent pipeline: the restaurant's speech goes over telephony to STT, the LLM decides the reply, and TTS speaks it back over the phone line.
Figure 1. The pipeline a voice agent runs on every turn of the call

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.

python
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.

Related Posts

Why Agentic AI Breaks Classic Inference Infrastructure
Technical Insights

Why Agentic AI Breaks Classic Inference Infrastructure

Learn more
MangoBoost Launches Mango Inference, Emerging as a Key Partner Powering AMD's Enterprise AI Ecosystem
Technical Insights

MangoBoost Launches Mango Inference, Emerging as a Key Partner Powering AMD's Enterprise AI Ecosystem

Learn more
The First AMD Instinct™ Submission to MLPerf® Inference with Prefill/Decode-Disaggregated Deployment, and the Largest Multi-Region Cluster Ever Submitted
Benchmark Results

The First AMD Instinct™ Submission to MLPerf® Inference with Prefill/Decode-Disaggregated Deployment, and the Largest Multi-Region Cluster Ever Submitted

Learn more
First-ever Multi-region Heterogeneous Inference: MangoBoost Sets New Standards for Global AI Scaling in MLPerf Inference v6.0
Benchmark Results

First-ever Multi-region Heterogeneous Inference: MangoBoost Sets New Standards for Global AI Scaling in MLPerf Inference v6.0

Learn more
MangoBoost Pushes AI Scalability in MLPerf Training v5.1: First-ever Multi-node MI325X Results Highlight AMD's Scaling Capabilities
Benchmark Results

MangoBoost Pushes AI Scalability in MLPerf Training v5.1: First-ever Multi-node MI325X Results Highlight AMD's Scaling Capabilities

Learn more
Pioneering Multi-node Heterogeneous Inference: MangoBoost and AMD, in Collaboration with OEM Partners, Set Record Llama2-70B Performance in MLPerf Inference v5.1
Benchmark Results

Pioneering Multi-node Heterogeneous Inference: MangoBoost and AMD, in Collaboration with OEM Partners, Set Record Llama2-70B Performance in MLPerf Inference v5.1

Learn more
MangoBoost Demonstrates Record-Breaking Performance in AI Training Storage Solution with MLPerf® Storage v2.0
Benchmark Results

MangoBoost Demonstrates Record-Breaking Performance in AI Training Storage Solution with MLPerf® Storage v2.0

Learn more
MangoBoost Sets a New MLPerf Training v5.0 Standard for Multi-nodes Llama2-70B-LoRA on AMD Instinct™ MI300X GPU!
Benchmark Results

MangoBoost Sets a New MLPerf Training v5.0 Standard for Multi-nodes Llama2-70B-LoRA on AMD Instinct™ MI300X GPU!

Learn more
MangoBoost Sets The Highest MLPerf Inference v5.0 Result in History for Llama2-70B Offline!
Benchmark Results

MangoBoost Sets The Highest MLPerf Inference v5.0 Result in History for Llama2-70B Offline!

Learn more
MangoBoost Demonstrates Mango GPUBoost RDMA™ with MLPerf Training v4.1 on a Multi-node System Powered by AMD MI300X GPUs
Benchmark Results

MangoBoost Demonstrates Mango GPUBoost RDMA™ with MLPerf Training v4.1 on a Multi-node System Powered by AMD MI300X GPUs

Learn more
MangoBoost Demonstrates Turn-Key Storage Solution for AI Training with MLPerf® Storage v1.0
Benchmark Results

MangoBoost Demonstrates Turn-Key Storage Solution for AI Training with MLPerf® Storage v1.0

Learn more
MangoBoost Demonstrates a Turn-Key LLM Inference Serving Solution on AMD Instinct™ MI300X GPUs with the MLPerf® Inference v4.1 Llama Benchmark
Benchmark Results

MangoBoost Demonstrates a Turn-Key LLM Inference Serving Solution on AMD Instinct™ MI300X GPUs with the MLPerf® Inference v4.1 Llama Benchmark

Learn more