Latitude E6430 · Ubuntu · this repo
The laptop
The laptop is the library and the voice. The phone can work alone. When they are on the same network, the phone can ask the laptop and trade teachings.
Open it
/home/crimsonpeer/Documents/Aegis-Terminal/aegis
From the project folder that is ./aegis. The app menu name is Aegion. ./aegis --classic opens the older GTK and WebKit window for one more release. ./aegis-lite is a terminal client and is the one to use while Cursor is open. The command aegis with no path is an older launcher in ~/.local/bin that kills port 8000 and starts main.py directly. Use the path above.
What is running
| Piece | Port | Role |
|---|---|---|
| Backend | 8000 | FastAPI in .venv. Answers, ingest, trainer, handshake. User service aegis-backend, about 105–120 MB idle, no model warm-up. |
| Kokoro | 5050 | Speech, its own Python env because of torch. POST /synth returns WAV. |
| Ollama | 11434 | Optional phrasing. Off unless Local AI is on and 1600 MB is free. Unloads after 5 minutes. |
| Artemis | — | Vosk, two recognizers, microphone. Started with the desktop window, not with the idle backend. The keyboard’s mic uses only the open recognizer. |
| Login proxy | — | User service aegis-proxy rewrites the phone proxy before the backend starts. The network script restarts the backend if that address changes later. |
| Aegion window | — | Kivy, mobile/main.py, phone-shaped and resizable. |
| Classic window | — | desktop.py on system Python, because GTK lives there. |
How an answer is chosen
Handshake, at http://127.0.0.1:8000/handshake, is the control room: the handoff bundle, live tests, storage sizes, trainer counts, and the microphone. The red button on the launcher opens it. Voice can too: “open handshake”.
Voice
“Artemis” arms the listener. “Artemis, activate Aegis” opens the question page and listens. “Artemis, run query” plus the question searches and reads the answer. “Go home”, “open shield”, “mute”, and “exit” are commands. If the microphone permission is off, Artemis does not start and the header says so.
On-screen keyboard
A separate window, aegis-keyboard, types into whatever is focused by sending real key events. You drag the AEGIS title to move it and the corner to resize it. The place is remembered in ~/.config/aegis/keyboard-window. It does not grow when you want emoji: a title-bar button opens a small set and pastes the character. GIFs and photos stay on the phone keyboard. The space bar used to grab the pointer and then never release it, which froze move and close without crashing the process. That grab is gone in the working tree.
The title bar also has mail and mic. Mail lists addresses you typed on this keyboard, stored only in ~/.config/aegis/keyboard-emails. Tap one to paste it, edit to change it, or the small × to remove it. The laptop’s hardware keys do not pass through this window, so they are not saved. Mic starts keyboard_dictate.py under .venv. That is the same Vosk model as Artemis, open vocabulary only, no wake word. A pause of about a second types the phrase, capitalised, with a trailing space. Tap stop to finish early. The model unloads after three quiet minutes. If the Aegion window is already listening, only one of them can hold the microphone.
GNOME’s overview hides ordinary windows, including ones marked always-on-top. The keyboard is drawn as an override-redirect popup, and the extension aegis-keyboard-above@aegis shows that layer while the keyboard is open, so it stays in front of “Type to search.” The extension is enabled and loads again at the next login. The keyboard itself is in the session autostart list, delayed a few seconds so the shell is up.
The phone as the internet
When the Tank hotspot or the USB tether is the default route, proxy_switch.py points GNOME and new shells at the phone. HTTP is port 8080. SOCKS is port 1080. Apt does not inherit a shell variable under sudo, so a small file in /var/tmp is what apt reads on every update. Snap is set from the same file. New terminals pick up http_proxy from ~/.config/aegis/phone-proxy.env. When the Tank is not the default route, the proxy turns off.
On a cold boot the network can come up before you log in, and the dispatcher then has no session bus, so it used to leave yesterday’s gateway in place. A login service now applies the proxy first, and the backend reads that file when it starts. If the phone’s address changes later, the dispatcher restarts the backend onto the new one. Localhost, including Ollama, stays off the proxy.
What a restart brings back
| When | What |
|---|---|
| Boot | Ollama, with qwen2.5:1.5b and llama3.2:1b already on disk. The weights are not retrained. |
| Login | Phone proxy, then aegis-backend and Kokoro. The on-screen keyboard a few seconds later. The search-layer extension. |
| Not at login | The Aegion window. Open it with the path above, and not while Cursor is open. |
The free learner
Curious runs inside the backend whenever you are logged in. It uses Wikipedia and Wikidata, no paid key, and no local model. It waits ten minutes after a question, then studies subjects it has already seen. A fact is kept only when the article and Wikidata agree. State is data/curious.json plus the DuckDB library, so a reboot does not wipe it. It had been stuck on network errors because the service was not using the phone proxy. With the proxy in the service, an evening snapshot on 4 October read: 300 topics noted, 58 facts kept, 7 disagreed, 33 waiting. Those counts move. This page does not.
The browser
Firefox is the installed browser. A system policy turns popup blocking on and force-installs uBlock Origin 1.75.0 with EasyList, EasyPrivacy, and the popup and annoyance lists. Quit Firefox once after that policy was written so the open window picks it up. Chrome is not installed. A hosts-file block was not added: it does not stop window.open, and it can break apt and the phone proxy.