Yashotantra Academy logo
level 1
Curious · 0 XP
streak
0d
perfect
0
badges
0

100 XP to Apprentice

Projects · hard

14. Capstone: production-ready AI feature

Ship one feature with every operational control wired and proven.

1 min read2 questionsup to 50 XPtopic 14/14

Read in another language

AI translates the explanation and quiz text while preserving code and answer scoring.

Take an existing AI feature to production standard.

Checklist

1. Single choke point — all model calls flow through one wrapper. 2. Security — input screening, untrusted-content labelling, PII redaction, read-only tools on untrusted paths, egress allow-list, output guardrails with metrics. 3. Observability — one trace per request with tokens, cost, retrieval ids, and sampled quality scores; dashboards for cost per success, p95 latency, groundedness, guardrail hits. 4. Cost control — usage table, per-user and global caps, prompt caching, model routing, correct 402/403/429 handling. 5. Memory — governed facts with dedup, decay, user visibility, and deletion. 6. Automation — idempotent scheduled jobs with concurrency caps and a paused-state check. 7. Release — versioned prompts, pinned model ids, offline suite in CI, canary flag, tested rollback. 8. Governance — data map, decision records, erasure job.

ts
export const health = {
  costPerSuccessUsd: () => q("select sum(cost_usd)/count(*) from ai_usage where created_at > now() - interval '1 day'"),
  groundedness: () => q("select avg(score) from ai_scores where name='grounded' and created_at > now() - interval '1 day'"),
  guardrailHits: () => q("select name, count(*) from ai_guardrails group by 1 order by 2 desc"),
};

Ship criteria: the dashboard answers cost, quality, and safety questions without a code change; the rollback has been executed at least once in a drill.

Exercise: complete the checklist for one real feature and write a one-page runbook naming the owner, the alerts, the kill switch, and the rollback procedure.

How to study this topic

  1. 1. Read the explanation once end to end, skipping the code.
  2. 2. Re-read the code snippets and say out loud what each line does.
  3. 3. Answer the quiz without scrolling back — that is the real check.
  4. 4. Read every explanation, even for the answers you got right.

Scoring

  • · Up to 30 XP from quiz accuracy.
  • · +15 XP for a perfect first attempt.
  • · +5 XP while a 3-day streak is running.
  • · 75% or higher marks the topic complete.

Check your understanding

  1. 1. Which single metric best summarises an AI feature's efficiency?

  2. 2. What proves a kill switch works?

Badges

First light
Pass your first topic
Sharp shooter
3 perfect first-try quizzes
On a roll
Study 3 days in a row
Week warrior
Study 7 days in a row
Grinder
Earn 500 XP
Deep diver
Earn 1500 XP