Guide

How to Build a Voice AI Agent (Step by Step)

9 min read · Bolcho

A voice AI agent answers or makes phone calls and holds a natural, back-and-forth conversation - booking appointments, qualifying leads, taking orders - with no human on the line. The hard part was never wiring speech-to-text to an LLM to text-to-speech; platforms do that now. The hard part is everything the guides skip: what to make it say, what a call actually costs, keeping the round-trip under 800ms so it doesn't sound like a robot, and handling real Indian callers who switch between Hindi and English mid-sentence. This guide covers all of it - with a production prompt you can copy, real numbers, and the mistakes that sink most first agents.

What a voice agent is really made of

Every voice agent is the same real-time loop: it hears the caller (speech-to-text), decides what to say (an LLM guided by your prompt and knowledge), speaks back (text-to-speech), and takes actions (tools) - all streamed over a phone line (telephony). The whole loop has to complete in well under a second, every single turn, or the conversation feels broken.

The six building blocks

  • Speech-to-text (STT): turns the caller's audio into text in real time, with endpointing to know when they've stopped.
  • LLM + system prompt: the brain - your instructions define its persona, its single goal, and its hard rules.
  • Text-to-speech (TTS): turns the reply into a natural voice, streamed back the moment the first words are ready.
  • Knowledge base (RAG): grounds answers in your real prices, policies and FAQs so it never invents them.
  • Tools (function calling): let it book slots, send a WhatsApp link, look up an order, or transfer to a human.
  • Telephony: the phone number, SIP/WebRTC transport and turn-taking that connect it to real callers.

Build vs. buy: the honest tradeoff

You can assemble the pipeline yourself with open frameworks (LiveKit, Pipecat) or buy a managed platform. From-scratch gives you total control and the most work - you own latency tuning, failover, telephony compliance and every upgrade. A platform trades some control for weeks of your life back. Most teams that start fully DIY end up on a platform for everything except their core differentiator.

The right call depends on one question: is the voice pipeline your product, or a feature of it? If it's a feature, buy.

Time to a live, production-grade agent
From scratch (LiveKit/Pipecat)
4-8 weeks
Managed platform (generic)
2-4 days
Bolcho
Minutes to first call
Indicative, for a first agent with telephony + Indian-language support.

The part nobody warns you about

Most first builds don't fail on the models - they fail in the orchestration: interruptions, turn-taking, reconnects, telephony codecs and failover. That's 80% of the effort and 0% of your differentiation. It's the first thing a platform should take off your plate.

Build it in five steps

On a managed platform you configure the agent rather than assemble the stack. The five steps below are the whole job - the rest of this guide drills into the ones that decide whether the agent actually works.

  1. 1

    1. Define one goal + write the system prompt

    Pick a single narrow job (book a visit, confirm an order). State the persona, the goal, and the hard rules. This is 80% of quality - see the full prompt below.

  2. 2

    2. Add a knowledge base

    Upload your prices, policies and FAQs (URL, file, or pasted text) so answers are grounded. Put the most-asked facts directly in the prompt - it's faster than a lookup.

  3. 3

    3. Connect tools

    Wire the actions it can take: book_demo, send_whatsapp, lookup_order, transfer_to_human. Define each as a function with a clear schema (example below).

  4. 4

    4. Choose voice + language

    Pick the STT, TTS and voice. For India, choose Indic-tuned models and set the language - including Hinglish handling. Tune pace so it doesn't sound rushed or slow.

  5. 5

    5. Get a number and test

    Attach a phone number (buy one or connect your own via SIP), then test the hard scenarios before you point real traffic at it.

The system prompt that does the work

The prompt is the agent. A vague prompt gives a vague agent; a tight one with a single goal, a clear call flow and hard guardrails gives an agent that behaves on every call. Here is a real, production-shaped prompt for a lead-qualification agent - copy it and fill in the braces.

