Asia/Karachi
ProjectsSeptember 29, 2025

LangGraph Voice AI Agent — Inbound & Outbound Phone Automation

LangGraph Voice AI Agent — Inbound & Outbound Phone Automation — project by Abdul Qudoos
A voice AI agent that answers and places real phone calls for a service business. It listens in real time, works out who is calling (a customer, a teammate, or an unknown caller), routes the conversation through a LangGraph state machine, takes action in Google Calendar, and follows up by SMS or WhatsApp once the call ends. This was a four-engineer team project. My part: the outbound customer-verification workflow, the teammate delay-notification workflow, graceful call termination with SMS confirmation, call-outcome tracking, and the pre-generated audio fillers that hide slow tool calls from the caller. Appointment-based businesses handle the same calls again and again: customers rescheduling, teammates reporting they are running late, and verification calls before a visit. Each follows a predictable script, but a person still has to look up the calendar, make the change, and send a confirmation. The goal was to let an agent handle these calls end to end and hand off only what it can't handle.
  1. Call in or out: Twilio streams call audio over a WebSocket (Media Streams). Outbound calls are placed by the same service for verification and delay notices.
  2. Listen: voice-activity detection and Deepgram streaming speech-to-text turn audio into transcripts, with interruption handling so callers can talk over the agent.
  3. Identify the caller: the phone number is matched against a phonebook to decide the path: customer, teammate, or potential client.
  4. Route with LangGraph: a StateGraph with conditional edges sends the call to the right node: greeting, customer intent (classified with GPT-4o-mini), teammate intent, outbound customer verification, or potential client.
  5. Act with tools: LangGraph tool calls fetch, shift, or cancel appointments in Google Calendar, and only after the caller confirms.
  6. Speak: Azure text-to-speech replies. Pre-generated filler phrases play while slow operations run.
  7. Close the loop: the call ends gracefully, an SMS or WhatsApp confirmation goes out, and the outcome is written to MongoDB.
  • Outbound customer verification: the agent calls the customer, confirms identity and appointment details, and records the result. This touched the call graph, the outbound WebSocket service, the media-stream model, and a new CustomerVerificationWorkflow (about 730 lines added in the main change).
  • Teammate delay workflow: a teammate calls in to say they are late. The agent finds the affected appointments, updates the calendar, and notifies the customer.
  • Graceful termination and confirmations: the agent detects when a conversation is finished, ends the call cleanly, then sends an SMS confirmation.
  • Call-outcome tracking: every call's result is stored in MongoDB for follow-up and reporting.
  • Latency-masking fillers: we measured the slow steps. A Google Calendar update took about 2.19 s and a calendar fetch about 617 ms. I added natural filler audio ("Let me update your calendar with the new time") so the caller never hears dead air.
  • LangGraph over a single prompt: phone calls are multi-turn and stateful. Explicit nodes and conditional edges made each path testable and stopped the model from wandering between intents.
  • Classify first, then act: a cheap intent classification (GPT-4o-mini) picks the workflow before any tool runs, which keeps latency and cost down.
  • Confirmation before side effects: calendar changes only happen after the caller confirms, because an AI should not silently move someone's appointment.
  • Fillers instead of faster APIs: we couldn't make Google Calendar faster, but we could stop the caller from noticing the wait.
Node.js · LangGraph · LangChain · OpenAI (GPT-4o-mini) · Twilio Voice, Media Streams, and SMS · WhatsApp via Twilio · Deepgram STT · Azure Speech TTS · Google Calendar API · MongoDB · WebSockets · React dashboard Before this project I built a real-time phone call translator alone. It streams Twilio calls through Deepgram, translates with OpenAI and speaks the result through ElevenLabs. That is the same audio pipeline this agent is built on.
LangGraph
Twilio
Deepgram
OpenAI
Node.js
MongoDB

Related projects

Devrox — Modern CRM for Sales Teams

Devrox — Modern CRM for Sales Teams

A full-featured CRM built for growing teams — pipelines, contacts, tasks, and activity tracking in one fast workspace. Devrox helps sales and ops teams manage leads, follow-ups, and customer relationships without spreadsheet chaos.
GoRural — Travel & Rural Experience Platform

GoRural — Travel & Rural Experience Platform

A travel platform connecting explorers with rural destinations, local stays, and countryside experiences. GoRural makes it easy to discover off-the-beaten-path trips, book experiences, and plan authentic rural getaways.
Gym Paladin — Fitness & Gym Management Platform

Gym Paladin — Fitness & Gym Management Platform

A fitness platform for gyms and members — workouts, memberships, progress tracking, and gym operations in one place. Gym Paladin helps athletes stay consistent while giving gym owners tools to manage members and programs.
RemaxHub — Property Experts for Buyers & Investors

RemaxHub — Property Experts for Buyers & Investors

A real estate platform connecting buyers and investors with property experts, listings, and market insights. RemaxHub helps users explore opportunities, compare investments, and work with trusted advisors across residential and commercial property.
ACE Intel — Operating System for Aircraft Brokers

ACE Intel — Operating System for Aircraft Brokers

A specialized platform for aircraft brokers combining market intelligence, live inventory, valuations, and broker workflow management. Built with React, Supabase, PostgreSQL, and advanced aviation-native data modeling.
Promise Ever — Memorial Pages & Revenue Platform

Promise Ever — Memorial Pages & Revenue Platform

Create shareable, AI-enhanced memorial pages that generate preneed leads and new revenue streams for funeral homes. Built with React, Supabase, and Shotstack for cloud video rendering.