Building and Evaluating Production Voice Agents: From Custom Infrastructure to Platform Solutions

nomore_engineering · Healthcare · 2023 · source Agentic: yes · promotional bias: low · summary-only (no fetched source) · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Healthcare appointment voice agents

The team wanted a production phone agent for Polish primary-care appointment scheduling, where patients could not reliably reach receptionists and a real-time voice workflow had to handle medical scheduling safely and naturally.

Constraints:

Architecture

The team first built a custom voice-agent stack with speech-to-text, an LLM, text-to-speech, conversation orchestration, and testing. After comparing custom infrastructure with platforms such as Vapi.ai, Bland.ai, and Retell.ai, they chose a platform approach because maintaining the full voice stack was too complex.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  patient-caller[Patient Caller] --> voice-agent[Voice Agent]
  voice-agent --> speech-to-text[Speech To Text]
  speech-to-text --> conversation-orchestrator[Conversation Orchestrator]
  conversation-orchestrator --> llm[LLM]
  conversation-orchestrator --> text-to-speech[Text To Speech]
  text-to-speech --> voice-agent[Voice Agent]
  conversation-orchestrator --> testing-harness[Testing Harness]
  voice-platform[Voice Platform] --> voice-agent[Voice Agent]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Patient Caller Calls to schedule or manage a doctor appointment. Voice Agent
Voice Agent Orchestrates the appointment conversation over the phone. Speech To Text, Conversation Orchestrator, Text To Speech
Speech To Text Transcribes patient speech for the LLM workflow. Voice Agent, Conversation Orchestrator
Conversation Orchestrator Manages dialogue flow, LLM calls, and appointment logic. Speech To Text, LLM, Text To Speech, Testing Harness
LLM Generates responses and follows scheduling instructions. Conversation Orchestrator
Text To Speech Turns generated responses back into spoken audio. Conversation Orchestrator, Voice Agent
Testing Harness Compares platforms and custom stack behavior across latency, quality, and availability. Conversation Orchestrator
Voice Platform Third-party platform such as Vapi.ai selected to reduce operational burden. Voice Agent

Data flow

A patient phone call is transcribed by speech-to-text, passed through LLM-driven conversation orchestration, converted back to speech through text-to-speech, and tested for latency, naturalness, script adherence, availability, and language support.

“They implemented a complex system involving speech-to-text, LLMs, text-to-speech, and conversation orchestration”summary, stated
“They compared these solutions across several critical metrics: • Conversation flow naturalness • Response latency”summary, stated

Why this architecture

The team built the full custom stack to understand the architecture and test requirements, then moved to a platform because operating STT, LLM, TTS, orchestration, latency, and availability together was too costly for the use case.

“After building the complete system, they ultimately decided to use a third-party platform (Vapi.ai) due to the complexities of maintaining their own infrastructure”summary, stated
“offering insights into both approaches. The team initially identified a critical problem in Polish primary care”summary, stated

Models used: LLMs · Vapi.ai · Bland.ai · Retell.ai

Scale

Alternatives considered (roads not taken)

Maintain a custom STT/LLM/TTS/orchestration stack.

Rejected because: The team found the maintenance complexity too high after building the complete system.

“decided to use a third-party platform (Vapi.ai) due to the complexities of maintaining their own infrastructure”summary, stated

Use Bland.ai's self-hosted platform.

Rejected because: The summary says it had better latency and availability but less flexibility in agent logic and evaluation.

“Bland.ai's self-hosted approach achieved better latency (1.5s vs 2.5s+) and availability but sacrificed flexibility in agent logic and evaluation capabilities.”summary, stated

Use Vapi.ai or Retell.ai style platforms.

Rejected because: These provided more LLM control but had latency and availability challenges according to the summary.

“Vapi.ai and Retell.ai offered more control over the LLM component but faced challenges with latency and availability”summary, stated

Patterns

tool-use-orchestration (voice workflow)

The agent orchestrates speech-to-text, LLM reasoning, text-to-speech, and appointment-flow logic.

“speech-to-text, LLMs, text-to-speech, and conversation orchestration”summary, stated

eval-driven-development (testing)

The team compared custom and platform solutions using latency, naturalness, script adherence, availability, and language support.

“They compared these solutions across several critical metrics: • Conversation flow naturalness • Response latency”summary, stated

latency-optimization (real-time systems)

Voice-agent platform evaluation centered partly on sub-2-second response latency.

“Response latency (targeting sub-2-second responses)”summary, stated

fallback-degradation (build-vs-buy)

The team fell back from custom infrastructure to a platform solution when maintenance complexity outweighed benefits.

“eventual pragmatic decision to use a platform solution, offering insights into both approaches.”summary, stated

Tradeoffs

Infrastructure ownership

Chose Vapi.ai platform over Maintaining a custom voice-agent stack.

Rationale: The platform reduced the complexity of operating the full speech/LLM/orchestration stack.

“ultimately decided to use a third-party platform (Vapi.ai) due to the complexities of maintaining their own infrastructure”summary, stated

Latency versus flexibility

Chose More LLM control where needed over Only optimizing for the fastest self-hosted latency.

Rationale: The platform comparison exposed that faster latency could come with less control over agent logic and evaluation.

“achieved better latency (1.5s vs 2.5s+) and availability but sacrificed flexibility in agent logic and evaluation capabilities.”summary, stated

Gotchas (what bit them)

Custom voice stacks have high operational surface area.

Root cause: Production voice agents combine STT, LLM, TTS, orchestration, latency, availability, and testing concerns.

Resolution: Adopt a third-party platform after learning from the custom build.

“due to the complexities of maintaining their own infrastructure”summary, stated

Latency and control trade against each other across voice platforms.

Root cause: Self-hosted approaches can reduce latency but limit agent-logic flexibility, while flexible LLM platforms may add latency.

Resolution: Compare platforms across latency, availability, language quality, script adherence, and evaluation support.

“Bland.ai's self-hosted approach achieved better latency (1.5s vs 2.5s+) and availability but sacrificed flexibility”summary, stated

Healthcare appointment voice agents require stronger testing than demos.

Root cause: They operate in real-time patient scheduling contexts with language and script-adherence requirements.

Resolution: Use comprehensive testing approaches and platform comparisons before production deployment.

“conversation orchestration, along with comprehensive testing approaches.”summary, stated

Evaluation

The team evaluated custom and third-party voice-agent approaches across conversation naturalness, latency, agent quality, script adherence, availability, and language support.

Metrics: Conversation flow naturalness · Response latency · Script adherence · Platform availability · Language support quality

“They compared these solutions across several critical metrics: • Conversation flow naturalness • Response latency”summary, stated

Outcomes

The summary reports sub-2-second latency targets and platform comparison figures of about 1.5 seconds versus 2.5 seconds or more.

“After building the complete system, they ultimately decided to use a third-party platform (Vapi.ai)”summary, stated