▶ Sign up free for the video, slides & prompts
The lesson below is open to all. Enter your email once to unlock every video, slide deck, prompt and code example on this device.
Checking…
AI Agents in Production · Lesson 13 of 14 · 2 min read · 7 min video
Project: a support agent for a Vizag business
Build a production-ready customer support agent end to end.
📄 Download slides (PDF)· free sign-upTime to put it all together. You'll design a customer support agent for Sagar Sweets, an imaginary sweet shop on Dwaraka Nagar that takes WhatsApp orders. It answers order questions, handles changes and asks a human before any refund.
1. Scope it
Write down what it does and doesn't do:
- Does: order status, delivery time, shop hours, change delivery slot, request a refund
- Doesn't: take payments, give medical or allergy guarantees, or discuss anything unrelated
2. Tools, sorted by risk
Every tool takes the customer ID from the session, not from the model, so it can never touch someone else's order.
3. Guardrails
- Validate refund amounts and order IDs with a schema
- Code-level rule: a refund can't exceed what the order cost
- Output check: no order numbers or prices that didn't come from a tool result
4. Memory and state
- Short-term: the current chat, trimmed to the last 10 turns plus a summary
- Long-term: language preference and usual delivery area
- Checkpoint after every step, keyed by chat ID
5. Approvals
A refund request pauses the run and sends the owner a WhatsApp summary with Approve or Reject. Approval resumes the run, and rejection makes the agent explain politely and offer a handoff.
6. Evals
Write 40 test chats: normal questions, Telugu-English messages, wrong phone numbers, a customer asking for someone else's order, and an injection attempt hidden in a message. Check the outcome, the tools used and the cost.
7. Observe and deploy
Trace every run, alert if cost per chat goes over ₹3, run it as a queued job behind the WhatsApp webhook, and release to 10% of chats first.
In one line
A production agent is a narrow scope, risk-sorted tools, code guardrails, deliberate memory, human approvals, evals, tracing and a careful rollout, all working together.
Share with a friend