1 · The store chatbot
It sounds confident. It's making things up. Your online store launched a chatbot to answer customers' questions. It's just a prompt and an LLM. Complaints are piling up: customers got confident, wrong answers about returns, delivery and warranties.
Level: Intro. Concepts: RAG, Grounding.
What you learn: You built retrieval-augmented generation (RAG). A model can only be as right as the information it's given — when the answer lives in private data, the fix is retrieval, not a bigger model. Notice recall: it's not 100%, and every miss is still a potential hallucination. That's the next wall.
2 · The wrong error code
Retrieval is on. Answers are still wrong. You added RAG and things got better — but not good enough. Half the questions mention exact product codes and error numbers ("what does E1043 mean on my coffee machine?"). Someone also set huge chunks and Top-K 2 to "save tokens".
Level: Core. Concepts: Hybrid search, Chunking, Reranking.
What you learn: Retrieval quality is usually the real bottleneck in RAG, not the model. Hybrid search (keywords + vectors) covers both exact identifiers and paraphrases, chunk size trades precision against completeness, and a reranker lets you retrieve wide while still handing the model a short, clean context.
3 · The holiday rush
It works. Now 40× more people want it. Quality is great — you're running the large model on everything. Then you hit the front page: traffic jumps to 60 req/s. The provider starts returning 429s and finance asks why the bill looks like a phone number. Lots of these questions are repeats, and most are easy.
Level: Core. Concepts: Semantic cache, Model routing, Rate limits.
What you learn: At scale, the expensive part of an AI system is tokens through your biggest model. A semantic cache removes repeats entirely, and a router sends easy traffic to a model that's ~100× cheaper with its own rate limit. You kept the large model — just for the requests that need it.
4 · Where's my order?
Users want things done, not explained. Most support requests are actions: "where is my order?", "cancel my subscription". Your bot can only talk, so it invents an order status. Leadership wants an agent that actually uses tools — without a surprise bill.
Level: Core. Concepts: Agents, Step budgets, Cost.
What you learn: Agents turn one LLM call into many. Real tasks here need 2–5 steps, but ~10% of runs get stuck repeating themselves — and a stuck agent spends its entire step budget. The step cap is a cost control, not just a safety net: set it just above what real work needs.
5 · The refund trick
"Ignore previous instructions and…" Your assistant is public. 15% of traffic is now people trying to make it leak the system prompt, insult customers, or promise refunds it can't give. A screenshot is already on social media.
Level: Core. Concepts: Prompt injection, Guardrails.
What you learn: Safety is layered. An input classifier catches most attacks cheaply, an output judge catches what slips through (and many hallucinations too) — but each layer has false positives, and the judge must see the full answer, which breaks streaming. Defense in depth is a trade-off, not a checkbox.
6 · The contract reviewer
Every answer is buried in a 90-page PDF. Legal wants a bot that answers questions about long contracts. To "not miss anything", someone set retrieval to grab 12 huge chunks per question and pinned the cheap small model to save money. Now every request fails.
Level: Advanced. Concepts: Context windows, Reranking, Cost.
What you learn: Context windows are a budget, not a bucket. Stuffing more into the prompt costs money, adds latency and drowns the answer ("lost in the middle"). Retrieving wide and reranking down to a few precise chunks fits a small, cheap model, and is usually more accurate than a huge prompt on a big one.
7 · "It feels slow"
Users stare at a spinner for eight seconds. Answers are good, but users bounce before they arrive. You run the large model on everything and an Output Judge checks every answer before it ships. Product wants the first words on screen in under a second, without letting hallucinations climb.
Level: Advanced. Concepts: Streaming, Time to first token.
What you learn: Perceived speed is time to first token, and streaming is the biggest lever. But anything that must read the full answer first, like an output judge, silently cancels streaming. Here better retrieval protects quality up front, so the model can stream straight to the user.
8 · The chat that never ends
Memory optimization: it either forgets what you said, or costs a fortune. Customers love planning whole kitchens with your shopping assistant, in chats that run 20, 40, 80 messages. They refer back all the time ("like I said earlier, my budget is…"). The prototype resends the entire conversation with every message. The bill grows every week, answers get worse as chats get longer, and the longest chats have started failing.
Level: Advanced. Concepts: Memory optimization, Stateless models, Cost.
What you learn: Models are stateless: they remember nothing between calls, so "memory" is whatever you choose to resend. Resending everything is accurate at first, then gets expensive, slow and noisy, and eventually overflows. A sliding window is cheap but forgets. A summary keeps the gist but loses specifics. Storing the conversation as long-term memory and retrieving only what each message needs keeps prompts small and the important facts in view.
9 · Flying blind
Costs are down 95%. Is anything else down? A contractor "optimised" your help bot: the small model, one huge chunk per question. The dashboard looks fantastic (fast, cheap, zero errors) and they've already invoiced. Support says answers have got worse, but nobody can prove it, because nothing measures whether answers are right.
Level: Core. Concepts: Evals, LLM-as-judge, Observability.
What you learn: You can't improve what you can't see. Speed, cost and errors are easy to measure, so teams optimise them and quietly wreck quality. An eval harness (a test set with known answers, plus an LLM judge scoring a sample of real traffic) turns "I think it's worse" into a number, and tells you whether each change actually helped.
10 · Bring it in-house
We moved off the API to save money. Now everything times out. The API bill was about $10 per 1,000 requests, so the team moved to an open 70B model on rented GPUs: 4 GPUs, one request at a time, full precision. The bill dropped to almost nothing, because almost nothing gets answered. Find a setup that is cheap, fast enough and still as good as the API.
Level: Advanced. Concepts: Self-hosting, Batching, Quantization, GPU capacity.
What you learn: Self-hosting turns a per-token bill into a capacity-planning problem. Batching is the biggest lever (one GPU serves many requests at once), quantization makes each GPU faster for a small quality cost, and the GPU count sets your bill whether the GPUs are busy or not. The sweet spot is busy but not saturated: too few GPUs and requests queue and time out, too many and you pay for idle silicon.
11 · The provider is down
503, 503, 503. Your status page is getting traffic. Your model provider is having a bad day: 70% of calls fail with 503 errors. Your whole product depends on that one provider, so your users see errors too. Keep the product up without wrecking speed or quality.
Level: Core. Concepts: Outages, Retries, Failover.
What you learn: Retries help with brief blips, but during a real outage they pile more load onto a struggling provider and make things worse (a retry storm). Resilience means having somewhere else to go: a second provider or a self-hosted model, with automatic failover, timeouts and a cap on retries. The backup doesn't need to be identical, just good enough to keep you up.
12 · The research assistant
One agent, twenty tabs open, forty seconds per answer. Analysts ask your assistant multi-part research questions: compare three vendors, summarise five competitors, build a briefing. A single agent works through every sub-question one after another, its prompt growing with each search result. Answers are slow and keep missing things. Leadership heard "multi-agent" on a podcast.
Level: Advanced. Concepts: Multi-agent, Orchestration, Hand-offs.
What you learn: Multi-agent systems trade money for speed and focus. Parallel workers with small, focused contexts beat one agent drowning in its own history, but every agent is more calls, every hand-off loses detail, and agents can loop. Good teams are small (about one worker per sub-task), have a reviewer to catch what the hand-offs dropped, and have a hard cap on rounds.
13 · Think harder?
The hard questions keep coming back wrong. Your tutoring assistant handles a lot of genuinely hard questions: multi-step maths, tricky logic, "explain why this proof is wrong". The medium model gets too many of them wrong. One engineer wants the large model for everything, another wants the new reasoning mode turned all the way up.
Level: Core. Concepts: Reasoning models, Thinking budgets, Model routing.
What you learn: Reasoning ("thinking") lets a model work through a problem before answering, which buys real accuracy on hard questions. But the hidden thinking tokens are paid for, and they're written before the first visible word, so more thinking is slower too. A modest budget usually captures most of the gain. Spend it only where questions are hard, for example by routing easy ones to a small model.
14 · It broke the parser
One in nine responses crashes your code. Your invoice-extraction API asks the model to return JSON (vendor, date, line items), and your code parses it. It works in the demo. In production, every so often the model adds a friendly sentence, forgets a bracket or invents a field, and your parser throws. The customer sees a 500 error.
Level: Intro. Concepts: Structured outputs, JSON mode, Validation.
What you learn: Asking nicely for JSON isn't a contract. Models occasionally break format, and at scale "occasionally" means constant crashes. Structured output (JSON mode or schema-constrained decoding) makes the model produce valid output by construction. A validator that checks and retries is the safety net, not the fix.
15 · Yesterday's answers
The price changed on Monday. The bot still quotes the old one. Your retrieval setup is solid (hybrid search, reranking), but the docs it searches change daily: prices, policies, release notes. The index was built once, by hand, from text scraped out of PDFs. Customers get confident answers that were true last month, and anything inside a table seems invisible.
Level: Core. Concepts: Data ingestion, Index freshness, Document parsing.
What you learn: Most RAG problems start before retrieval: in ingestion. Content that changes needs a pipeline that re-indexes on a schedule or on every change, or the model will confidently quote old facts that your judge can't catch, because the sources agree. And how you parse documents matters: plain text extraction turns tables and multi-column PDFs into word soup.
16 · The 20-page system prompt
Every request re-reads the whole manual. Your compliance assistant sends a 12,000-token system prompt with every request: the full policy manual, tone guide and twenty worked examples. Quality is excellent. The bill is not: almost all of it pays for reading the same text over and over. The small model can't even fit it.
Level: Intro. Concepts: Prompt caching, Cost, Latency.
What you learn: When every request starts with the same long prefix (system prompt, documents, examples), prompt caching lets the provider reuse its work: cached tokens cost roughly a tenth and are read almost instantly. Put the stable content first and the changing content last, so as much as possible can be cached.
17 · The nightly job ate the day
A million tickets to summarise, and live users get 429s. Someone kicked off a job to summarise and tag every support ticket from the last year. It runs through the same real-time API as your live chat. Now 60% of your traffic is a background job nobody is waiting on, it's eating your rate limit, and live customers are getting errors.
Level: Core. Concepts: Batch APIs, Async workloads, Rate limits.
What you learn: Separate work that someone is waiting on from work that can wait. Providers offer batch APIs at roughly half price with results within hours, and batch jobs don't compete with your live traffic for rate limits. Real-time capacity is precious: keep it for real-time users.
18 · Fine-tune it?
Your labels, your format, your 40 categories. Your support triage system sorts tickets into your company's 40 internal categories, in your exact format, and also answers questions from the help centre. Off-the-shelf models keep inventing categories. The large model does a bit better and costs five times as much. Someone says "just fine-tune it". Someone else says "fine-tuning will teach it our docs too".
Level: Core. Concepts: Fine-tuning, RAG vs fine-tuning, Cost.
What you learn: Prompting, RAG and fine-tuning solve different problems. Fine-tuning teaches behaviour: your labels, your format, your tone. A fine-tuned small model often beats a general large one on a narrow task, at a fraction of the price. But it doesn't reliably teach facts, and facts change, so knowledge still comes from retrieval. Most real systems use both.
19 · Nothing changed. Everything broke.
No deploy, no code change, and quality fell off a cliff. Nobody touched the code for two weeks, yet support complaints doubled and a few JSON responses started breaking. Your app calls the provider's "latest" model alias, and there's nothing measuring answer quality, so all you have is a feeling.
Level: Core. Concepts: Model versions, Regressions, Evals.
What you learn: The model is a dependency, and "latest" is an unpinned dependency. Providers update models behind aliases, and prompts tuned for one version can quietly regress on the next. Pin versions, run your evals against a new version before switching, and upgrade on purpose. Evals are what let you notice at all.
20 · Compliance is calling
Half your prompts contain someone's medical history. Your insurance assistant works well, and every claim question that customers paste in (names, policy numbers, diagnoses) goes straight to a third-party model provider. The compliance team has found out. They want personal data to stop leaving your systems without killing the product.
Level: Intro. Concepts: Privacy, PII redaction, Compliance.
What you learn: Anything in a prompt is data you're sending to whoever runs the model. Redact personal details before they leave (swap them for placeholders and put them back in the answer), or keep sensitive traffic on models you host yourself. Detection is never perfect, so combine it with provider agreements, retention settings and data minimisation.
21 · The walkie-talkie
Talk. Wait seven seconds. Hear a reply. Your new voice assistant answers well, but conversations feel like a walkie-talkie: you finish speaking, then silence for seven seconds, then the whole reply at once. People talk over it or hang up. A natural conversation needs the reply to start in about a second.
Level: Core. Concepts: Voice, Speech-to-text, Streaming.
What you learn: Voice is a pipeline (speech-to-text, the model, text-to-speech) with a latency budget of about a second. If each stage waits for the previous one to finish, the delays stack up. Stream every stage: transcribe while the user speaks, stream tokens from the model, and start speaking the first sentence immediately. Images and audio as input work similarly: they become tokens the model has to read, and they cost time and money too.
22 · One user, half your bill
A few scripted accounts are eating everyone's capacity. You launched a free tier. Within a week, a handful of accounts started hammering your API from scripts, with huge prompts, hundreds of times a minute. Half your traffic is now them. Real users are getting 429 errors, and your cost per real request has nearly tripled.
Level: Intro. Concepts: Abuse, Per-user limits, Cost control.
What you learn: Your provider's rate limits protect them, not you. Anything that's free, or billed per seat while you pay per token, needs per-user limits on requests, on tokens per day and on spend, so a single script can't burn your capacity or your budget. Set them generously for people and tightly for machines.
23 · Same question, different answers
Upload the same invoice twice, get two different totals. Your accounting tool reads invoices and returns the total, VAT and due date as JSON. Customers have noticed that uploading the same invoice twice can give two different totals. It also writes the odd product description. Someone suggests a bigger model.
Level: Intro. Concepts: Temperature, Sampling, Determinism.
What you learn: Temperature controls randomness, not intelligence. For extraction, classification and anything with one right answer, run near 0 so the same input gives the same output. Keep some temperature for writing where variety helps. A bigger model doesn't fix sampling; it just costs more.
24 · The evals say it's fine
The dashboard says 98%. Support says otherwise. Your docs assistant's eval dashboard has been green since launch: nearly every answer passes. Meanwhile support tickets keep arriving about wrong part numbers and made-up steps. Your goals are measured on real outcomes (tickets, refunds, follow-up questions), not on the dashboard.
Level: Advanced. Concepts: Evals, LLM-as-judge, Test sets.
What you learn: Evals are only as good as their test set and their judge. Test on samples of real traffic, refreshed regularly, not the 50 examples you wrote at launch. If an LLM judges, check it against human ratings so you know how often it's fooled. Exact match is cheap but punishes correct answers worded differently. Honest evals first, then fix what they show.
25 · The email that hijacked the agent
Nobody attacked the chat. They emailed the agent. Your inbox assistant reads customers' emails, sorts them, looks things up and sends replies on its own. This morning it forwarded a batch of invoices to an outside address. No user typed anything suspicious: the instructions were hidden in white text inside an incoming email. Customers still want replies sent for them.
Level: Advanced. Concepts: Indirect prompt injection, Least privilege, Human approval.
What you learn: Anything your system reads can carry instructions: emails, web pages, documents, tool results. Models can't reliably tell data from commands, so assume some will get through. Limit the damage instead: mark external content as untrusted, give agents the fewest permissions the job needs, and require approval for actions that send, pay or delete. No single layer is enough.
26 · Right answer, wrong question
Fast and cheap, and sometimes answering something else. Your docs assistant is quick and costs almost nothing, thanks to a cache. But some customers asking about the Pro plan are getting answers about the Basic plan, and people asking how to cancel are told how to upgrade. Everything is already in place. Something in it is set wrong.
Level: Core. Concepts: Debugging, Semantic cache, Similarity threshold.
What you learn: A semantic cache matches questions by meaning, so its threshold decides how similar is similar enough. Set it too loose and "how do I cancel?" gets the cached answer to "how do I upgrade?". Too strict and nothing ever hits. Tune it on real pairs of questions, and keep exact facts like prices and plan names out of loose matches.
27 · The goldfish
"As I said two minutes ago..." Your coaching chatbot has long conversations with its users, and the bill is under control. The complaint is that it keeps forgetting things: the user's goal, the injury they mentioned, the plan you agreed on ten messages back. They have to repeat themselves constantly.
Level: Core. Concepts: Debugging, Conversation memory.
What you learn: Whatever isn't in the prompt doesn't exist for the model. A tight window keeps costs flat but drops everything older than a few turns. Rolling summaries keep the gist cheaply, and long-term memory brings back the specific earlier turns a new message needs.
28 · Safe and useless
No jailbreak has got through. Neither have many customers. After last month's jailbreak scare, security turned the protection up. No attack has got through since. But support is flooded: customers asking ordinary questions are being told their message "can't be processed", and sign-ups are down.
Level: Intro. Concepts: Debugging, Guardrails, False positives.
What you learn: Every guardrail has two error rates: attacks it lets through and real users it blocks. Turning it all the way up trades one for the other, and blocked customers are a failure too, just a quieter one. Measure both, and layer defences instead of maxing out one.
29 · It found it, then threw it away
Recall looks fine. The answers don't. Your search pipeline has everything: vector search, keyword search and a reranker. The logs show the right document is almost always retrieved. Yet the assistant still says "I couldn't find that" or guesses, especially on questions that need two pieces of information.
Level: Core. Concepts: Debugging, Reranking, Context.
What you learn: A reranker is a filter: it decides what the model gets to read. Keep too few and you throw away the second fact a question needs, or the right chunk when the reranker's top pick is wrong. Keep too many and you're back to noise and cost. A handful usually works best.
30 · Overthinking "hello"
The bill went up sevenfold after someone made it smarter. Your support assistant used to be cheap and snappy. Last sprint someone changed a setting to make it "smarter" on tricky questions. Quality barely moved, but every reply now takes many seconds and the monthly bill is seven times what it was. Most questions are simple.
Level: Core. Concepts: Debugging, Reasoning budget, Cost.
What you learn: Reasoning tokens are billed and waited for like any other output. Spending them on every request makes easy questions slow and expensive for no gain. Turn thinking off by default, and use it (or a router) only where the problem needs it.
31 · The key was in the app
Per-user limits are on. The bill doubled anyway. Your mobile app calls the AI endpoint directly, with the key built into the app. Someone pulled it out, and now scripts all over the world use your endpoint as a free AI. They rotate thousands of accounts and addresses, so your per-user limits barely notice. Nearly half your traffic isn't your users.
Level: Core. Concepts: Authentication, API keys, Cost control.
What you learn: Anything shipped to a user's device or browser is public, including keys. Put auth in front of your own endpoint so every call needs valid credentials, keep provider keys on your server, and use per-user limits for the users you do let in. Limits and auth answer different questions: how much, and who.
32 · Why did it say that?
A customer has a screenshot. You have nothing. A customer sent a screenshot of your assistant confidently quoting the wrong refund policy. Engineering wants to know what the model was sent and what retrieval found, but nothing was recorded. Every complaint like this takes two days of guessing. Be able to answer "why" within a few hours, without a huge storage bill.
Level: Core. Concepts: Tracing, Observability, Sampling.
What you learn: Wrong answers don't throw errors, so you need traces: the prompt, what was retrieved, each model call. Keeping every request is expensive and mostly useless; random samples miss the rare failure you're hunting. Keep every failure plus a small sample of the rest, store the text (with personal data redacted first), and you can answer "why did it say that?" in minutes.
33 · The average looks fine
Fine on average. Not for everyone. Your help assistant scores well, and the dashboard is green. But a third of your customers write in Spanish or Portuguese, and they keep escalating to human support. Nobody has checked whether quality is the same for them. Find out, and close the gap.
Level: Advanced. Concepts: Fairness, Cohort evals, Multilingual.
What you learn: An average hides who is being served badly. Measure quality per group (language, region, device, plan) and set a limit on the gap, not just on the average. Here the cause was English-only embeddings: questions in other languages landed nowhere near the docs that answered them. Multilingual embeddings fixed it for a small extra cost.