HIRO GEAR
AI Raspberry Pi Agent GPU RaspberryPI

How My Custom AI Agent Evolved into J.A.R.V.I.S. Territory: Voice-Tuned Whisper, 3-Stage Conversation Logic, WOL Expansion from Discord, and Obsidian Integration

How My Custom AI Agent Evolved into J.A.R.V.I.S. Territory: Voice-Tuned Whisper, 3-Stage Conversation Logic, WOL Expansion from Discord, and Obsidian Integration

Introduction: From a Mere Chatbot to a “Companion That Stays by Your Side and Helps”

Have you ever spoken to “Hey, Siri” or “OK, Google” only to be disappointed by a slow response or a generic search result read aloud? In human-to-human conversation, the moment you say “Hey,” the other person nods and says “Yeah?” However, with conventional AI assistants, several seconds of silence pass after you ask a question, leaving the user anxious: “Did it hear me?” or “Is it still processing?”

What I aimed for was a dedicated AI agent like J.A.R.V.I.S. from the movie Iron Man:

  • Replies with a natural backchannel like “Yeah” or “I see” within 0.5 seconds when spoken to,
  • Understands the nuances of my voice perfectly without misrecognition even when I speak fast,
  • Senses the user’s facial expression (fatigue or a smile) in real time through a camera,
  • Knows every detail of my schedule (Google Calendar) and thought notes (Obsidian notebook),
  • Expands conversation topics in real time onto the screen as a cyberpunk 3D knowledge tree,
  • And normally waits quietly on Discord, then awakens a heavy-duty home GPU server via WOL (Wake-on-LAN) when extra support is requested, upgrading into a full-spec voice dialogue space.

My custom AI agent (nicknamed Gonras), which I have been developing over the past several months, has evolved dramatically toward this exact ideal. In this article, I will share its entire architecture and implementation details.


1. Overall System Architecture (Low-Power Standby × On-Demand Awakening)

Keeping a GPU machine running at full power 24/7 incurs huge electricity costs. Therefore, this system adopts a two-tier architecture consisting of “a lightweight Raspberry Pi running 24/7” and “a home main GPU machine (RTX 3060) summoned only when needed.”

flowchart TD
    subgraph Everyday ["Everyday Mobile / On the Go"]
        Discord["Discord Chatbot (24/7 Lightweight Text Chat)"]
        BrowserUI["Web Browser (Gonras UI) (Voice, Expression, Full 3D Dialogue)"]
    end

    subgraph Home_Always ["Raspberry Pi (24/7 Always On)"]
        DiscordBot["Discord Bot Resident Daemon"]
        MCP["MCP Server Suite (70+ Tools)"]
        Obsidian["Obsidian Notebook (Second Brain)"]
        GWorkspace["Google Calendar / Tasks / Gmail"]
        WOL_Trigger["WOL Wake Trigger"]
    end

    subgraph GPU_Host ["Home Main PC (RTX 3060 / Booted Only When Needed)"]
        RustCore["Ultra-Fast Rust WebSocket Server"]
        Whisper["Fine-Tuned Whisper (Custom Model for My Voice)"]
        VOICEVOX["VOICEVOX (Ryusei Aoyama)"]
    end

    subgraph Cloud_AI ["Cloud LLM"]
        Gemini["Gemini 2.5 Flash Lite (3-Stage Parallel Inference)"]
    end

    Discord <-->|Quick text consultation| DiscordBot
    DiscordBot -->|Send WOL on 'Wake up'| WOL_Trigger
    WOL_Trigger -->|Magic Packet| GPU_Host
    GPU_Host -->|Notify Discord on boot completion| Discord
    BrowserUI <-->|Start full-feature dialogue| RustCore
    RustCore <-->|Inference / Tool selection| Gemini
    RustCore -->|Tool execution request| MCP
    MCP <--> Obsidian
    MCP <--> GWorkspace
    RustCore -->|Emotional speech synthesis| VOICEVOX
    VOICEVOX -->|Return audio| BrowserUI

2. Normally on Discord, Dynamically Expanding to Full Features via WOL When Needed

What defines the usability of this agent is dynamic feature expansion (on-demand awakening) combining Discord and WOL (Wake-on-LAN).

【Everyday Form: A Low-Power Discord Chatbot】

When out and about, commuting, or between work tasks, I simply open Discord on my smartphone and issue lightweight text instructions. The Discord Bot running on the Raspberry Pi stays online 24/7 and replies in seconds via text to everyday requests like “Add today’s task” or “What’s tomorrow’s weather?” Taking notes in Obsidian or checking the calendar is already completely handled right here.

