{"slug": "building-a-lifeline-how-i-engineered-an-ai-disaster-response-voice-agent-in-10", "title": "Building a Lifeline: How I Engineered an AI Disaster Response Voice Agent in 10 Days", "summary": "An engineer built Raksha, an AI-powered emergency voice assistant, in 10 days as part of the VoiceForBharat Edition challenge. Raksha uses LiveKit, Deepgram Nova-3, Google Gemini Flash, and Murf Falcon to provide sub-second voice responses, outbound SIP calling, human-in-the-loop dispatch, and multi-agent handoffs for disaster response. The developer overcame latency issues by engineering the LLM to generate conversational fillers while waiting for external API responses.", "body_md": "When floodwaters rise or infrastructure fails, screens become useless. Your hands might be full, your phone screen might be wet, or you might simply be in a state of panic. In these critical seconds, typing is a barrier. Talking is an instinct.\n\nFor the past 10 days, I participated in the 10 Days of Voice Agents — VoiceForBharat Edition challenge. My goal? To build Raksha—an AI-powered emergency voice assistant that doesn't just chat, but actively triages disasters, fetches live hazard data, and dispatches human rescue teams.\n\nHere is the story of how Raksha evolved from a simple text prompt into a multi-agent, SIP-calling rescue coordinator, the engineering roadblocks I hit, and how you can build one yourself.\n\n🧠 The Anatomy of an Emergency Agent\n\nTo build a voice agent that feels human, latency must be virtually zero. If a caller in danger has to wait 3 seconds for a response, trust is lost immediately. I orchestrated four core technologies using the LiveKit framework to achieve sub-second response times:\n\nThe Ears (STT): Deepgram Nova-3. Configured to language=\"multi\", it flawlessly captures the code-mixed \"Hinglish\" spoken across India, even when the caller is speaking frantically.\n\nThe Brain (LLM): Google Gemini Flash. It processes the text, enforces strict safety guardrails, and triggers backend Python functions.\n\nThe Voice (TTS): Murf Falcon. This was the game-changer. Falcon's speed is unmatched, and using native Indian voices (\"Pooja\" for our main agent and \"Samar\" for our specialist) made the system sound empathetic and incredibly natural.\n\nThe Nervous System: LiveKit's WebRTC network seamlessly streams the audio back and forth, handling echo cancellation and interruption detection automatically.\n\n🚀 Beyond Chat: The Features That Matter\n\nI didn’t want to build a glorified FAQ bot. Raksha needed to take action.\n\nOutbound SIP Calling & Persistent Memory\n\nEmergency systems shouldn't just wait for the phone to ring. Raksha is integrated with SIP trunking, allowing her to proactively dial out to residents in high-risk zones. Backed by a local SQLite database, she remembers returning callers, their household size, and specific mobility needs.\n\nHuman-in-the-Loop Dispatch\n\nAI shouldn't handle life-or-death situations unsupervised. If a caller is trapped, Raksha explicitly asks for consent. If granted, she generates a reference ID and fires a webhook to a live Discord command center, alerting human NDRF rescue teams instantly.\n\nLive Analytics Dashboard\n\nYou can't improve what you don't measure. I built a lightweight, auto-refreshing Python dashboard. Through LiveKit's room events, it tracks active calls and only logs a call as \"Successful\" if Raksha actually gathered triage data or dispatched a rescue team.\n\nTrue Two-Way Multi-Agent Handoffs\n\nDisaster response requires different experts. Raksha is a triage specialist. But what if a caller is safe and just needs to find a food camp?\n\nI built a Shelter Specialist named Vikram. If a caller needs food, Raksha says, \"I will transfer you to Vikram.\" Raksha's AI engine dynamically shuts down, securely passes the caller's context to a new process, and Vikram's AI engine boots up—taking over the microphone with a distinct, male voice. If the caller suddenly reports a medical emergency, Vikram can seamlessly transfer the call back to Raksha.\n\n🧗 The Crucible: Engineering for Voice\n\nBuilding a text chatbot is easy; you have time to compute. Building a real-time voice agent is a completely different beast. Voice UX is unforgiving. Here were my biggest architectural hurdles and how I solved them:\n\nThe Problem: Raksha needs to hit external APIs (like Open-Meteo for flood data) and write to a database. These network requests take about 800ms to 1.5 seconds. Initially, when a user asked for weather data, Raksha would go dead silent for 2 seconds while waiting for the tool to return data, making callers think the line disconnected.\n\nThe Fix: I engineered the LLM to generate conversational fillers before executing the tool. By instructing the model to say, \"Hold on, let me check the live hazard map for your district,\" the user stays engaged while the backend asynchronously fetches the JSON data. This completely masked the API latency.\n\nThe Problem: Disaster victims in India don't speak pure English or pure Hindi. At first, if the LLM generated Hindi words using the English alphabet (e.g., \"Aap safe ho?\"), the TTS engine would pronounce it with a heavy, robotic American accent, breaking the immersion entirely.\n\nThe Fix: I added a strict guardrail in Gemini's system prompt: \"Always write Hindi words in Devanagari script.\" Because the Murf Falcon API processes Devanagari natively, the TTS instantly switched to a flawless, empathetic Indian accent, seamlessly blending English technical terms with native Hindi grammar.\n\nThe Problem: When building the specialist handoff, simply swapping the TTS voice to a male voice wasn't enough. Initially, Vikram would answer the phone and ask the user for their location all over again, which is infuriating in an emergency.\n\nThe Fix: I implemented a Stateful Context Transfer. When Raksha triggers the handoff tool, she generates a compressed JSON summary of the caller's location and needs. This payload is dynamically injected into Vikram's initialization prompt. When Vikram boots up, he says, \"Namaste, I see you are safe in Patna with three family members. Let's find you food,\" creating a flawless multi-agent transition.\n\n🛠️ Build Your Own: Ground Zero\n\nWant to build your own voice agent? Here is your starting line.\n\nClone the Foundation\n\nYou can inspect my full code and architecture here:\n\n👉 `https://github.com/ic-heisenberg/murf-livekit-starter.git`\n\nProtect Your Keys\n\nVoice AI requires API keys. Never push them to public repositories. Create a .env.local file in your root folder:\n\nCode snippet\n\n`LIVEKIT_URL=wss://your-url.livekit.cloud`\n\nLIVEKIT_API_KEY=your_key\n\nLIVEKIT_API_SECRET=your_secret\n\nMURF_API_KEY=your_murf_key\n\nDEEPGRAM_API_KEY=your_deepgram_key\n\n```\nBash\npython -m venv .venv\n# Activate it (Windows): .\\.venv\\Scripts\\activate\n# Activate it (Mac/Linux): source .venv/bin/activate\npip install livekit-agents livekit-plugins-murf livekit-plugins-google livekit-plugins-deepgram python-dotenv aiohttp\npython src/agent.py dev\n```\n\nFrom there, you can connect via the LiveKit Hosted Playground and start talking to your agent immediately!\n\n🔮 The Road Ahead\n\nThis 10-day sprint proved that building ultra-low-latency, context-aware voice AI is highly accessible. In the future, I plan to add Twilio SMS integration so callers receive their NDRF Reference IDs via text automatically after the call drops.\n\nA massive thank you to Murf AI for hosting this challenge. The Murf Falcon API blew my expectations away regarding how fast and human AI can truly sound.\n\nLet’s keep building tech that matters.", "url": "https://wpnews.pro/news/building-a-lifeline-how-i-engineered-an-ai-disaster-response-voice-agent-in-10", "canonical_source": "https://dev.to/meme_sense_2962a8b4cd7c7f/building-a-lifeline-how-i-engineered-an-ai-disaster-response-voice-agent-in-10-days-1elp", "published_at": "2026-08-15 12:58:38+00:00", "updated_at": "2026-08-15 13:12:42.588408+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-products", "ai-infrastructure", "developer-tools"], "entities": ["Raksha", "LiveKit", "Deepgram Nova-3", "Google Gemini Flash", "Murf Falcon", "VoiceForBharat", "Open-Meteo", "NDRF"], "alternates": {"html": "https://wpnews.pro/news/building-a-lifeline-how-i-engineered-an-ai-disaster-response-voice-agent-in-10", "markdown": "https://wpnews.pro/news/building-a-lifeline-how-i-engineered-an-ai-disaster-response-voice-agent-in-10.md", "text": "https://wpnews.pro/news/building-a-lifeline-how-i-engineered-an-ai-disaster-response-voice-agent-in-10.txt", "jsonld": "https://wpnews.pro/news/building-a-lifeline-how-i-engineered-an-ai-disaster-response-voice-agent-in-10.jsonld"}}