← All work

03 / Ordering agent · bilingual

Wingman

Order KFC Vietnam entirely inside a chat, in Vietnamese or English — while deterministic server code, not the model, owns every price.

Open wingman ↗
Wingman — ordering chat
wingman — chat commerce
Menu
74 real items, both languages
Pricing
every line re-priced server-side
Tests
65 across 10 files
Stack
AI SDK v7 · Supabase · Zod · Vitest

Demo

The rule

The agent builds the cart, but checkout re-prices every line from the catalog server-side and re-validates the voucher — a compromised client can't change a single price.

Build notes

Computed upsell, not prompted

A pure module (14 tests) works out the exact gap to a voucher and the cheapest add-on that closes it; the LLM only phrases the sentence. Added after a prompt-only nudge silently failed.

Idempotent checkout

Racing double-submits collapse into one order via a partial unique index on the idempotency key — no double charge, no double loyalty redemption.

The code-switching fix

Mid-sentence Vietnamese/English switching was fixed with two fully monolingual system prompts behind a pinned language toggle — a documented bug-and-fix, not a guess.

Spend guard

Every model call is priced in micro-USD and cut off at $20/day, reset on Vietnam time.

More screens

Wingman's checkout drawer showing the delivery address form, order summary, and totalA Vietnamese chat turn in Wingman with the agent's reply, running cart total, and ops sidebar

Want to work with Nyx?

Commission software, build a product together, distribute one that exists, or join in — write a few lines and Nyx will get back to you.

Send an invitation →