My Girl V2

Android personal agent — starter project v2.0

She answers to “Hey My Girl.”

A Kotlin Compose app on your phone, a FastAPI backend behind it. Speak or type in Burmese or English and she answers out loud — with memory, scheduled tasks, and an approval gate before anything leaves the device.

  • minSdk26
  • targetSdk35
  • StackCompose · FastAPI
  • StoreSQLite
Voice sample

ElevenLabs render · the app speaks on-device

01Capabilities

What she can actually do today.

Everything below is implemented in the starter project. The tag on each card says how far it goes, so nothing here reads as more finished than it is.

  1. Core

    Burmese and English chat

    The message, your last twelve turns and your stored memories go to any OpenAI-compatible model. She replies in whichever language you wrote in.

    POST /api/chat

  2. Voice

    Voice in, voice out

    Android SpeechRecognizer captures speech in my-MM or en-US, and TextToSpeech reads the reply back — in Burmese when the device ships that voice.

    SpeechRecognizer · TTS

  3. Beta

    A wake phrase, with caveats

    A foreground microphone service restarts recognition and broadcasts an event when it hears “my girl”. The notification stays visible for as long as it listens.

    WakeWordService

  4. Opt-in

    Accessibility, kept narrow

    You enable it yourself in Settings. It exposes Back and Home only — no screen scraping, no arbitrary taps, no password or payment dialogs.

    canRetrieveWindowContent=false

  5. Gated

    Whitelisted actions

    Launch an approved app, go Back, go Home. Every action runs only when you trigger it, and anything with an external side effect needs explicit approval first.

    BACK · HOME · launch

  6. Worker

    Scheduled tasks

    Tasks are stored with a run time and checked by a WorkManager job. The worker is deliberately inert: it reports, it does not act.

    WorkManager

  7. SQLite

    Memory with a paper trail

    Memories, tasks and every action request are written to SQLite, so you can see exactly what was asked for and what was refused.

    memories · tasks · audit

02Limits

What she can't do yet.

A starter project is only useful if it tells you where it stops. These are the gaps, stated plainly, with the reason each one exists.

  • Not shipped

    No production wake word

    The wake phrase rides on the platform speech recogniser, so it will miss you and some OEM builds will stop the session outright. Reliable always-on detection needs Picovoice Porcupine or a custom TensorFlow Lite keyword model.

  • OS-dependent

    Background listening is not guaranteed

    Android 13+ requires notification permission, Android 14+ restricts microphone foreground services, and battery optimisation can stop the service. A force-stopped app or a fresh reboot cannot listen.

  • Device-dependent

    Burmese speech comes from the phone

    my-MM recognition and a Burmese TTS voice are supplied by the device's speech services. Without them she falls back to whatever the phone does have, or stays silent.

  • By design

    Accessibility is a manual switch

    You enable the service yourself under Settings › Accessibility. The app cannot do it for you, and should not be able to.

  • Not connected

    No Gmail, Calendar, search or YouTube adapters

    The API contracts and extension points exist; the adapters do not. Ask her to check your calendar and she will tell you she cannot.

  • By design

    Execution stays approval-gated

    /api/actions/execute rejects approved=false with a 403, and returns 501 when no adapter is configured. Nothing external runs quietly.

03Architecture

Two halves, one conversation.

The phone owns the microphone, the wake phrase and the voice. The backend owns the model key, the memory and the audit log. They meet over plain JSON.

Request path

  1. 1

    You say “Hey My Girl”

    The service broadcasts WAKE_DETECTED and the app acknowledges in Burmese.

  2. 2

    The app posts the message

    A user id, the message and up to twelve previous turns go to the chat endpoint.

  3. 3

    The backend loads memory

    Your twelve most recent memories are folded into the system prompt before the call.

  4. 4

    The model answers

    Any OpenAI-compatible endpoint, temperature 0.7, a sixty-second ceiling.

  5. 5

    The reply is spoken

    The bubble renders, then the text is handed to Android TTS in the device locale.

