← All projects
AI2026AI Implementation Lead

AI Agent Integration — OCB Group

Integrated OpenAI, Gemini & Anthropic agents into internal retail ops, automating core workflows across nationwide branches.

Outcome40 outlets · 150+ users · 5 systems
Stack
OpenAIGeminiAnthropicNode.jsBunPythonPostgreSQLMySQL
Problem

OCB Group ran 40 retail outlets and 150+ staff across Kalimantan entirely on paper: attendance in notebooks, KPIs scored by gut feel, deposits reported over WhatsApp with no reconciliation, and payroll hand-computed over three days at month-end with a 5–8% error rate. The hard constraint was integrity — employee identity had to stay consistent across every system, or payroll would pay the wrong person.


Solution

Designed a distributed monolith: five apps, each owning its own database, joined by read-only cross-database references and a single server-to-server roster sync — one writer for employee identity, everyone else reads. An AI layer handles receipt OCR (vision model → validated JSON → reconciled against IPOS) and KPI scoring across 34 weighted SOP tracks. Deployed on one VM over Tailscale behind a Cloudflare Tunnel, with Telegram alerting instead of a dashboard nobody opens.

System architecture

A distributed monolith, on purpose

Five apps, each owning its own database, joined only by read-only cross-database references and a single server-to-server roster sync. One writer for employee identity; everyone else reads. Not microservices — clear ownership boundaries without the operational tax.

01

Clients

40 outlets · 150+ users

  • Cashier / PICweb
  • Supervisorweb
  • Field staffPWA · .apk
  • Telegram botdeposit audit
02

Applications

5 systems · own DB each

  • AttendanceNode · Express — source of truth
  • KPIBun · TS
  • DepositsBun · Svelte 5
  • PayrollBun · 3 pools
  • AssetsExpress · PWA
03

AI layer

validated at the boundary

  • Receipt OCRvision → JSON
  • KPI scoring34 SOP tracks
  • Schema validationbefore persist
04

Data

read-only by contract

  • identity DBread/write — 1 writer
  • kpi DBread-only to payroll
  • payroll DBread/write
  • asset DBPostgreSQL
  • POS systemreconciliation source
05

Infrastructure

deliberately boring

  • Single VMHyper-V
  • Tailscaleprivate mesh
  • Cloudflare Tunnelingress
  • PM2zero-downtime reload
  • Telegram alerts~5s to phone
Load-bearing rules
  • One writer for employee identity. Every other system reads it and never writes back — integrity is structural, not a code-review convention.
  • Payroll's upstream pools are read-only by contract, so it can physically never corrupt data other systems depend on.
  • AI output is validated at a boundary before it touches the database; the model assists, a human decides.
  • Roster sync is server-to-server with a shared key — eventual consistency on the roster in exchange for zero write contention.
  • Alerting lands where the on-call already is (Telegram), not on a dashboard nobody opens.

Highlights
Read the full teardown ↗
Next project
HuluTalent — Performance Management System→