Day 4: A break from theory — building a real IT department for Examino
After three days of LLM theory, today I stopped to build something that actually runs: a Zalo bot acting as the IT department for Examino, listening to support requests from language centres, recording them and replying — running on the mini PC at home.
The first three days of this journey were all theory: tokens, choosing a model, streaming. The knowledge was real, but the practice project at the time — a document summarizer assistant — honestly wasn't pulling me along. It was too generic; nobody would ever use it.
So I changed direction: the single project from here on is a service that acts as the IT department for Examino — my platform for running language centres. Centres using Examino send support requests every day through Zalo groups: bug reports, how-to questions, feature requests. The long-term goal is an "IT staff member" that listens to those requests, analyses them, and then either answers on its own or escalates to me for a decision. Tonight was about building the first working frame — and it actually runs.
The road into the mini PC#
The service will live on the mini PC at home, next to the existing Examino repo. I connect to it over Tailscale, SSH-ing in as a regular user. Sounds simple, but the very first step taught a lesson: Tailscale SSH has a periodic check mode — every so often it makes the user click a link to re-authenticate before letting you back in. One click covers a whole time window (about 12 hours by default), but a system meant to run 24/7 on its own has to reckon with that click. Noted, to deal with later.
The Zalo bot: an unofficial library and a sacrificial account#
Zalo offers no official API for a personal account to listen to group messages. The only way is an unofficial library — I picked zca-js, which simulates Zalo Web: QR login, message events, sending with quoted replies. The risk of this road is that the account can get locked, so the bot runs on a separate secondary account, displayed as "Examino Platform" — if anything happens, my main account is untouched.
The first login is a QR scan; after that the session is saved on the machine so the service can log itself back in on every restart. The listening part, trimmed down, looks like this:
api.listener.on("message", (message) => {
if (message.isSelf) return; // ignore the bot's own messages
if (message.type !== ThreadType.Group) return; // only handle group messages
// ... check the group is on the allowlist,
// then append one JSON line to messages.jsonl with the raw message data
});
api.listener.start();Every message in a designated group gets recorded: time, sender, content, and the raw message data — so a reply can later quote the exact message it answers.
Version one: keyword replies, and why they are naive#
In the first version, the bot decided whether to reply by matching content against a keyword list: "error", "can't log in", "add a feature", "why"... A match got an "acknowledged" reply; no match meant silent logging.
It worked immediately, but look closely and the naivety shows:
- "checked again today and there's no error anymore" — still caught, because it contains the word "error", even though it isn't a request at all.
- "I want to review last night's class scores" — matches no keyword and gets skipped, even though it is a genuine request.
A keyword list can never keep up with how people actually phrase things. This part needs a brain that reads intent — and that is where I decided to try a different architecture.
Inverting the architecture: the bot is ears and mouth, the AI is the brain#
Instead of plugging a model's API key into the bot (the "textbook" AI integration), I let the AI assistant learning alongside me play the brain, at least for the trial phase. The bot on the mini PC keeps only two jobs: listening and sending on command. Between them sits a file-based queue:
message arrives in the group
-> bot appends it to messages.jsonl
-> the AI periodically reads new messages + the conversation before them,
decides which ones truly need a reply, drafts the reply,
appends it to outbox.jsonl
-> the bot watches the outbox and sends the reply, quoting the originalThe nice property of this split: the "brain" becomes a replaceable part. Today it is my AI assistant; later, when I want to box it up with an API key so it runs 24/7 by itself, I swap exactly one component — the bot and the queue stay untouched.
The checking rhythm turned out to be a design problem of its own. I started with a job running every 10 minutes, then lowered it to 5, then 3 minutes for testing. But an agent waking every 3 minutes to check, when most of the time there is nothing, is wasteful. The final form is a hook: a very light script glances at the log every 3 minutes (comparing just two numbers: total messages vs. processed messages), and only wakes the AI up when there is actually something new. A proper event-driven shape, and a script is far cheaper than an agent.
The few minutes of delay here are not a bug — they are deliberate: let people finish saying what they mean, gather the whole conversation, then settle on one reply, instead of mechanically nodding at every single message.
Running for real tonight#
Playing the customer, I messaged the test group from my main account:
23:20:46 me: removing a student from the class but attendance still counts them
23:20:51 me: check this for me @Examino Platform
23:23:36 bot: We have recorded your report about a student being removed
from the class while the system still counts them in
attendance. We will check the attendance logic for removed
students and get back to you as soon as possible. Please
send us the class name, the student's name, and a screenshot
of the steps you took so we can verify precisely.Two messages were merged into one request, answered exactly once, with a total wait of 2 minutes 50 seconds. But that first reply was far too wordy — I had the drafting rules tightened: at most 1–2 short sentences, asking for at most one key missing detail. Replies after that got visibly shorter, like the one at 23:47: "We've noted your question about a mobile app for staff, and will check and get back to you as soon as possible."
Another case surfaced in the same test session: when I sent follow-up details for the earlier request (class name, specifics), the bot stayed silent — because that request was already marked "answered". From a support standpoint, a customer sending more information and hearing nothing back is bad. The rule was patched on the spot: a follow-up to an acknowledged request gets exactly one short confirmation.
And one moment I was genuinely pleased with: when I asked "is there a mobile app yet? can staff use it?", the bot did not make up an answer. It acknowledged the question and said it would check — because it (and I, playing the brain at that moment) wasn't sure about the product facts. Not knowing means saying you'll check, instead of bluffing — I wrote that principle straight into the system's operating rules.
For now#
The current system can only listen, record, and acknowledge requests thoughtfully. It cannot yet analyse the repo, fix anything itself, or answer specialist questions — those are later stages, and each will attach to this exact frame that is already running for real.
Three days of theory taught me how a model works. One evening of building something real taught me how a system lives: it gets blocked by two-factor checks, by unofficial libraries, by wordy drafts, by edge cases that only appear when a real person sends a real message. The two need each other — but honestly, tonight was the first study session I was sorry to stop.
Related posts
Day 3: Streaming — words that arrive gradually, and a lesson about waiting
Day three of learning AI engineering: what streaming actually changes, how Gemini sends results chunk by chunk over SSE, and what a 10-second TTFT taught me that the docs don't mention.
Day 2: Choosing a model, and teaching the app to count money
Day two of learning AI engineering: why there is no best model, how to read Gemini's pricing, and the --model feature that lets my AI document assistant estimate the cost of every call.
Day 1: Starting my AI Engineer journey, and the decision to build only one project
Day one of teaching myself AI engineering: why I dropped the one-project-per-phase plan, committed to a single AI document assistant, and what I learned about tokens, context windows, and temperature.