【Moment of Enhanced Support: Awakening the Home GPU Server via WOL】

However, there are times when I need full-fledged support: “I want to brainstorm the vague ideas in my head out loud,” “I want to discuss a complicated weekend schedule,” or “I want to talk deeply hands-free.”

At times like that, I just drop a single message on Discord:

“Gonras, wake up”

Then, the Raspberry Pi sends a WOL (Magic Packet) to my RTX 3060 machine at home, automatically booting the sleeping main PC. In just about 30 seconds:

  1. My custom fine-tuned Whisper speech recognition engine
  2. The ultra-fast Rust WebSocket server
  3. VOICEVOX (Ryusei Aoyama) speech synthesis
  4. The 3D knowledge graph space

all launch at once, and a notification arrives on Discord: “PC has booted. Ready for full dialogue.”

Opening the smartphone browser carries over the context from Discord and instantly expands into a full-support space with voice, facial expression recognition, and 3D visualization just like J.A.R.V.I.S.


3. Reproducing Human “Conversational Rhythm” 【3-Stage AI Dialogue Logic】

What I focused on most in full-feature mode is the “3-Stage Parallel Response Pipeline” built in Rust. It completely eliminates the “silence stress” of conversational AI, creating a natural tempo as if a real person were nodding along right in front of you while thinking.

sequenceDiagram
    autonumber
    actor User as User
    participant Rust as Rust Server
    participant S1 as Stage 1 (Instant Backchannel)
    participant S2 as Stage 2 (Initial Response)
    participant MCP as MCP / External Tools
    participant S3 as Stage 3 (Detailed Response)

    User->>Rust: "Tell me my main schedule for next week"
    Note over Rust,S1: Responds instantly within 0.5s after speech ends
    Rust->>S1: Backchannel request
    S1-->>User: 🔊 0.5s "Uh-huh!" (Zero silence)
    Rust->>S2: Initial response & tool selection
    S2-->>User: 🔊 1.5s "Let me check next week's schedule!"
    S2->>Rust: Designate tool (control_calendar)
    Rust->>MCP: Execute calendar query
    MCP-->>Rust: Return schedule data
    Rust->>S3: Inject data & generate comprehensive response
    S3-->>User: 🔊 3.5s "You have the regular project meeting on Tuesday and a health checkup on Thursday!"

【Stage 1: Instant Backchannel (0.5–1.0s)】

  • Purpose: “Never keep the user waiting” and signal “I’m listening.”
  • Mechanism: The moment the user’s speech pauses, a minimal prompt is sent to Gemini to rapidly generate only a 1–5 character natural backchannel (“Yeah,” “I see,” “Hmm”). VOICEVOX speaks it immediately. This reduces initial conversational silence to zero.

【Stage 2: Initial Response & Tool Selection (1.5–2.0s)】

  • Purpose: Provide an immediate brief conclusion and preview background work.
  • Mechanism: Speaks a short 10–30 character conclusion, or a future-tense action preview such as “Sure, I’ll jot that down in your notebook!” or “Let me check your calendar!”
  • Crucial Background Processing: Simultaneously, it evaluates the catalog of over 70 MCP tools held by the server to determine which tool to run and pinpoints chosen_tool (e.g., control_calendar).

【Stage 3: Deep Execution & Comprehensive Tool Response (2.0–5.0s)】

  • Purpose: Actually execute external tools and assemble detailed information and 3D knowledge.
  • Mechanism: Dynamically loads only the schema of the tool designated in Stage 2 (On-demand Schema Resolution) and executes the API. It then outputs the final response incorporating calendar schedule data, notebook contents, smart air conditioner status, coordinates of nearby shops, etc.
  • Smart Skip: For casual small talk or greetings where no deeper dive is needed, it returns a special token NO_ADDITIONAL_INFO to cut off extra speech and prevent unnecessary chatter.

【Barge-in (Interruption) Support】

In human conversations, one person may chime in mid-sentence with “Oh, and also…” In this system, the moment new voice input is detected even while the AI is speaking, it implements interruption handling that immediately aborts the running Stage tasks and clears the playing audio queue.


4. What Evolved! Core Technologies and Craftsmanship

① Custom Whisper Fine-Tuned on My Voice & Web Audio VAD

General-purpose speech recognition models tend to misrecognize fast speech, verbal habits, or specific vocal tones. So I further trained (fine-tuned) Whisper using my own past voice data.

  • No matter how fast I speak or mumble quietly, it captures my voice with 100% accuracy.
  • On the frontend (smartphone) side, I implemented VAD (Voice Activity Detection) via the Web Audio API, automatically sending audio data the moment speech ends.
  • Simply calling the wake word “Gonras” starts a completely hands-free conversation.

