Book a free call

How to Build an AI Voice Agent That Works

An AI voice agent answers calls, books appointments and routes hard cases to people. Here is how to build one that works, from speech recognition to live testing.

Hertiv engineering teamReviewed by a senior engineer
7 min read
How to Build an AI Voice Agent That Works
On this page

Short answer

To build an AI voice agent, connect speech recognition, a language model grounded in your own knowledge, and text-to-speech, then add call controls, handoff rules and logging. Start with one narrow task, test it on real calls, and keep a person in reach for anything the agent cannot answer safely.

What is an AI voice agent?

An AI voice agent is software that holds a spoken conversation with a caller: it listens, works out what the caller wants, gives an answer or takes an action, and hands off to a person when the request is beyond it. It works over phone calls, voice apps and smart speakers.

Unlike a phone menu, a voice agent understands free speech, so callers can say what they need in their own words instead of pressing numbers. Unlike a human agent, it can answer many calls at once and never gets tired, which is why teams use it for routine calls such as bookings, status checks and password resets.

The key difference from a chatbot is the voice channel. Speech is messier than text: callers interrupt, talk over the agent, use slang and call from noisy places. A voice agent has to handle all of that in real time, with pauses short enough to feel natural.

Most voice agents today are built from hosted services rather than from scratch. The work is in connecting the parts, grounding answers in your own knowledge, and designing the conversation, not in training a model. See what an AI voice agent is for the basics before you start building.

What are the parts of a voice agent?

A voice agent has six parts, and each one can be bought as a service: speech recognition, a language model, knowledge retrieval, voice synthesis, call controls and logging. The build is mostly wiring them together well.

Part What it does Typical choice
Speech recognition Turns the caller's voice into text A streaming speech-to-text service
Language model Decides what the caller wants and what to say A hosted large language model
Knowledge retrieval Finds facts in your own docs and systems Search over help pages and records
Voice synthesis Turns the answer back into speech A streaming text-to-speech voice
Call controls Handles hold, transfer and hang-up Your telephony provider
Logging and review Records calls, transcripts and handoffs A call log with search

Latency is the part teams underestimate. Each step adds delay: recognition, model thinking, retrieval and speech synthesis. If the total pause is longer than about a second, callers start talking over the agent or hang up, so pick streaming services and keep retrieval fast.

Grounding matters as much as speed. The model must answer from your own documents and systems, not from what it remembers, or it will invent opening hours, prices and policies. Retrieval over your own content is what keeps answers accurate.

How do you design the conversation?

You design the conversation by writing down the one task first, then the exact words the agent should use at each step, including what it says when it does not understand. A script on paper is the design; the model follows it.

Start with the greeting and the question that sorts callers: what are you calling about? From there, map the short paths: booking, rescheduling, checking status, and the handoff to a person. Each path should be short, with one question at a time, because callers forget a list of three questions.

Write the failure lines with the same care as the happy path. When the agent cannot hear the caller, it should say so and ask them to repeat, not guess. When it cannot answer, it should offer the handoff, not invent an answer.

Keep sentences short and spoken, not written. A sentence that reads well on a page can sound long and stiff when spoken, so read every line out loud before you ship it.

How to build it: six steps

Build a voice agent in six steps, testing each one on real calls before moving to the next. The order matters: conversation design comes before tooling, and testing comes before launch.

  1. Pick one task. Choose a narrow, high-volume task such as booking an appointment or checking an order, and write down its exact steps.
  2. Prepare the knowledge. Gather the help pages, policies and records the agent will answer from, and remove outdated or duplicate versions.
  3. Connect the parts. Wire speech recognition, the language model, retrieval and text-to-speech through your telephony provider, and keep the whole chain streaming.
  4. Write the conversation. Script the greeting, the questions, the confirmations and the handoff lines, and test them by reading them out loud.
  5. Add guardrails. Limit what the agent can do, require confirmation before any change, and set the handoff rules for anything sensitive.
  6. Test on real calls. Run the agent on a small share of real calls, listen to the recordings, and fix the failures before widening it.

Real examples help at this stage: AI voice agent examples shows how teams in healthcare, travel and retail have scoped their first agent.

For the build itself, AI voice agent development covers the integration and guardrail patterns.

Example (hypothetical): a clinic booking agent

Example (hypothetical): a clinic receives 200 booking calls a day. Staff spend about 4 minutes on each call, which is 800 minutes, or about 13 hours and 20 minutes of phone time a day.