Notice the structure: Role, Context, How to talk, Call flow, Hard rules, Tools. Keep replies short (it's a phone call), match the caller's language, say numbers as words, and never let it invent a price or go off-script. The 'hard rules' block is what keeps it safe in the real world.

system prompt
# Role
You are Riya, a scheduling assistant for {Business}. You make and take
phone calls. Your one job: understand the caller's need and book a
qualified demo. You are warm, quick, and never robotic.

# Context
- {Business} sells {product}. Typical buyers: {who}.
- Working hours: Mon-Sat, 10am-7pm IST. Only ever book inside these.
- You cannot discuss anything outside {product}. If asked, say so and offer
  to connect a human.

# How to talk
- Keep replies to one or two short sentences. This is a phone call, not an essay.
- Match the caller's language. If they speak Hindi, speak Hindi. If they
  mix Hindi and English, mix only after they do. Never start in Hinglish.
- Say numbers and dates as words ("four thousand five hundred", "next Tuesday").
- One question at a time. Acknowledge ("Got it, thank you") and move on.

# The call flow
1. Greet, confirm you are speaking to the right person, ask if it's a good time.
2. Discovery - ask, one at a time: company size, current process, main problem,
   timeline, budget range, decision-maker.
3. If they qualify (>= {threshold}), offer two demo slots inside working hours.
4. Confirm the slot, say you'll send details on WhatsApp, thank them, end.

# Hard rules (guardrails)
- Never invent prices, features, or availability. If unsure, say you'll check.
- Never take payment or card details on the call.
- If the caller is upset, is the wrong person, or asks for a human - stop
  qualifying, apologise briefly, and hand off.
- If voicemail: leave a 10-second message with a callback number, then end.

# Tools
- book_demo(date, time, name, phone) - only after they agree to a slot.
- end_call() - after a clear goodbye, never mid-question.

Function calling, done right

Tools are how the agent does things instead of just talking. Each tool is a function with a name, a description the model reads to decide when to call it, and a typed schema for its arguments. The two rules that separate a demo from production: confirm before any irreversible action, and never block the conversation while a tool runs.

A real booking tool looks like this:

Confirm before you act

For anything that spends money or can't be undone - booking, cancelling, charging - the agent must read the details back and get a yes before calling the tool. And it should hand off to a human the moment a caller asks, is upset, or hits something outside its scope.

system prompt
{
  "name": "book_demo",
  "description": "Book a demo slot. Call ONLY after the caller has agreed to a specific date and time inside working hours.",
  "parameters": {
    "type": "object",
    "properties": {
      "name":  { "type": "string", "description": "Caller's full name" },
      "phone": { "type": "string", "description": "E.164, e.g. +9198XXXXXXXX" },
      "date":  { "type": "string", "description": "YYYY-MM-DD, Mon-Sat only" },
      "time":  { "type": "string", "description": "HH:MM 24h IST, 10:00-19:00" }
    },
    "required": ["name", "phone", "date", "time"]
  }
}
// The platform calls your webhook with these args, waits for your JSON
// response, and the agent speaks a "let me just confirm that..." filler
// while it waits - so a 400ms booking call never sounds like dead air.

What a voice agent actually costs

This is the number every other guide dodges. A voice minute is the sum of four live services plus infra. Here is a realistic breakdown for a domestic Indian call on an efficient stack (Deepgram STT, a small fast LLM, Azure neural TTS, Plivo telephony). Prices move, so treat these as indicative - but the shape is right: telephony and TTS dominate, the LLM is the cheapest part.

A typical 2-minute call therefore costs roughly 5-6 rupees in raw provider cost. Caching repeated phrases (greetings, confirmations) and a 140-series origination can cut the telephony and TTS lines meaningfully at volume.

Raw cost per minute, by component (indicative, domestic India)
TTS (Azure neural)
~ Rs 0.85
Telephony (Plivo, domestic)
~ Rs 0.80
STT (Deepgram)
~ Rs 0.50
Infra (media/worker)
~ Rs 0.30
LLM (small fast model)
~ Rs 0.20
Azure neural voice. ElevenLabs/premium voices push the TTS line 2-4x higher.
Source: Indicative provider rates, 2026; your mix will vary.

~ Rs 2.65/min

All-in raw cost, Azure voice

~ Rs 5-6

Typical 2-minute call

LLM = 8%

The model is the cheapest part

Latency: the sub-800ms budget

The single biggest reason agents sound robotic is lag. A human expects a reply within about 500-800ms of finishing their sentence. Miss that and callers talk over the agent or hang up. Latency isn't one number - it's a budget you spend across the loop, and streaming every stage is what keeps it in range.

The goal is to start speaking the reply before the LLM has even finished generating it - stream the first sentence to TTS while the rest is still being written.

Where the ~700ms of a turn goes (streaming pipeline)
Endpointing (detect they stopped)
~250 ms
LLM time-to-first-token
~250 ms
TTS time-to-first-audio
~150 ms
Network / telephony
~100 ms
Time from the caller finishing their sentence to the first word of the reply.

The levers that matter

Co-locate the LLM in-region, use a small fast model, cache repeated TTS phrases, and tune endpointing so the agent doesn't wait too long to realise the caller finished. These four together are the difference between 'robotic' and 'is this a person?'.

Making it sound human, not robotic

Low latency gets you in the room; conversation dynamics make it believable. The models are good enough now - what trips callers' 'this is a bot' alarm is the turn-taking.

What separates human from robotic

  • Barge-in: let the caller interrupt, and stop talking instantly when they do.
  • Smart endpointing: don't jump in after a 300ms pause mid-thought, don't sit silent after they clearly finished.
  • Short turns: one or two sentences, never a monologue.
  • Backchannels: a quick 'got it' or 'sure' so the caller knows they were heard.
  • Natural pace and numbers-as-words: 'four thousand five hundred', not 'Rs 4500'.
  • Graceful recovery: if it mishears, it asks to confirm instead of guessing.

Indian languages and Hinglish

This is where generic, US-built stacks fall over - and where most of the India market actually is. Real callers greet in English, switch to Hindi to explain the problem, and drop in English product names. Your STT has to transcribe code-mixed speech, your LLM has to answer in the same register, and your TTS has to pronounce both scripts naturally.

The rule that makes it feel native: match the caller's language, and only start mixing Hindi and English after they do - never lead with Hinglish.

Languages real agents handle

HindiHinglish (code-mixed)Indian EnglishBengaliTamilTeluguMarathiGujaratiKannadaMalayalamPunjabiOdia

Why this is hard for generic stacks

Most STT/TTS trained on US English mangles Indian names, numbers spoken in Hindi, and code-switching. Indic-tuned models (and a voice that sounds local) are the difference between a caller trusting the agent and hanging up in the first ten seconds.

Test it before you dial out

Your first agent will have bugs you can't see from the config screen - they only show up on real calls. Run the hard scenarios yourself, then listen to the first 72 hours of real calls before you scale. Define success numerically before launch, not after.

The scenarios that break first agents

  • The frustrated or rude caller.
  • The off-topic question ('are you a robot?', 'what's the weather?').
  • The silent caller, and the one who interrupts every sentence.
  • The wrong person answering, and the voicemail pickup.
  • The explicit 'connect me to a human' request.
  • The caller who switches from English to Hindi halfway.

Task success

Did it complete the goal? Target before launch.

Containment

Share of calls handled without a human.

WER

Transcription word error rate on YOUR audio.

Stay compliant (India)

Voice agents make real calls to real people, and India has rules. Getting this wrong is a bigger risk than any model bug.

Before you go live

Disclose that the call may be recorded and that it's an automated assistant. Honour DND / TRAI rules for outbound marketing calls and call only within permitted hours. Handle personal data under the DPDP Act - collect only what you need, store it securely, and let a human take over on request.

Launch on Bolcho

Bolcho runs the whole loop for you - managed STT-LLM-TTS, telephony, Indian-language and Hinglish handling, caching and failover - so you configure the agent and go live, usually in minutes. You write the prompt; it handles the 80% nobody warns you about.

Paste the prompt above, add your knowledge and tools, attach a number, and make your first call today.

Minutes

To your first live call

Sub-800ms

Turn-around on the managed pipeline

12+ Indian languages

Including Hinglish code-mixing

Build it on Bolcho

Everything in this guide ships out of the box. Spin up an agent in minutes, free.

Frequently asked questions

What do I need to build a voice AI agent?

A system prompt (the agent's instructions), a knowledge base to ground answers, tools for actions like booking, and a phone number. On Bolcho the STT-LLM-TTS pipeline, telephony and Indian-language handling are managed, so you configure rather than build from scratch.

How much does a voice AI agent cost to run?

Roughly Rs 2.5-3 per minute in raw provider cost on an efficient stack for a domestic Indian call - about Rs 5-6 for a typical 2-minute call. Telephony and TTS are the biggest lines; the LLM is the cheapest. Premium voices (e.g. ElevenLabs) push the TTS cost 2-4x higher. These are indicative; your mix and volume discounts will vary.

How long does it take to build one?

From scratch with open frameworks, 4-8 weeks to a production-grade agent with telephony and Indian-language support. On a managed platform, 2-4 days. On Bolcho, minutes to your first live call because the pipeline, telephony and language handling are already built.

Why do voice agents sound robotic, and how do I fix it?

Almost always latency and turn-taking, not the voice itself. Keep the full round-trip under ~800ms by streaming every stage, using a small fast in-region LLM, and caching repeated phrases. Then add barge-in (let callers interrupt), smart endpointing, short replies, and backchannels.

Can it handle Hindi and Hinglish?

Yes, with Indic-tuned STT/TTS and the right language setting. The key behaviour is to match the caller's language and only mix Hindi and English after they do. Generic US-built stacks struggle with code-switching, Indian names and numbers spoken in Hindi - which is why Indic-tuned models matter for the India market.

Can I use my own LLM?

Usually yes - good platforms let you bring your own model or key (OpenAI, Azure OpenAI, Anthropic, Sarvam, and others) and swap it per agent. The LLM is the cheapest part of a call, so choose on quality and latency, not price.

Do I need to write code?

No. You write a system prompt in plain language, upload knowledge, define tools with a simple schema, and attach a number - all in the dashboard. Code only comes in if you build custom tool webhooks.

How do I connect it to a phone number?

Buy a number on the platform or connect your existing one over SIP. Inbound routes calls to the agent; outbound dials from it. On Bolcho both are managed, including Indian telephony compliance.

Is it legal to run automated calls in India?

Yes, with care: disclose recording and that it's an automated assistant, honour DND/TRAI rules and permitted hours for outbound marketing, and handle personal data under the DPDP Act. Always offer a path to a human.

Related resources