Production AI agent · n8n
Shipping an AI agent to a real shop.
A Nepali-language ordering agent for Karki’z cakes on WhatsApp and the website. Customers write Nepali, Roman Nepali and English, often in one message, and send voice notes, photos and payment screenshots.
The problem
Five constraints that shaped it
- 01Customers write Nepali, Roman Nepali and English, often in one message.
- 02Orders arrive as voice notes, photos and payment screenshots.
- 03A non-technical owner must change behaviour without calling me.
- 04Money is involved: the model must never decide a payment.
- 05It must fail loudly. No silent drops.
The architecture
One message, seven stages
- WhatsApp · 360dialog
- Website chat
- Webhook
- Dedupe
- Voice → speech-to-text
- Image fetch
- Chat paused for team?
- Owner settings
- Debounce
- LLM
- Memory
- 5 SQL tools
- Structured output
- Feature flags
- Items valid?
- Date valid?
- Fee calculation
- Reply + photos
- Payment QR
- Save order
- Telegram alert
- PostgreSQL
- Admin panel
- Inbox
Tools are SQL. Guards are code. The LLM sits in the middle, not on top.

The engineering decisions
Seven decisions that kept it reliable
- 01
The model proposes. Code decides.
The owner’s feature switches are re-checked in code after the model answers, so “off” really means off. Totals and fees are computed in SQL, never by the model.
- 02
Structured output, not free text.
One reply for the customer and machine-readable fields for the workflow. A parser fixes the shape before anything downstream runs, and the agent never writes to the database.
- 03
Tools, not memorised facts.
Five SQL tools (cakes, occasions, delivery zones, time slots, payment methods) mean a price changed in the admin is used by the bot on the next message.
- 04
Reading payment proofs, carefully.
A vision model reads the paid amount and a backup model tries if the first cannot. The result only flags the order for the owner to confirm; the AI cannot mark it paid.
- 05
Behaviour as data.
The owner flips switches, edits FAQs and adds holiday notices in an admin panel, and a Postgres function composes them into the prompt.
- 06
Humans stay in the loop.
One inbox for WhatsApp and web chats. A staff reply pauses the bot for that customer, and the owner is alerted on Telegram when it needs help.
- 07
Test on a copy, never the live shop.
Tests run on a copy of the workflow with every send node disabled and fake phone numbers, and each deploy is diffed node by node.
Result and status
In production for Karki’z Cakes


What broke, and what changed
- Website chat went silent for about an hour.A regenerated workflow was left inactive.Now: check every workflow’s active flag after each deploy.
- A test left the bot stuck on “always English”.A customer writing Roman Nepali got an English reply.Now: tests restore production defaults.
- Meta rejected Nepali-script documents, twice.It happened during WhatsApp business verification.Lesson: compliance is part of the system design.
Original slides and recorded demos 16 slides
2 / 16Recorded demonstration, not a live connection to the shop.