The clinic builds a voice agent for one task only: booking and rescheduling appointments. In its first month the agent handles 140 of the 200 daily calls, and each of those calls takes about 3 minutes of agent time instead of 4 minutes of staff time.

The saving is easy to check. Staff now handle 60 calls a day at 4 minutes each, which is 240 minutes, or 4 hours. The agent handles the other 140, so staff save about 9 hours and 20 minutes a day, and they spend it on the calls that need a person: new patients, complex cases and complaints.

The clinic keeps a rule: any caller who says they are in pain, or who asks twice for a person, is handed off at once. The handoff rate is about 30% of the agent's calls, and the team reviews those recordings each week to find where the agent should improve.

How do you test a voice agent before launch?

You test a voice agent by listening to it handle real calls, not by reading transcripts in a document. Voice is a spoken medium, so the test has to include accents, noise, interruptions and callers who change their minds mid-sentence.

Build a test set of real calls: record volunteers making the same requests in different words, from a quiet room and from a noisy street, and include callers who interrupt and callers who give the wrong date first. Run the agent against those calls and score whether it reached the right outcome, not whether the words were perfect.

Measure three things: task completion, handoff rate and caller complaints. If completion is high but handoff is also high, the agent is giving up too early. If completion is low, the conversation design is wrong, not the model.

Launch to a small share of calls first, such as 10%, and listen to every recording for the first week. Fix the top three failure types before widening to more calls.

What are the common mistakes?

The most common voice agent mistakes are starting too broad, skipping the handoff, and trusting the model to know facts it was never given.

  • Starting with every task. An agent that tries to do everything does none of them well; start with one narrow task.
  • No handoff rule. If callers cannot reach a person, they hang up and call a competitor.
  • Ungrounded answers. A model without access to your own documents will invent prices, hours and policies.
  • Long pauses. Slow retrieval or non-streaming speech makes callers talk over the agent.
  • Written-style scripts. Long sentences sound stiff when spoken; read every line out loud.
  • No call review. If nobody listens to recordings, the same failures repeat for months.
  • Skipping confirmation. Booking or changing something without reading it back leads to wrong appointments.

Fix the top failure first. A voice agent improves fastest when one person owns the call recordings and the failure list, and the team fixes the top three issues each week.

Key takeaways

  • A voice agent listens, understands, answers from your own knowledge, and hands off when stuck
  • Six parts: speech recognition, language model, retrieval, voice synthesis, call controls and logging
  • Start with one narrow task and a written conversation, including the failure lines
  • Ground every factual answer in your own documents, or the agent will invent them
  • Test on real calls with noise and interruptions, and listen to the recordings
  • A clear handoff rule matters more than a clever model

Frequently asked questions

How much does it cost to build an AI voice agent?

Cost depends on call volume, the number of tasks and how much integration your systems need. Hosted speech, language and voice services usually charge per minute or per call, so check the vendor's own pricing pages; see vendor site for current rates. A single-task agent is far cheaper than a broad one.

How long does it take to build a voice agent?

A single-task agent with clean knowledge can take a few weeks to reach a small live test, when the telephony and systems are already in place. Widening it to more tasks takes longer, because each new task needs its own conversation design, test calls and review.

Do callers prefer a voice agent or a person?

It depends on the task. Callers are usually happy with an agent for simple tasks such as booking or checking status, when it is fast and accurate. They want a person for anything sensitive, complex or emotional, which is why the handoff rule matters more than the agent's voice.

What happens when the voice agent does not understand?

It should say so plainly, ask the caller to repeat, and after two failed attempts offer a handoff to a person. Guessing is the worst option, because a wrong booking or a wrong answer costs more than a transfer. Log every failed attempt so the team can fix the cause.

Can a voice agent take payments over the phone?

It can, but only with care. Payment details should go through a compliant payment flow, never through the conversation transcript, and the agent should confirm the amount before charging. Many teams keep payments with a person or a secure link until the agent's guardrails are proven.

How do you keep a voice agent from inventing answers?

Ground it in your own documents and systems through retrieval, and set a rule: if the answer is not in the retrieved content, the agent says it does not know and offers a handoff. Test factual answers against your own records, and review a sample of calls every week.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building a voice agent for your product or support line? Talk to Hertiv.

A senior engineer replies within one business day. Or see our AI Voice Agents service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call