Skip to content
cd ..~/abhay/projects/orbi.md · 6.8K · case study 01 of 09

9 files open · click a tab, or use prev / next at the bottom of the page

// case 01 — Voice agent · 2026

Orbi.md

A voice agent that runs your Windows PC and your Android phone, and stays correct when things go wrong.

> 70+ tools behind one voice, with exactly-once actions and undo that survives a restart.

MY ROLESolo build: agent, tools and app
TIMELINEOct — Nov 2026 · Softablitz 2026
TEAMJust me
STACK
Gemini Live APIElectronTypeScriptReactsherpa-onnxSQLiteadb
orbi · "hey orbi" · listening
wake word heard: "hey orbi" (sherpa-onnx, on device)
$ open docker, open vs code and set the volume to 30
plan open_app(docker) → open_app(code) → set_volume(30)
OK open_app docker ledger #412 verified: window focused
OK open_app code ledger #413 verified: window focused
OK set_volume 30 ledger #414 verified: volume = 30
WAIT link dropped · resuming session · outbox holds 1 call
retry set_volume(30) → same idempotency key → skipped
$ undo that
OK volume back to 55 · undo recorded in ledger
$
PIPELINE
1Wake word
2Gemini Live
3Gatekeeper
4Tools
5Ledger
TOOLS70+
DEVICESPC + phone
API KEYS0
exactly-once tool calls
// 01 — context

the problem_

cat problem.md

Softablitz 2026 asked for a "Dreamwalker": an assistant you talk to that actually works your computer. A demo that opens Notepad is easy. The hard part is what happens on a real machine: the connection drops halfway through a request, the model asks for the same action twice, a web page hides instructions in its text, and a misheard word can delete a file.

So Orbi had to be judged on more than what it can do. It had to do each thing once, say honestly whether it worked, ask before anything risky, and be able to take an action back.

## constraints
  • Live voice, interruptible
  • Windows + Android
  • No API keys on disk
  • Exactly-once actions
  • Undo after restart
  • Untrusted web and email text
./my-role.sh --verbose

abhay@os ~ % what did I actually do?

  1. 01Built the live voice loop on the Gemini Live API: offline wake word (sherpa-onnx), barge-in that drops stale audio, and session resumption with an outbox so a dropped link loses nothing.
  2. 02Wrote 70+ tools (files, apps, windows, volume, browser, Word, PowerPoint, Gmail, Calendar, phone over adb), each with a risk level and an allow / ask / deny policy.
  3. 03Made every action exactly-once: an idempotency key per request, tool and arguments, enforced by a UNIQUE column in a SQLite ledger that also powers "undo that".
  4. 04Added outcome checks: after acting, Orbi verifies the file exists, the volume changed or the window is focused, and says so honestly.
  5. 05Built a caution mode for prompt injection and a secret filter that hides keys and passwords before outside text reaches the model.
  6. 06Shipped a phone remote: an installable web app that reaches the laptop through a small relay on a Google Cloud VM, with the same confirmations.

[ ok ] exit 0 · 6 tasks · owner: abhay

// 02 — results

what moved_

Three numbers I'd put on a slide. Measured in production, not in a benchmark I wrote the night before.

TOOLS70+tools, each with a risk levelFiles, apps, windows, browser, Office, Gmail, Calendar and the phone.
DEVICES2PC and phone, one voiceAndroid over adb, same confirmations and ledger.
KEYS0API keys on diskGemini is reached with the user's own gcloud login.
// 03 — architecture

how it fits_

Everything that can act lives in Electron's main process. The windows only show state and send audio; tools are never exposed to them.

open architecture.excalidraw — orbi
VOICE
Wake + Earsherpa-onnx · 16 kHz
LinkGemini Live · resume
tool calls
BRAIN
Brainconversation state
Gatekeeperrisk · caution mode
approved
HANDS
PC toolsUI Automation · shell
Phone toolsadb
GoogleGmail · Calendar
record
LEDGER
SQLite ledgeridempotency · undo
Tasksbackground agents
request / write pathresponse / events backa retry never runs an action twice
// 04 — key decisions

git blame me_

adr-001.md
CHOSE

Idempotency keys from request + tool + arguments

REJECTED

Trusting the model's call ids

TRADE-OFF

After a reconnect Gemini can ask again with a new call id, so ids can't spot a retry. Keys built from what is asked can, at the cost of a stable JSON encoder and a rule for look-and-act loops.

adr-002.md
CHOSE

Application Default Credentials (gcloud login)

REJECTED

An API key in a config file

TRADE-OFF

Setup needs the Google Cloud CLI, but there is no key anywhere on disk to leak.

adr-003.md
CHOSE

Verify outcomes after acting

REJECTED

Reporting the tool's return value

TRADE-OFF

Every tool needs a second check, but Orbi never says "done" when the volume didn't change.

// 05 — under the hood

the good bit_

vim src/main/ledger/idempotency.tsTypeScript
1// JSON with keys sorted at every level: {a:1,b:2} and {b:2,a:1} give the same text
2export function stableStringify(value: unknown): string {
3 if (Array.isArray(value)) return `[${value.map(stableStringify).join(',')}]`
4 if (value && typeof value === 'object') {
5 const entries = Object.entries(value as Record<string, unknown>)
6 .filter(([, v]) => v !== undefined)
7 .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))
8 return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${stableStringify(v)}`).join(',')}}`
9 }
10 return JSON.stringify(value) ?? 'null'
11}
12
13export function idempotencyKey(requestId: string, tool: string, args: Record<string, unknown>) {
14 return `${requestId}|${tool}|${stableStringify(args)}`
15}
NORMAL src/main/ledger/idempotency.ts15 lines · utf-8

Exactly-once in a few lines: the same request, tool and arguments always make the same key, and the ledger's UNIQUE column refuses a second copy.

less lessons.txt

If I built it again, I'd change…

  1. L1A repeat is not always a retry"Screenshot, tap, screenshot" sends the same call twice on purpose. Treating it as a retry returned the old picture and the model tapped blind. Now a call is a retry only if nothing else ran in between.
  2. L2Check, then claimTools that return "ok" are not proof. Checking the real state afterwards caught failures the tools never reported.
  3. L3Counters collideRequest ids are random UUIDs, not counters: a counter restarts at 1 and collides with yesterday's keys in the ledger.

lessons.txt (END) — press q to quit

// 06 — timeline

git log --since_

Oct — Nov 2026 · Softablitz 2026

git log --reverse --format=milestone orbi
  1. 01Oct 2026Voice loopWake word, Gemini Live, barge-in and reconnects.
  2. 02Oct 2026Tools + GatekeeperRisk levels, confirmations, the SQLite ledger.
  3. 03Oct 2026Exactly-onceIdempotency keys and the retry guard.
  4. 04Nov 2026Phone + routinesadb tools, phone remote via relay, voice-taught routines.
cd ~/work./contact — itsabhay@abhay.si