Miguel Marinho portfolio case study
California Agent by Miguel Marinho
A self-hosted, voice-first home AI agent by Miguel Marinho: a custom wake word, a streaming speech pipeline, and LLM tool calls that drive the TV, lights, robot vacuum, WhatsApp, and real phone calls.
Summary
California (Cognitively Adaptive Language Intelligence For Operational Research, Navigation, and Intuitive Assistance) is a Jarvis-style voice assistant running on a laptop or Raspberry Pi in Miguel's home. A custom-trained wake word opens a streaming STT -> LLM -> TTS pipeline, and six tools let Claude act on the real world: the Android TV, Govee and Tapo lights, a Deebot robot vacuum, WhatsApp, his own phone, and live web search, all for under EUR5 a month.
Problem
Everyday home actions were spread across remotes, phone apps, and chat windows. Off-the-shelf assistants could not resume a Stremio episode, drive a TV that sleeps in deep standby, message a contact safely, or place a call on Miguel's behalf, and they could not be measured or tuned.
My role
Miguel designed, built, and measured the whole system: the wake-word model and its training pipeline, the audio and barge-in architecture, the multi-provider LLM tool layer, every device integration, the phone-call agent, and a live web UI. Development is AI-augmented with Claude Code and Codex, backed by an extensive unit-test suite that runs fully offline.
Architecture
- Custom "California" wake word trained on Modal with livekit-wakeword and run on openWakeWord, tuned against real held-out recordings rather than synthetic evals, with a dither floor that removed false wakes on near-silence.
- Streaming voice pipeline: Silero VAD, Groq Whisper with hallucination filtering, Claude streaming token by token into a sentence chunker, and Google Chirp 3 HD TTS on a producer-consumer queue so she speaks before the answer is finished.
- Barge-in and follow-ups: the wake word is listened for during every reply to interrupt her, and when she asks a question the mic stays open for the answer without the wake word.
- Six LLM tools (web search, TV, lights, vacuum, WhatsApp, phone) with history that keeps every tool round, so the model cannot claim an action it never took.
- TV control over ADB, HDMI-CEC, and UPnP: Stremio resume with TMDB title resolution, YouTube search-to-play confirmed through the media session, the TV's own volume, and a rebuilt power path that brought turn-on from ~45s to ~5s.
- Smart home: Govee lights over Bluetooth LE, TP-Link Tapo bulbs over a ported TPAP (SPAKE2+) local protocol, and a Deebot N8+ vacuum with self-renewing auth and room-level cleaning.
- WhatsApp through Playwright-driven WhatsApp Web, with server-side read-back confirmation tokens so a misheard name never sends a message to the wrong person, plus unread summaries and group sends.
- Real phone calls from Miguel's own number: a Gemini Live native-audio agent books tables and delivers messages over an ADB call-audio bridge, then reports the outcome and a timed transcript. She also announces incoming callers and summarizes missed calls and notifications.
- A live web UI streamed over SSE with a three.js halo that reacts to her voice, plus per-turn latency logs used to drive every optimization.
Outcomes
- One spoken sentence plays a show, sets the lights, starts the vacuum, sends a WhatsApp, or places a phone call.
- Measured latency work: TV wake ~45s -> ~5s, dark room to Stremio playing in ~20s, and warm WhatsApp group sends in under 2s.
- Safety by design: confirmation tokens the model cannot bypass, read-only phone reads, and spoken fallbacks instead of pretending an action worked.
- Runs on a sub-EUR5 monthly budget and serves as Miguel's testbed for reliable, observable, real-world agent workflows.