Skip to content

Asking Jarvis (Phase 9)

  • by

For eight phases Jarvis told me things. Phase 9 lets me ask it things, by voice from my phone and from a web page.

Where this came from

Back in the first planning notes I wrote a wish: “Hey Siri, ask Jarvis.” Everything since then (the brief, the voice, the dashboard, the calendar watchers) built the data it would need. Phase 9 is where that data becomes a conversation.

How it works

  • An iPhone Shortcut dictates my question, sends it over SSH, and reads the answer aloud.
  • On my server, a small dispatcher reads one word from the Shortcut. ask goes to the new script. Anything else works as it always did.
  • The script collects a short context: today’s spoken brief, my work calendar, the family calendar as counts and times only, and the server status flags.
  • It sends that and my question to Gemini, tries other Gemini models if the first is busy, and returns one to three plain sentences.

The rules

  • Read-only. It can only answer. Changing things comes later, and one action at a time.
  • Titles stay home. Family event titles never reach the AI. My test collects every request the script sends and checks that the titles aren’t in any of them.
  • Data is not instructions. The prompt tells the model that calendar entries are data and not to follow instructions in them.
  • Limits. A cap on questions per day so a loop can’t eat my free quota. Logs hold counts and the name of the model, never the question.

What I got wrong

  • Too strict. My first prompt said “use only the context.” Asking “how tall is Everest?” would have returned “I don’t have that information.” I changed it: my day, calendars and servers come only from the context, general questions get a short answer, and live things like weather get an honest “I can’t check that.”
  • A fix I didn’t need. On a Sunday it told me I had no meetings. I assumed the calendar hadn’t synced and rewrote the prompt. The calendar had synced and was empty. The model was right.

Did it work?

First live test: a one-second answer from the cheapest Gemini model. Then the Shortcut: I asked about the servers and it said my network had a new device, one server disk was 94 percent full and a drive had unreadable sectors. Each point matched the dashboard.

The web page

A phone-friendly page with a text box, suggested questions, and an optional spoken reply in the same Kokoro voice as my morning brief.

I didn’t want a password on a page that can see my calendar and servers. Instead:

  • On the server I run one command that prints a sign-in link. It works once and expires in ten minutes.
  • Opening it shows a “Sign in” button. Only the button uses up the link, so a chat app previewing it can’t burn it.
  • Five bad tries locks an address out for fifteen minutes.
  • Only my home network and VPN can reach it.
  • Sessions are random tokens stored hashed, and they expire after three days idle or seven days total.
  • Later, Microsoft Entra single sign-on will be the main login, and the one-time link stays as the way back in if I’m locked out.

I tested all of it on sample data first: link reuse, expired links, lockout, a stolen-cookie style cross-site request, an oversized body, and addresses outside my network.

It went live on a Thursday afternoon and worked from my Mac and my phone. The voice is the same Kokoro voice as the morning brief, so it sounds like the same person. Text arrives in a second or two, and the voice starts a few seconds after that.

The backup AI

When Gemini is busy or out of free quota, the script falls back to other Gemini models and then to Groq’s free tier. I tested it by pointing the Gemini address at nothing: the log showed three Gemini failures and then Groq answered in half a second.

Two small things went wrong on the way:

  • A 403 from a firewall. Groq blocked Python’s default User-Agent, so every request failed before my key was even checked. A one-line header fixed it.
  • A key pasted three times. My phone’s terminal pasted the key repeatedly, which gave a 401. I cleaned the file up with a script that only printed lengths, never the key.

A speed test that went the wrong way

Spoken replies start a few seconds late because the voice is generated on my server. I benchmarked the full Kokoro model at about 1.7x faster than real time. The smaller int8 model, which should be faster, ran at 0.6x on my CPU. I kept the full model and left the delay as it is. It’s good enough, and I’d rather not risk the other services on that server.

What it costs

Nothing. Standard-library Python, one more word in an existing dispatcher, a free Gemini key, a free Groq key and a local voice.

What’s next

Small actions with a confirmation (a note, a reminder), and the single sign-on button once the page has a proper HTTPS address. I also want to compare newer Gemini models side by side before changing the chain.

Leave a Reply

Your email address will not be published. Required fields are marked *