A coach for live sellers
A coaching and analytics system for live-commerce sellers that turns the vague feeling at the end of a live into real signals — it reads the host's mood and live comments with on-device ML, flags what matters, and sends only encrypted derived signals to a cloud data plane designed PDPA-first from the architecture up.

A coaching and analytics system for live-commerce sellers: an Electron desktop app with a built-in browser for watching the live, reading the host's mood, smiles and attention with on-device ML while pulling live comments, then sending only derived signals to a cloud data plane (NestJS) that is encrypted and fully PDPA-compliant.
The problem
A live seller has to talk, sell and read a fast-moving comment stream all at once. How do they know what to do right now?

During a live, the host can't see themselves. They don't notice their energy dropping, their face looking tired, or the same price question coming up again and again without an answer. Comments move faster than anyone can read. When the live ends, all that's left is a vague feeling about how it went, with no real data to review or coach from.
Comments move too fast to read
At peak, hundreds of comments come in per minute — price questions, objections and product questions all mixed together. A host who is mid-sentence can't pick out what matters.
The host can't see themselves
Energy dips, the smile fades, eye contact with the camera drops. These hurt sales, but the person in front of the camera is the last to notice.
Nothing to review after the live
There's no record of when viewers were engaged, when they dropped off, or how mood and comments relate — so coaching across sessions runs on gut feeling.
Sensitive data, no room for error
The system touches faces (biometrics) and viewer comments. That data needs consent, encryption and deletion on request under PDPA — doing it halfway isn't an option.
Scattered data, no way to build on it
Signals from each live sit on whichever machine ran it. With no central store, there's nothing to build reports, cross-session coaching or integrations on.
The solution
Make the app a "silent coach": it watches the live, reads the signals people miss, and only flags things the host can act on within 60 seconds.

Desktop app with a built-in browser and comment capture
Electron with embedded Chromium opens the live inside the app and pulls comments and engagement in real time through a live-comment connector — link channels and watch several lives in one place.
Reads the host's mood with on-device ML
A local ML server (Python/FastAPI) reads the face — emotion, smiles, talking and eye contact — in real time. The video never leaves the machine; only numbers are passed on.
A live HUD that stays out of the way
A sidebar shows live KPIs and only flags things that can be acted on right away (e.g. "price asked repeatedly", "energy dropping") — a silent advisor, not a flood of notifications.
Cloud data plane for signals and compliance
The NestJS backend receives AES-256-GCM encrypted derived signals and handles consent, audit, erasure and k-anonymity — ready for reports and cross-session coaching.
Data agreements locked down with contracts
The @live-ai-avatar/contracts package defines F1–F5 with JSON Schema 2020-12, OpenAPI 3.1 and Ajv — desktop and cloud speak the same schema and never drift out of sync.
How it works — 4 steps
From opening a live to live signals plus a record you can coach from later

Open the live in the app
The embedded browser plays the live and captures comments and engagement in real time
ML reads the signals
A local server reads the host's face and classifies comment intent, all on the machine
Live HUD alerts
Shows KPIs and advisor nudges · an encrypted offline buffer holds data first
Send to the cloud
Push signals (idempotent) → historical reports and compliance
Tech Stack & Architecture
A monorepo (pnpm + turbo) with 3 apps and 1 contracts package — video is processed on the machine; only encrypted signals go to the cloud

Monorepo (pnpm + turbo) keeps desktop, backend, web and contracts in one place with shared types · Hexagonal NestJS (ports/adapters) — separates business logic from the store, KMS and alert sink, so testing and swapping implementations is easy · Local ML server processes video on the machine — fast and private (no images go to the cloud) · Contracts-first — the schema is the source of truth, so desktop and cloud can't drift apart, caught at compile time
What I built — 8 core capabilities
The full loop, from capturing signals on the live page to compliance in the cloud

Embedded Live + Comment Scrape
Electron embeds a browser to open the live and pull comments and engagement in real time. Link the channels you follow and open several lives in one app.
Local Emotion / Identity ML
MediaPipe FaceMesh (52 blendshapes) + MTCNN/FaceNet enrollment + ViT 7-class emotion — reads smiling, talking and looking at the camera in real time, on the machine
Live KPI HUD
The sidebar shows emotion, energy and smile live, with 1-minute and 5-minute rolling windows per track — trends are visible during the live
Silent Advisor (60s nudge)
Catches signals that can be acted on right away, such as a price cluster in the comments or an energy drop — alerts are suppressed so notifications never pile up
Encrypted Offline Buffer
Signals are buffered offline-first on the machine, then pushed to the cloud with a high-water-mark — resends are idempotent, so a dropped connection loses nothing
PDPA Consent + Erasure
A dual-layer consent gate before anything is stored, plus an erasure worker that deletes data from every store on request — biometrics must be encrypted and truly revocable
Tamper-Evident Audit
A WORM sink + hash chain makes an audit log that can't be edited after the fact, plus provenance export — data origin can be proven during an audit
F1–F5 Data Contracts
JSON Schema 2020-12 + OpenAPI 3.1 + Ajv validators + fixtures — versioned with a compat check to prevent breaking changes between services
The interface — Live Session HUD
During a live, host signals, comments and actionable alerts on one screen


