How I Built an AI Phone Agent That Actually Works
What if your business never missed a customer call? Not a chatbot. Not "press 1 for sales." An actual AI agent that picks up the phone, understands the caller, verifies their identity, takes their order, and routes it — all in natural German conversation. That's what I built. Here's how.
The Architecture
The system is a pipeline of specialized components, each doing one thing well:
- 3CX PBX handles the phone line — receives the call, manages the SIP connection
- LiveKit manages the real-time audio stream — WebRTC for ultra-low latency
- Python agent processes the speech, runs the LLM, generates responses
- Azure VM (Linux) hosts the whole thing
The caller dials a normal phone number. 3CX picks up and routes the audio to LiveKit. The Python agent listens, thinks, and responds — all in real-time. The caller doesn't know they're talking to an AI (at least not immediately).
The Smart Parts: Fuzzy Customer Verification
When someone calls, they often say something like "Hi, this is Palfinger from Salzburg." The system needs to match that against a customer database. People don't say their exact company name, though — they abbreviate, use nicknames, mumble.
That's why I built a confidence-based fuzzy matching system with three thresholds:
- 86%+ match — Auto-verified. The system is confident enough to proceed.
- 72-85% match — Ask for clarification. "Did you mean Palfinger GmbH in Salzburg?"
- Below 50% — Can't verify. Route to a human.
These thresholds are configurable per deployment — some clients want stricter matching, some are fine with looser bounds.
The Dashboard
You can't deploy a phone agent and hope for the best. You need visibility. That's why I built a full web dashboard with:
- Real-time KPIs — calls today, verification rate, average call duration, fuzzy decisions
- Complete call log — every call with full transcript, timestamps, and verification results
- Configuration panel — edit the system prompt, welcome message, and fuzzy thresholds without touching code
Azure Blob Storage holds everything. Before every call, the agent pulls the latest config — changes in the dashboard take effect immediately, no redeploy needed.
The Hard Part: Latency
Voice AI lives or dies on latency. The difference between "natural conversation" and "awkward AI pause" is literally milliseconds:
- Speech-to-text needs to be fast and accurate
- LLM inference takes time, especially for complex responses
- Text-to-speech needs to sound natural, not robotic
- Every step has to land in under 500ms or the conversation feels broken
LiveKit's WebRTC pipeline is the hero here. It keeps the audio stream real-time while the agent processes in parallel. I also stream responses — the agent starts speaking before the full answer exists, the way a human starts a sentence before knowing exactly how it ends.
The German Language Challenge
Most voice AI demos are in English. German is harder:
- Compound words — "Arbeitszeiterfassungsgesetz" is one word. Good luck with speech-to-text.
- Formal vs. informal — the agent needs to use "Sie" (formal) in business contexts
- Dialects — Austrian German is different from standard German. "Servus" vs. "Hallo."
Getting the LLM to respond in natural, formal German without sounding robotic took a lot of prompt iteration. I use Claude for coding and the core conversation logic, Gemini for research and product testing, and Copilot for anything Microsoft/Azure-related — debugging Azure deployments, configuring services, understanding platform-specific behavior. Each tool has its lane.
Azure Infrastructure
The deployment uses several Azure services, each chosen for a reason:
- Key Vault — secrets management (API keys, database credentials)
- Blob Storage — config files, call transcripts, audio recordings
- Web Apps — the dashboard (always-on, fast, scales automatically)
- Linux VM — the agent runtime (needs more control, GPU-adjacent compute)
Where It Stands
The agent handles real calls in production. The known edge cases — heavy dialect, fast speakers — are tracked, measured, and fed back into prompt iteration and matching refinement. That feedback loop is intentional. Every call makes the system sharper.
Our clients don't miss calls anymore. The product does what it's supposed to do, it runs in production, and it's getting better with every interaction. That's not luck — that's the system working as designed.
— Elias
Wie ich einen KI-Telefonagenten gebaut habe, der wirklich funktioniert
Was, wenn dein Unternehmen nie wieder einen Kundenanruf verpasst? Kein Chatbot. Kein „Drücken Sie die 1 für Vertrieb“. Ein echter KI-Agent, der das Telefon abnimmt, den Anrufer versteht, seine Identität prüft, die Bestellung aufnimmt und sie weiterleitet — alles in natürlichem deutschen Gespräch. Das habe ich gebaut. So geht es.
Die Architektur
Das System ist eine Pipeline aus spezialisierten Komponenten, jede macht eine Sache gut:
- 3CX PBX übernimmt die Leitung — nimmt den Anruf an, verwaltet die SIP-Verbindung
- LiveKit steuert den Echtzeit-Audiostream — WebRTC für ultraniedrige Latenz
- Python-Agent verarbeitet die Sprache, führt das LLM aus, erzeugt Antworten
- Azure VM (Linux) hostet das Ganze
Der Anrufer wählt eine normale Nummer. 3CX nimmt ab und leitet das Audio an LiveKit. Der Python-Agent hört zu, denkt, antwortet — alles in Echtzeit. Der Anrufer merkt nicht, dass er mit einer KI spricht (zumindest nicht sofort).
Das Smarte: Fuzzy-Kundenverifizierung
Wenn jemand anruft, sagt er oft so etwas wie „Hallo, hier ist Palfinger aus Salzburg“. Das System muss das gegen eine Kundendatenbank matchen. Aber Leute sagen ihren Firmennamen nicht exakt — sie kürzen ab, nutzen Spitznamen, nuscheln.
Deshalb habe ich ein konfidenzbasiertes Fuzzy-Matching mit drei Schwellen gebaut:
- 86 % oder mehr — Auto-verifiziert. Das System ist sicher genug, um fortzufahren.
- 72–85 % — Nachfragen. „Meinen Sie Palfinger GmbH in Salzburg?“
- Unter 50 % — Kann nicht verifiziert werden. An einen Menschen weiterleiten.
Die Schwellen sind pro Deployment konfigurierbar — manche Kunden wollen strenger matchen, andere sind mit längerer Leine zufrieden.
Das Dashboard
Einen Telefonagenten zu deployen und auf das Beste zu hoffen ist keine Option. Du brauchst Sicht. Deshalb habe ich ein komplettes Web-Dashboard gebaut:
- Echtzeit-KPIs — Anrufe heute, Verifizierungsrate, durchschnittliche Gesprächsdauer, Fuzzy-Entscheidungen
- Kompletter Anruf-Log — jedes Gespräch mit vollem Transkript, Zeitstempeln und Verifizierungsergebnis
- Konfigurationspanel — System-Prompt, Begrüßung und Fuzzy-Schwellen ändern, ohne Code anzufassen
Azure Blob Storage hält alles. Vor jedem Anruf zieht der Agent die neueste Konfiguration — Änderungen im Dashboard greifen sofort, kein Redeploy nötig.
Der harte Teil: Latenz
Voice-KI steht und fällt mit Latenz. Der Unterschied zwischen „natürlichem Gespräch“ und „peinlicher KI-Pause“ sind wortwörtlich Millisekunden:
- Speech-to-Text muss schnell und präzise sein
- LLM-Inferenz braucht Zeit, besonders bei komplexen Antworten
- Text-to-Speech muss natürlich klingen, nicht robotisch
- Jeder Schritt muss in unter 500 ms landen, sonst wirkt das Gespräch kaputt
LiveKits WebRTC-Pipeline ist hier der Held. Sie hält den Audiostream in Echtzeit, während der Agent parallel arbeitet. Ich streame auch die Antworten — der Agent beginnt zu sprechen, bevor die ganze Antwort fertig ist, so wie ein Mensch einen Satz anfängt, bevor er genau weiß, wie er ihn beendet.
Die Deutsch-Herausforderung
Die meisten Voice-KI-Demos laufen auf Englisch. Deutsch ist schwerer:
- Komposita — „Arbeitszeiterfassungsgesetz“ ist ein Wort. Viel Spaß mit Speech-to-Text.
- Sie vs. Du — im Business-Kontext muss der Agent siezen
- Dialekte — österreichisches Deutsch ist nicht Standard-Deutsch. „Servus“ statt „Hallo“.
Das LLM dazu zu bringen, natürliches, formelles Deutsch zu sprechen, ohne robotisch zu klingen, hat viel Prompt-Iteration gekostet. Ich nutze Claude für Code und die Kernlogik des Gesprächs, Gemini für Recherche und Produkttests, Copilot für alles rund um Microsoft/Azure — Azure-Deployments debuggen, Services konfigurieren, Plattform-Verhalten nachvollziehen. Jedes Tool hat seine Spur.
Azure-Infrastruktur
Das Deployment nutzt mehrere Azure-Services, jeder aus einem Grund gewählt:
- Key Vault — Secrets-Verwaltung (API-Keys, Datenbank-Zugangsdaten)
- Blob Storage — Config-Dateien, Anruf-Transkripte, Audio-Aufnahmen
- Web Apps — das Dashboard (always-on, schnell, skaliert automatisch)
- Linux VM — die Agent-Runtime (braucht mehr Kontrolle, GPU-nahe Compute)
Wo es steht
Der Agent nimmt echte Anrufe in Produktion entgegen. Die bekannten Randfälle — starker Dialekt, schnelle Sprecher — werden getrackt, gemessen und fließen in Prompt-Iteration und Matching-Feinschliff zurück. Diese Rückkopplung ist gewollt. Jeder Anruf macht das System schärfer.
Unsere Kunden verpassen keine Anrufe mehr. Das Produkt tut, was es soll, läuft in Produktion und wird mit jeder Interaktion besser. Das ist kein Glück — das ist das System, wie es entworfen wurde.
— Elias