Backend endpoints
Endpoint What it does Returns
GET /health Liveness check used before you wire up the phone. { ok: true }
POST /api/chat Chat turn with memory and history injected. { reply }
GET /api/memory/{uid} List stored memories for a user. { items[] }
DELETE /api/memory/{uid} Erase everything remembered about a user. { deleted: true }
POST /api/tasks/{uid} Store a task with an optional run time. { id, status }
GET /api/tasks/{uid} List a user's tasks and their state. { items[] }
POST /api/actions/execute The approval gate. Refuses unapproved or unconfigured actions. 403 / 501

04Setup

From an empty folder to a signed APK.

Three stages, in order. The backend first, because the app has nothing to talk to until it is running.

  1. 1

    Create the environment

    Python 3.11 or newer. A virtual environment keeps the dependencies local.

  2. 2

    Add your key

    Copy .env.example to .env and set LLM_API_KEY. Never commit that file.

  3. 3

    Run it

    Uvicorn serves on port 8000. Check /health, then open /docs.

backend · terminal
# Python 3.11+
cd backend
python -m venv .venv
# Windows: .venv\Scripts\activate
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# put LLM_API_KEY in .env
uvicorn app.main:app --host 0.0.0.0 --port 8000

Environment

LLM_API_KEY
Required. Provider key, read from the backend only.
LLM_BASE_URL
Defaults to the OpenAI API. Point it at any compatible gateway.
LLM_MODEL
Defaults to gpt-4o-mini.
ALLOW_ORIGINS
Defaults to *. Local development only.

05Security

The trust boundary is the backend.

Four decisions carry most of the safety here. Each one is enforced in code, not in a policy document.

01

The key never ships

LLM_API_KEY lives in backend/.env. The APK talks to your FastAPI server and never to the model provider, so a decompiled app yields no credentials.

02

Approval is enforced server-side

approved=false is a 403 before any adapter runs, and a missing adapter is a 501. The client cannot talk its way past either.

03

Accessibility stays narrow

The service declares canRetrieveWindowContent=false and canPerformGestures=false, and exposes Back and Home only.

04

Open CORS is a dev default

ALLOW_ORIGINS=* exists for local work. A public deployment needs a fixed origin list, TLS, authentication, rate limiting and per-user authorisation.

Before this faces the public internet

  • Replace * with an explicit origin allow-list.
  • Terminate TLS and force HTTPS on the backend.
  • Add JWT or session authentication to every route.
  • Scope memories, tasks and audits to the authenticated user.
  • Rate-limit chat and action endpoints per user.
  • Publish a privacy policy that names the model provider.
  • Keep the signing key out of Git, and back it up.
  • Run a security review before the first release build.

06Roadmap

What has to happen next.

In order. The wake word comes first because everything else is harder to judge while detection is unreliable.

Now

Replace the beta wake word

A licensed hotword engine or a small TensorFlow Lite keyword model, with an honest offline fallback when the model is unavailable.

Next

Build the real adapters

Gmail, Calendar, web search and YouTube, each behind the existing action contract and each requiring approval before it writes anything.

Later

Harden for release

Accounts, per-user data isolation, a privacy policy, and a signed release pipeline with an audit trail you can actually hand to someone.

07FAQ

Questions that come up first.

Does the wake phrase work offline?

No. It uses the platform speech recogniser, so offline behaviour depends on whether the device has on-device speech models installed. A true offline hotword needs the dedicated engine listed in the roadmap.

Will she actually speak Burmese?

If your phone has a Burmese TTS voice installed, yes. Otherwise the app falls back to the device's default voice or stays silent. The samples on this page were rendered with ElevenLabs, not by on-device TTS.

Where does my data go?

Messages travel to your own FastAPI server, which stores memories, tasks and an audit row in SQLite and forwards the prompt to whichever model provider you configured. This website stores nothing; the language choice stays in your browser.

Can she control other apps?

Only launch whitelisted apps and press Back or Home, and only when you ask. There is no screen reading, no tapping through interfaces and no handling of passwords or payments.

Why is there always a notification?

The wake listener is a foreground microphone service. Android requires a visible notification while the microphone is held, which is also your signal that it is listening. Stop the listener and it disappears.

What happens without an API key?

The backend still starts and the app still connects. Replies are replaced by a Burmese notice telling you to add LLM_API_KEY and restart — a deliberate, readable failure rather than a silent one.

Is this production ready?

No, and it does not pretend to be. It is a starter project that runs end to end. The security checklist and the roadmap are the distance between it and something you would ship.