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.
Android personal agent — starter project v2.0
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.
မင်္ဂလာပါ 💗 My Girl ပါ။ “Hey My Girl” လို့ခေါ်နိုင်ပါတယ်။
Help me draft a short note for tomorrow's meeting.
ရပါတယ်။ ဘယ်သူ့ကို ပို့မလဲ၊ ဘယ်လိုလေသံ သုံးမလဲ ပြောပြပါ။
Wake phrase beta: say “my girl”.
ElevenLabs render · the app speaks on-device
01Capabilities
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.
The message, your last twelve turns and your stored memories go to any OpenAI-compatible model. She replies in whichever language you wrote in.
Android SpeechRecognizer captures speech in my-MM or en-US, and TextToSpeech
reads the reply back — in Burmese when the device ships that voice.
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.
You enable it yourself in Settings. It exposes Back and Home only — no screen scraping, no arbitrary taps, no password or payment dialogs.
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.
Tasks are stored with a run time and checked by a WorkManager job. The worker is deliberately inert: it reports, it does not act.
Memories, tasks and every action request are written to SQLite, so you can see exactly what was asked for and what was refused.
02Limits
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.
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.
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.
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.
You enable the service yourself under Settings › Accessibility. The app cannot do it for you, and should not be able to.
The API contracts and extension points exist; the adapters do not. Ask her to check your calendar and she will tell you she cannot.
/api/actions/execute rejects approved=false with a 403, and returns 501 when
no adapter is configured. Nothing external runs quietly.
03Architecture
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.
Android · Kotlin / Compose
FastAPI · Python 3.11
SQLite
memories · tasks · audit
LLM provider
OpenAI-compatible endpoint
Request path
The service broadcasts WAKE_DETECTED and the app acknowledges in Burmese.
A user id, the message and up to twelve previous turns go to the chat endpoint.
Your twelve most recent memories are folded into the system prompt before the call.
Any OpenAI-compatible endpoint, temperature 0.7, a sixty-second ceiling.
The bubble renders, then the text is handed to Android TTS in the device locale.
| 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
Three stages, in order. The backend first, because the app has nothing to talk to until it is running.
Python 3.11 or newer. A virtual environment keeps the dependencies local.
Copy .env.example to .env and set LLM_API_KEY. Never commit that file.
Uvicorn serves on port 8000. Check /health, then open /docs.
# 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
gpt-4o-mini.*. Local development only.Android Studio with JDK 17 and SDK 35. Open the android/ folder, sync, then Run.
Emulator uses 10.0.2.2. A real phone uses your computer's LAN address.
Phone and computer on one Wi-Fi network, and port 8000 allowed through the firewall.
Tap Enable background wake, allow the microphone, and allow notifications on Android 13+.
Settings › Accessibility › Downloaded apps › My Girl Agent › On.
// emulator
buildConfigField("String", "API_BASE_URL", "\"http://10.0.2.2:8000/\"")
// physical phone on the same Wi-Fi
buildConfigField("String", "API_BASE_URL", "\"http://192.168.1.20:8000/\"")
Build › Build Bundle(s) / APK(s) › Build APK(s). The file lands in the debug output folder.
Generate a signing key, keep it outside the repository, and store the passwords in a vault.
HTTPS, real authentication, a privacy policy and a security review are prerequisites, not polish.
# debug
./gradlew assembleDebug
# android/app/build/outputs/apk/debug/app-debug.apk
# release (configure signing first)
./gradlew assembleRelease
05Security
Four decisions carry most of the safety here. Each one is enforced in code, not in a policy document.
01
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
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
The service declares canRetrieveWindowContent=false and canPerformGestures=false,
and exposes Back and Home only.
04
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
* with an explicit origin allow-list.06Roadmap
In order. The wake word comes first because everything else is harder to judge while detection is unreliable.
Now
A licensed hotword engine or a small TensorFlow Lite keyword model, with an honest offline fallback when the model is unavailable.
Next
Gmail, Calendar, web search and YouTube, each behind the existing action contract and each requiring approval before it writes anything.
Later
Accounts, per-user data isolation, a privacy policy, and a signed release pipeline with an audit trail you can actually hand to someone.
07FAQ
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.
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.
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.
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.
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.
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.
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.