Case study — 03
zcom.
Merchants had sales graphs, not decisions. I built zcom's first AI layer around one rule: code calculates, AI explains.
- Role
- AI layer · Zerror Studios
- Type
- Zerror Studios
- Year
- 2025
- Stack
- Claude API · MCP · GraphQL · Node.js · MongoDB
01
The product
zcom is a multi-tenant e-commerce platform. Merchants could see their sales, but couldn't answer the questions that matter — am I making money, what's my break-even, is my marketing paying for itself? There was also no AI on the dashboard at all.
02
What I built
Layer 1 of ZCOM AI: a metrics engine that computes about 50 business metrics per store on a schedule; a Business Insights tab that renders them at zero AI cost; Ask ZCOM, a dashboard chat that answers questions from those metrics; per-plan AI limits; a super admin AI section for usage and cost; and metering for the zcom MCP connector so merchants' own Claude uses the same tools and limits.
03
The hard part
Trust and cost. The model never sees raw orders and never does arithmetic — fixed, tested formulas produce the numbers, and Claude only explains them. Every store's data stays inside its own tenant, and answers respect each staff member's permissions, so an owner's profit figures never reach someone who can't see profit.
On cost, merchants see questions per week rather than tokens, with a global daily spend cap behind every plan.
04
How it was built
Node.js services behind a federated GraphQL gateway, with a database per store in MongoDB. The metrics engine runs as scheduled jobs and writes snapshots; the chat uses the Claude API with a cached, byte-stable system prompt built from the snapshot, plus small read-only tools. A daily “What to do next” summary runs through the Batch API.
05
Outcome
Layer 1 gives merchants decisions instead of graphs, at a predictable cost to the platform. It also lays the data groundwork — bought-together and return-reason aggregates, attribution and customer segments — for the next layer: a storefront assistant and semantic product search.