| Signal | Value | Details | |
|---|---|---|---|
| Emotion | Happy 0.71 | smile · looking | HUD |
| Comment | Price asked ×3 | intent: price · cluster | alert |
| Energy | ↓ 0.48 | 5m rolling window | report |
POST /v1/ingest · { emotion:'happy', energy:0.48, intent:'price' } → 202 buffered
Hacks and problems
6 problems I had to solve myself — real-time ML, privacy engineering and contracts across services

Raw emotion from live video is jittery and noisy
Raw FER output jitters every frame — a slight smile jumps to "happy 0.9" and snaps back to neutral. You can't trigger alerts from it directly.
neutral_bias / smile_boost / frown_gate, then filter with EMA smoothing and 1m/5m rolling windows — the signal becomes stable enough to trust and alert on, with the limits (FER+ class imbalance) known from the startRead the host's face without letting video leave the machine
A face is the most sensitive kind of biometric — sending frames to the cloud for processing is a risk for both privacy and latency
localhost:8765) processes on the machine and sends only numbers (emotion/energy/intent) to the cloud — 0 video frames leave the machine, a principle decided at the architecture stageDesktop and cloud easily drift out of sync
The two sides use different stacks (TypeScript/Electron ↔ NestJS) — when a payload changes on one side, the other breaks silently at runtime
@live-ai-avatar/contracts — F1–F5 as JSON Schema 2020-12 + OpenAPI 3.1 + Ajv validators + fixtures + a scripted compat check, so breaking changes are caught in CI, not in productionThe ML detector is fast on Windows (GPU) but also has to run on mac
The YuNet detector on onnxruntime CUDA is very fast on Windows — but there's no CUDA wheel for mac arm64, so installing the requirements as-is fails
sys_platform == "win32") installs onnxruntime-gpu only on Windows, while mac falls back to cv2.FaceDetectorYN (CPU) automatically — one codebase runs on both OSes without branchingA dropped connection mid-live means lost or duplicated signals
A live sends signals continuously, but connections during a live are unreliable — a failed send loses data, a resend duplicates it
high-water-mark — ingest is idempotent and drops batches below the watermark, so resends are safe: nothing lost, nothing duplicatedBiometric data must be truly deletable and provable
PDPA isn't just "having a delete button" — data has to be deleted from every store, with tamper-proof evidence of who did what to the data and when
all-stores-registry + a WORM audit log with a hash chain (no retroactive edits) + provenance export — consent, deletion and proof work as one system, not a bolted-on featureDeliberate design decisions
What I chose not to build matters as much as what I built — especially around sensitive data

The rule set at the start: video and faces are processed on the machine only — the cloud receives only encrypted derived signals, no frames and no raw images. Everything requires consent first, is encrypted in transit, and can actually be deleted. A sharp privacy boundary makes implementation decisions easy and defensible.
On-device inference
Faces are read on the machine; only numbers go to the cloud, no frames
Consent before capture
A capture gate comes first: no consent, no data
Encrypted from the buffer
AES-256-GCM from the machine all the way to the cloud
Contracts-first
The schema is the source of truth, not either side's code
Knowledge domains I grew in
5 areas where this project genuinely raised my level

I wired up a real pipeline — MediaPipe FaceMesh (blendshapes + head pose) + MTCNN/FaceNet enrollment + ViT-FER — and learned that raw output can't be used directly. It needs calibration (neutral_bias/smile_boost), EMA, rolling windows and an understanding of model bias. Lesson: in production ML, 20% is the model and 80% is calibration and knowing its limits.
I structured the backend as ports and adapters — business logic (ingest/consent/erasure/audit) doesn't know about Postgres, KMS or the alert sink directly; it talks through ports, so it can be mocked in tests and implementations can be swapped. Lesson: hexagonal design makes compliance logic testable without real infrastructure.
I implemented two-layer consent, AES-256-GCM with a KMS port, erasure across every store, a WORM audit log with a hash chain, k-anonymity and breach detection — and came to understand how data law translates into code. Lesson: "truly deletable and provable" has to be designed into the data model, not added later.
I built a versioned contracts package (JSON Schema 2020-12 + OpenAPI 3.1 + Ajv + fixtures + compat check) as the shared agreement between desktop and cloud. Lesson: with the schema as the source of truth, breaking changes are caught in CI — many times cheaper than finding them in production.
I managed a pnpm + turbo workspace of 4 packages, electron-vite builds, cross-platform ML (env markers), and electron-builder for dmg/nsis-web with auto-update. Lesson: shipping a desktop app with native and ML dependencies is harder than it looks — the env matrix, packaging and fallbacks need planning from the start.
