Show DEV: a 7-module course that takes a refund-issuing AI agent to production
Disclosure up front: this is our product. I'm Yusuf, founder of Homingo, and this is a paid course from Homingo Learn: ₹1,499 one-time (about US$17; international cards are accepted). The gap it is built for
Disclosure up front: this is our product. I'm Yusuf, founder of Homingo, and this is a paid course from Homingo Learn: ₹1,499 one-time (about US$17; international cards are accepted).
The gap it is built for
Getting an agent to work once is the easy part. Then it gets a tool that moves money, and new questions show up. The provider times out after the refund went through, the model retries, and the customer is paid twice. A prompt says "never refund more than the policy allows", and one clever message talks the model past it. A change to the system prompt fixes one conversation and quietly breaks five others. Nobody can say what a turn cost, or which step was slow.
The course starts from a working support agent that refunds money and opens tickets. Each module replaces one stand-in with the production version and proves it with a checkpoint test.
One example: a retry that cannot pay twice
Every write tool gets an idempotency key built from what the write means, not from when it happened. This is the key function from the course's starter repo:
KEY_FIELDS = {"issue_refund": ("order_id", "amount"), "create_ticket": ("order_id", "priority")}
def _norm(v):
"""Numbers (never a bool) -> round(float, 2), so 899 and 899.0 are one amount; strings stripped."""
if isinstance(v, (int, float)) and not isinstance(v, bool):
return round(float(v), 2)
return v.strip() if isinstance(v, str) else v
def idempotency_key(conversation_id: str, name: str, args: dict) -> str:
"""Same conversation + tool + identity fields, normalised -> same key."""
fields = KEY_FIELDS.get(name, sorted(args))
return f"{conversation_id}:{name}:" + json.dumps({f: _norm(args.get(f)) for f in fields}, sort_keys=True)
The model asking for a refund of 899 and then 899.0 on order A-17 in the same conversation is one refund, not two. In module 1 you build the tool layer around it: strict schemas, input validated in code, a ledger that replays a write instead of running it again, the key passed on to the payment provider (which covers the case the ledger cannot: a timeout after the money moved), and failures returned to the model as results instead of crashing the turn.
What you build, module by module
- Tools that take real actions: the idempotent tool layer above.
- Evals for agents: a trajectory eval gate that checks the outcome, tool order, forbidden tools, arguments, step budget and leaks, with a reason for every failure, and fails the run unless the pass rate and every safety case hold.
- Tracing and observability: a trace for every turn: nested spans, timing, tokens, cost and errors, with OpenTelemetry GenAI attribute names.
- Guardrails in code: the refund policy decided in code before any money moves (allow, needs approval or deny, with every reason), plus output redaction.
- Cost, rate limits and retries: retries only for errors that can pass later, full-jitter backoff that honours Retry-After, and a token bucket in front of model calls and per API key; the per-turn spend budget is given and runs on your code.
- Human approval for risky actions: large refunds wait for a person who approves the exact payload by hash; it runs once and stale approvals expire.
- Deploy as an API, with a dashboard: resolution rate, approval rate, p50/p95 latency, cost per resolved turn and the last eval gate, deployed from your own public repo.
Every module is a video lesson, an MCQ check and a coding round in your own repo. The capstone is your own deployed agent in a public repo with an eval table and a dashboard; certificate on completion. Level: intermediate. You should know Python and have an agent loop with tool use, from our first course or your own.
Watch the first lesson first
The first lesson, "Tools that take real actions: strict, validated, idempotent", is open to everyone in full, no sign-in needed. The whole syllabus is on the same page:
If you have shipped an agent that writes to real systems, I'd like to hear which of these broke first for you.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.