② Real-Time Facial Expression Recognition & Emotion Monitoring via Camera (AI with Eyes)

To watch over the user across the screen, I integrated a real-time facial expression recognition system using the camera:

  • Expression Calibration (Personal Learning Feature): Everyone’s expressions manifest differently. By having it learn my “neutral,” “happy,” “sad/tired,” and “angry” faces on the spot, it accurately detects user-specific facial changes.
  • Emotionally Attuned Dialogue: Not only through words, it achieves true companion-like emotional communication—lowering its tone to gently offer comfort when I look tired, or replying brightly and briskly when I am smiling.
  • Multimodal Capture: Pressing the ”📸” button lets me photograph the scenery, documents, or objects around me and ask “What is this?” while showing it.

③ VOICEVOX Parameter Linkage That Changes Voice Tone by Emotion

For speech synthesis, I use VOICEVOX (Speaker: Ryusei Aoyama).

Rather than plain text-to-speech, Gemini dynamically decides intonation (intonationScale), speech speed (speedScale), and pitch (pitchScale) based on conversational context, facial expression, and emotion, injecting them into the speech engine:

  • When happy / birthdays: Intonation 1.35, Speed 1.10, Pitch +0.05 (bright, upbeat celebration)
  • When tired / offering comfort: Intonation 0.90, Speed 0.95, Pitch -0.04 (gentle, calm voice to stay close)

④ “3D Knowledge Graph Space” Where Thoughts and Memories Expand (Three.js)

On the screen spreads a cyberpunk 3D space (Three.js) reminiscent of J.A.R.V.I.S.’s holograms. Structured data emerging during conversation—such as “outing destination candidates,” “arrival times at stops,” “shopping lists,” and “daily tasks”—is generated in real time as a 3D knowledge tree connected by nodes and links:

  • Every time a new topic appears, it connects to past nodes like branches growing on a tree, accumulating memories.
  • Tapping a node smoothly flies the camera toward it (Fly-To), with full support for free drag placement, zoom in/out, and smartphone pinch gestures.
  • Because it is persisted in the browser’s local storage, reloading the page restores your previous thought tree intact.

⑤ Hybrid Integration of Real-Time Tracking GPS (Browser) × Location Log MCP

To push real-time responsiveness for navigation and nearby searches while on the move to the absolute limit, I hybridized location acquisition:

  • During Dialogue (While Moving): Using the browser’s watchPosition (high-accuracy mode), even while driving or walking, it answers “Where’s a nearby convenience store?” immediately using millisecond-fresh GPS coordinates—skipping MCP tool-call overhead for blazing-fast responses.
  • Past Activity Logs: For retrospective questions like “Where was I last Sunday?”, an MCP (get_location_history) that queries server-side accumulated logs is automatically invoked.

5. The Joy of Having Your Notebook (Obsidian) and Google Workspace as Extensions of Yourself

The biggest reason this agent goes beyond a mere convenience tool is that it has direct access to “my personal data (Second Brain).”

  • Automatic Recording & Search in Notebook (Obsidian): Saying “Jot this idea down in my notebook” immediately appends it as Markdown into the appropriate folder in my Obsidian Vault (such as 1.Input). Past knowledge can also be retrieved via semantic search.
  • Google Workspace Integration: Asking “Tell me this week’s schedule” lists events from my main Google Calendar and gives advice considering overlaps and travel time. Adding tasks or checking Gmail is also completed with a single voice command.
  • Smart Home (Air Conditioner) Control: Depending on room temperature and how I feel, saying “It’s a bit hot, turn down the AC” calls the Daikin air conditioner’s ECHONET Lite API to adjust the temperature automatically.

Summary: AI Shifts from “Something You Use” to “Something That Stays by Your Side and Helps”

In the past, AI was a “tool you used”—typing prompts into a search box to pull out the answers you wanted.

Now, however—quietly watching over me on Discord during normal hours, waking my home GPU via WOL when I want a deep talk, sensing my unique voice and facial expressions, and conversing without awkward silence—my perception of AI has clearly changed.

AI is not “something you use,” but “a companion that stays by your side and helps you in daily life.”

Sensing my expression when I come home tired and adjusting the room temperature, neatly structuring an idea in my notebook the moment I speak it aloud, or navigating me smoothly to my next destination while on the move.

A presence that gently covers for human weaknesses and busyness, and gives you a push forward—.

The future that sci-fi’s J.A.R.V.I.S. aimed for is already in our hands, powered by open source and DIY craftsmanship.