Context
Questions from the team — about Jira work, mail, documents, and media — arrive at all hours, in Thai, often as a photo, a voice note or a clip rather than a sentence. Anna answers on Discord in voice and text with real tools behind her; until August 2026 she also answered customers about pawn tickets, payments, branches, and valuations.
What I built
- A 17-service Docker Compose stack deployed to a VPS through GitLab CI with a health gate and automatic rollback; every model call goes through a self-hosted 9Router gateway, with per-workload combos that can be switched from its dashboard without a redeploy.
- 17 MCP tool servers written in-house for Anna — 11 in Node.js and Express, 6 in Python — 9 of them in production today, so the model calls real systems natively: mail, file publishing and document building, image and video generation and editing, media understanding, YouTube, astrology, and host operations. The customer-era servers (payments API, product catalog on SQLite FTS5, image-based appraisal, knowledge search) retired with the customer channel; Jira runs on the open-source mcp-atlassian server.
- An output-side guard plugin covering information leakage, PII, and model-identity disclosure, plus per-user authorization and audit gates on Jira, mail, and tool calls — hardened over repeated adversarial red-team rounds; one pass closed 21 leak classes and 14 over-block classes.
- A per-turn EASY/HARD model router built after measuring real token usage — one cheap classification call picks the model, and each turn stays on a single model so the prompt cache is not split. Built and measured; left disabled behind a kill switch.
- Thai voice two ways: realtime through GPT-Live, which talks at phone-call latency and hands tool work to the agent under a $3 daily budget, and the classic STT, TTS, and VAD barge-in loop it falls back to — where end-of-turn silence detection went from a hardcoded 1.5s to a tunable 0.9s, taking a fixed 0.6s off every voice turn.
- services running in the stack
- 17
- in-house MCP servers in production
- 9
- pytest tests passing
- 2,300+
- prompt tokens served from cache, two weeks to 13 Aug 2026
- 81.3%
Stack
- Python
- Node.js
- MCP
- 9Router
- OpenAI GPT
- Gemini
- Docker Compose
- GitLab CI
- SQLite FTS5
- Discord
Built on the open-source hermes-agent base and routed through the open-source 9Router gateway. The MCP sidecars, guard plugins, model router, compose stack, CI, prompts, and evaluations are mine; the agent framework and the gateway are not.