Class 3 · Add intelligence, then prove it works
By the end of this session QuoteDesk reads a pasted message into order lines, your team has a test set with results before and after a guardrail, and one thing acts without being asked: an agentic step that waits for a person’s approval, or a morning digest. The other one is homework for M3.
The session is four hours. The framework block is a recap of this page, which you read before class, so that the time in the room goes to building.
- Read the topics in order before the session. Each one opens with a guiding question, explains the idea with the Cerro Azul case, gives you one simulator, one “In the business” note and a short practice set.
- The simulators are safe. Predict what will happen before you press a button, then check.
- The build lab is what your team does in the 120-minute block. The prompts are written to be copied and adapted to your own product.
- The lab checklist is saved in your browser, so you can pick it up between sessions.
- Data rule: only invented or de-identified information until the session 4 lab is done, critical findings are closed and the data’s owner has agreed in writing. No real names, phone numbers, addresses or tax numbers in the app, in the test set or in any prompt.
- Before class, complete “Before session 3” in the toolkit setup guide: the model provider’s account, a spending limit, and the key on your hosting platform.
- Prices and token counts are illustrative. Check current prices before you budget; the reasoning does not change.
What you will be able to do
- Explain what happens in one model call: tokens in, tokens out, latency, cost, and why your instructions are paid for on every request.
- Estimate the monthly cost of an AI feature and compare it with the value of the time it saves.
- Name the pattern behind a business task (classification, extraction, summarization, assistant) and say how it is tested.
- Decide when an answer needs retrieval over company documents, when attaching the documents is enough, and when a tool should look the answer up.
- Describe an agent as a model in a loop with tools, and choose how much it may do without a person.
- Set up an automation with a trigger, an owner, a log, an alert and a spending limit.
- Build a test set of 20 to 30 de-identified examples, run it, add one guardrail, and report what changed with numbers.
Route of the session
The times in the first six rows are reading times for this page, about 100 minutes in total, at your own pace before class. The last three rows are minutes in the room.
- 20 min1One model call, and what you pay for2 simulators · 3 questions
- 10 min2Four patterns that cover most business casessimulator · 2 questions
- 15 min3Answering from company documents (retrieval)simulator · 2 questions
- 20 min4Agents: a model in a loop with toolssimulator · 3 questions
- 15 min5Automations: work that starts without yousimulator · 2 questions
- 20 min6Prove it works: test sets and guardrailssimulator · 3 questions
- 120 min▶In class · Build lab: the AI feature, the test set, one step that actsteam build · 5 prompts · checklist
- 45 minIn class · Critique: two teams report their results before and after the guardrail
- 30 minIn class · Milestone review: feedback on M2 and the briefing for M3
Topic 1 · One model call, and what you pay for
Guiding question: when QuoteDesk "uses AI" to read a customer's message, what exactly is sent, what comes back, and what does it cost?
Until now QuoteDesk stored what Paula typed. Today it starts reading. Restaurante Doña Elsa writes on WhatsApp: “hola, necesito 20 cajas de aceite 900cc, 5 sacos de arroz y lo de siempre de lácteos para el jueves”. Paula pastes it into QuoteDesk. The app sends it to a language model together with a short set of standing instructions (often called system instructions) and the list of product names and codes from QuoteDesk’s own products table. The model sends back a table: product, quantity, unit, and how confident it is about each line.
This is the third of the three things people call “the AI” (Class 2): the model inside QuoteDesk. It has no skills and no connectors. It sees only what the app sends it, and it can act only through tools the app defines. The app reaches it through the provider’s API, the door through which one program asks another for a service.
That round trip is a model call, the unit everything else is measured in. Three things matter about it:
- Tokens. The model reads tokens, pieces of words; a token is roughly three quarters of an English word and a little less in Spanish. You pay for tokens going in (instructions, product list, message) and tokens coming out (the table). A typical QuoteDesk call is about 1,500 tokens in and 400 out. The customer’s message is the smallest part of what you pay for.
- Latency. A call takes from under a second to several seconds, depending on the model and the length of the answer. For Paula pasting one message, three seconds is fine. For a page that fires ten calls, it is not.
- Model size. Small, medium and large models of the same family differ in price from several times to tens of times; check the provider’s price page, because the gaps move. Quality differs by less than the price suggests. The right default is the smallest model that meets the bar you set on your test set.
The fourth thing is the shape of the answer. QuoteDesk does not want a chatty paragraph; it wants a table it can put into a quote. Asking the model for structured output, usually as JSON (a structured format, fields with names), is what turns a chatbot into a feature. The confidence field is the one you will use for the guardrail in Topic 6.
The context window is the most text a model can take in one call: instructions, attachments, the conversation so far and its own answer. Current models hold hundreds of pages, so one quote request is tiny. It matters in three situations. A long conversation fills up, and the oldest parts drop out or are summarized. A large export, such as every order of 1,800 customers, does not fit and must be split or searched (Topic 3). And everything you put in is paid for and can distract the model: more context is not better context.
- Repeated input can be cached by the provider. Every QuoteDesk call starts with the same instructions and product list. Most providers can store that repeated beginning and bill it at a fraction of the normal price on later calls. It has a minimum length, and the repeated part must come first. Ask the assistant to turn it on.
- Batches are cheaper when you can wait. Work that does not need an answer now, such as running the test set again, can be sent as a batch at a discount, with results some hours later.
- Some models bill their reasoning as output. A model that reasons before it answers produces tokens you pay for at the output price and never see. Extraction needs little or none.
A single call costs about a cent. That number is not the decision. The decision is a month of calls against a month of rep time, and whether the output is right often enough that the reps stop retyping. Managers who stop at “it is cheap” ship a feature nobody trusts; managers who stop at “it is expensive” are comparing the wrong numbers. The next simulator puts both on the same chart.
Practice · Topic 1
QuoteDesk's instructions to the model grow from 230 to 1,230 tokens after the team writes in every edge case they can think of. What happens to the monthly bill?
The instructions travel with every message. At 2,600 requests a month, a thousand extra tokens each is 2.6 million input tokens a month. Provider caching can discount the repeated part; it does not make it free. Keep instructions short and put the edge cases in the test set, where they cost nothing per call.
On the team's 24-message test set the large model gets 20 right, the medium 18 and the small 14. Before looking, the team set its bar at 18 right with no guardrail. The medium costs a fifth of the large, the small a twenty-fifth. Which should QuoteDesk start with?
Choose the smallest model that meets a bar you set before you saw the results. With 24 examples, a difference of one or two messages is noise, so 20 against 18 does not justify five times the price. Start with the medium model, add the guardrail, and pay for the large one only if a bigger test set says you must.
Why does QuoteDesk ask the model for a table with fixed fields instead of a free-text answer?
A paragraph needs a person to read it. A table with product, quantity, unit and confidence feeds the quote, the database and the evaluation. Structured output is what makes the feature testable.
Topic 2 · Four patterns that cover most business cases
Guiding question: there are thousands of "AI use cases". How many kinds of thing are you actually asking the model to do?
Four, most of the time. Naming the pattern before you build matters because each one is tested differently, fails differently, and is asked for differently.
| Pattern | What goes in | What comes out | How you test it | Cerro Azul example |
|---|---|---|---|---|
| Classification | one item | one label from a fixed list | count the labels that match | route an email to sales, billing or logistics |
| Extraction | free text or a document | a table with fixed fields | compare field by field | order lines from a pasted message |
| Summarization | many items | one short text for a person | a reader judges it with a rubric | the morning digest of pending quotes |
| Assistant | an open question plus context | a conversational answer | a set of questions with expected answers | “can we deliver to Rancagua on Saturday?” |
QuoteDesk’s first feature is extraction. Its failure mode is specific: inventing a product that was not mentioned, or guessing a quantity. “Lo de siempre de lácteos” (the usual dairy) is the interesting line. A good extraction does not guess; it returns the line with low confidence so that Paula looks at it.
The pattern also tells the assistant what to build. “Add AI to the quote page” produces a chat box. “Add an extraction step: when the rep pastes a message, call the model with these instructions, expect this table, show it in the form with the low-confidence lines highlighted” produces a feature.
Most “AI transformation” roadmaps are these four patterns applied to different documents and queues. When a vendor or a colleague proposes a use case, ask which pattern it is. If they cannot say, they have not yet thought about how it will be tested.
Practice · Topic 2
The returns team wants "AI to handle returns of perishable goods". The first thing the model must do is decide, for each incoming message, whether it is a return request at all. Which pattern is that?
"Handle returns" is a workflow made of several patterns: classify the message, extract the product and the reason, then perhaps draft a reply. Separate them and each piece becomes small, testable and cheap.
Which pattern is hardest to test automatically?
A summary can be accurate and useless, or incomplete and exactly what Carla needed. Test summaries with a short rubric (nothing invented, the three oldest quotes present, under 120 words) read by a person, not by a script.
Topic 3 · Answering from company documents (retrieval)
Guiding question: the model has read much of the internet, but it has never read Cerro Azul's delivery policy. How does QuoteDesk answer "can we deliver to Rancagua on Saturday?"
A model answers from what it learned in training plus what you put in the request. Cerro Azul’s policies were never in the training data. Ask a bare model about Saturday deliveries and it will write a fluent, confident sentence built from what delivery policies usually look like. That is a hallucination, and the dangerous part is that it reads exactly like a correct answer.
There are three ways to give the model the facts, and the right one depends on what the facts are.
| The facts are | Give them to the model by | Cerro Azul example |
|---|---|---|
| a few short documents | attaching them whole to every call | a two-page delivery policy |
| many or long documents | retrieval: search first, attach only the closest passages | sixty pages of delivery, returns and credit policies |
| numbers in a table that changes | a tool that looks the value up | the price of aceite 900 cc today |
Retrieval, often written RAG (retrieval-augmented generation), is the middle row. Before calling the model, the app searches the documents for the passages closest to the question and attaches the best few. The model answers from those passages and cites them. The assistant can build the three parts in an afternoon:
- The documents split into chunks: a passage of a few hundred words, about 300 to 500 tokens, such as one policy section.
- A way to find the chunks closest in meaning to a question. Each chunk gets an embedding, a numeric fingerprint of its meaning, stored in the database.
- Instructions that say: answer only from the attached passages, cite them, and say “I do not know” when they do not cover the question.
Use retrieval when the documents are too many or too long to attach whole. A few short policies can simply be attached. Prices are looked up with a tool, never retrieved as text: a price is a number in the products table, and a passage that mentions a price goes stale the day the list changes. Extracting order lines needs none of the three, because everything the model needs is in the message.
Retrieval fails in its own ways. The right chunk is not among the top few. The chunks are stale: the policy changed in March and the stored passages still say what it said in January. Or too many chunks are attached, which costs tokens and distracts the model. The simulator shows the trade-off.
A citation is a trust device. When QuoteDesk answers “[policy-04]”, Paula can open the policy and check it in ten seconds. A sales manager who insists on citations in every document-based answer is the reason the assistant is still in use after its first wrong answer.
Practice · Topic 3
Which of these jobs needs retrieval?
Retrieval is for documents that are too many or too long to attach whole. Sixty pages of policy qualify. A message that contains its own answer does not, and a price is read from a table with a tool.
The policy assistant answered a Saturday-delivery question correctly in testing. Two months later it gives the old cut-off time, although logistics changed the policy in between. What is the most likely cause?
Retrieval is only as fresh as the documents behind it. Someone owns the refresh, on a schedule or on every change. At Cerro Azul that is Carla; put the owner's name in your risk memo.
Topic 4 · Agents: a model in a loop with tools
Guiding question: if the model can read the message and look up a price, why not let it find the customer, price the order and send the quote by itself?
It can. The question is how much of that you allow without a person. An agent is a model in a loop: it thinks about the goal, calls a tool, reads the result, and decides the next step, until the job is done. The building assistant you have used since Class 2 is an agent; that is why it can create files and run your app. Today you put a small one inside QuoteDesk.
The tools are where an agent touches the business, and for the model inside QuoteDesk they are functions of the app, not connectors. There are five: find_customer, read_price_list (reads the products table that the team imports from the price sheet, and returns the import date), read_last_orders, draft_quote and send_quote. The first four read or write inside QuoteDesk. The fifth reaches a customer. In the lab, send_quote sends nothing: it marks the quote “sent (test)” and shows on screen the message it would have sent.
A useful term is tool calling. The model never sends the quote itself. It returns a structured request, “send_quote for quote 1042”, and your app decides whether to run it, when, and with whose approval. That boundary is where every control over an agent lives.
There are three levels of autonomy, and you choose one per tool, not per product:
| Level | The agent | The person | Fits |
|---|---|---|---|
| Suggest only | reads and drafts | does every action | new features, anything unmeasured |
| Act after approval | prepares the action and asks | approves with one click | actions that reach a customer or move money |
| Act alone, inside limits | acts and writes a log | reviews the log | reversible, low-stakes, well-measured steps |
The risk of each step grows with three things. Blast radius: a wrong line in a form is seen by Paula; a wrong price table is seen by 1,800 customers. Reversibility: a draft can be deleted; a sent quote cannot. Volume: an agent that acts 120 times a day repeats a mistake 120 times a day.
Larger jobs are sometimes split among subagents. A subagent is a separate worker with its own context that takes one sub-task and reports back a short result. Asked for a review of last quarter’s quotes, the main agent can hand each of the 14 reps’ quotes to a subagent and keep only the 14 summaries. That helps when a sub-task would flood the main agent with detail, or when parts can run side by side. It is overkill for one quote: every worker costs tokens, and you have more logs to read. The same autonomy rules apply to each of them.
Run the simulator three times with the same problem and a different level. The model is identical each time. What changes is whether a person stands where the mistake would pass.
Autonomy is earned, not switched on, and the reversible step earns it first. Start with two stops: the rep checks the draft line by line, then approves the send. Keep the log, and after a month ask one question of it: how often did a person change what the agent proposed? If the reps changed 12 of 2,600 drafts, drafts can be saved without the line check. Sending still waits for the rep’s click, because a sent quote cannot be taken back. If Carla rejected one discount in five, discounts stay behind her for good. A dental clinic follows the same rule: suggesting a slot is safe on day one; cancelling a patient’s appointment without the receptionist is not.
Practice · Topic 4
Which QuoteDesk action should stay behind a person's approval the longest?
Sending is irreversible, reaches a customer, and happens 2,600 times a month. The model proposes, the rep approves, the app sends. The other two are reversible and stay inside QuoteDesk.
What does "tool calling" mean for Carla, who owns QuoteDesk?
The line between "the model wants to do X" and "the app does X" is where approvals, limits and logs go. Ask your assistant to show you that line in your own app.
After a month, the log shows the reps changed 12 of 2,600 drafts before approving them, and Carla rejected 9 of 45 discount requests the agent passed to her. What do you change?
Autonomy is decided per step, with the log as evidence, and the reversible step earns it first. A draft that is almost never corrected can be saved without a line check. Sending reaches a customer, so the rep still approves it with one click, and a step corrected one time in five stays behind Carla.
Topic 5 · Automations: work that starts without you
Guiding question: everything so far starts when Paula pastes a message. What should start by itself, and who finds out when it stops?
An automation is an agent or a workflow started by a trigger instead of a person asking. There are three kinds:
- A schedule: every weekday at 08:00.
- An event: a new message arrives, a form is submitted, or another system calls yours (a webhook).
- A button: it runs when a person decides it should.
Cerro Azul’s first automation is the morning digest. It is a scheduled task of the team’s assistant, the one Carla and the reps use directly, not a part of the deployed app. At 08:00 on weekdays it reads the pending-requests file that QuoteDesk exports into the shared folder, the same folder the price-list connector already reads. It groups the requests by rep, marks those older than three hours, drafts a follow-up for each of those, and delivers to Carla and to each rep their own part, inside the assistant. Nothing is sent to customers; the drafts wait for each rep. It is the summarization pattern from Topic 2 with a clock attached. One run costs about USD 0.04, so a normal month of 22 runs costs about a dollar.
This assumes Cerro Azul’s assistants are billed by use on the same company account as QuoteDesk’s model. On a flat subscription a runaway task burns the plan’s allowance instead, and everyone’s assistant stops for the day.
Assistants now offer scheduled tasks that run in the cloud, and workflow tools such as n8n, Make or Zapier add AI steps to their flows. The names will change; the four things every automation needs will not:
- An owner. One named person. For the digest, Carla.
- A log. Every run: when it started, what it did, what it cost.
- An alert when it fails, on a second channel. Automations fail silently. A digest that does not arrive looks exactly like a quiet morning, and if the assistant’s own delivery is what broke, an alert sent the same way will not arrive either. Carla’s alert is a text message.
- A spending limit. A retry loop at 01:00 has nobody watching it. Five thousand runs before 07:00 is about USD 200. Cerro Azul’s model account has a monthly limit of USD 50, a little above the USD 28 or so that QuoteDesk normally spends, so the same night stops at USD 50. It also stops QuoteDesk’s own extraction until Carla raises the limit, which is why the alert matters as much as the limit.
Your lab version is smaller than Cerro Azul’s: a file exported by hand, a digest that stays inside your assistant, and the assistant’s own phone notification as the alert. A real deployment needs a view that refreshes by itself and a second alert channel. Note both as open items in your risk memo.
Match the trigger to the job. An event trigger suits work done once per item, such as extracting each message as it arrives. A digest is a summary; triggered on every message, it becomes 120 notifications a day that the reps will mute by Tuesday.
The cost of an automation is rarely the model bill, which here is about a dollar a month. It is the Friday when Minimarket Los Aromos calls Marcos about a quote that has been pending since Tuesday, and you discover the digest stopped on Thursday. Before you approve any automation, ask two questions: who is told when it fails, and what stops it from running five thousand times?
Practice · Topic 5
Carla wants each rep to know every morning which of their quotes are overdue. Which trigger fits?
A digest is a summary of a period, so the period is the trigger. Events suit work done once per item; buttons suit work that should only happen when a person decides.
The digest has arrived every morning for six weeks. On Thursday it does not. What is the most likely reason nobody notices until a customer calls?
Silence is the failure mode of automations. An alert turns "nothing arrived" into "the 08:00 run failed at the first step: sign-in expired", sent to the owner within a minute, on a channel other than the one that failed.
Topic 6 · Prove it works: test sets and guardrails
Guiding question: the extraction worked on the three messages you tried in class. How do you know it works on the 2,600 that arrive next month?
You do not, until you measure. The habit that separates a demo from a feature is the test set: a list of inputs, each with the answer a good rep would give, that you run every time something changes (the model, the instructions, the product list). For QuoteDesk that is 20 to 30 customer messages and, for each, the lines Paula would have typed. Use real messages with names, phone numbers and addresses changed, or realistic ones written the way customers really write. Collecting them was your pre-work.
Running the set gives a count: how many messages came out right. Score by product code and normalized unit, not by exact text, or “caja” against “cajas” will fail a correct answer. Report counts, never percentages: “18 of 24” tells the reader how small the set is. The first number is usually humbling. Three questions follow:
- Where does it fail? Nearly always on the same kinds of message: abbreviations, “the usual”, a quantity written in words.
- Does the model know when it is unsure? If its confidence is low on the lines it gets wrong, you can use that.
- What does a guardrail change? A guardrail is a rule outside the model: flag lines below a confidence threshold for a rep; refuse a product that is not in the catalog; never apply a discount the model proposes. Each one trades silent errors for review work.
That review work has two sizes. A rep glances at every extraction before confirming it, which takes seconds. A flagged line gets a line-by-line check against the message, which takes a minute. The guardrail decides which messages get the minute.
Count one failure separately: the invented line, a product that was never in the message, extracted with high confidence. It slips past any guardrail based on confidence, and one of them in a quote costs more trust than ten lines sent to review.
Test what acts as well as what reads. For the agentic step, add cases where the right behavior is to stop: a discount request, an unknown product, a price import that is out of date. For the automation, the test is the log of a run you started by hand.
Keep a person at the point where a wrong answer would reach a customer. That is the design, not a sign of failure. As the results improve and the log grows, you lower the threshold and the reps check less.
A test result is a sentence you can put in front of Carla: “on our 24 test messages only 1 gets through wrong, the uncertain ones are flagged, and the reps check about 35 flagged messages a day line by line instead of retyping all 120.” That sentence wins the budget. “It uses AI” does not.
Practice · Topic 6
Your team's test set has 24 messages, all made up by the team in ten minutes during the session. What is the problem?
Start from real messages on the reps' phones and in the shared inbox, and change the names, phone numbers and addresses before they go anywhere near the app. The abbreviations, the typos and "lo de siempre" are exactly what the model must handle, and they are what invented messages leave out.
With a guardrail that flags lines under 60% confidence, wrong quotes on the test set drop from 6 to 1, and 7 of 24 messages now get a line check from a rep. Carla says that is too much checking. What do you do?
A guardrail is a dial, not a switch. The threshold is a business decision: how many wrong quotes a month against how many minutes of checking. The test set lets Carla make it with numbers instead of opinions.
Which failure should count as the most serious in QuoteDesk's test set?
An invented line with high confidence passes every confidence-based guardrail and ends up in a quote. Count invented lines separately, and treat even one as a reason to tighten the instructions and to check every product against the catalog.
Build lab · The AI feature, the test set, one step that acts
What your team builds in the next 120 minutes
Teams of 2 to 3 · the instructor circulates · save a checkpoint after every story that passes, and at least every 20 minutes
A checkpoint always includes sending it to GitHub, which updates your public address a minute later. The model key lives only on the hosting platform, so anything that calls the model does not run on your laptop: save a checkpoint, wait for the public address to update, and test there. If it fails, fix it or roll back.
- Watch the live demo (10 min). The instructor connects a model, builds an extraction step and runs it at the public address, with one failure and its recovery.
- Import the product list (10 min). Use the first prompt below. QuoteDesk gets its own products table (code, name, unit, list price), imported from a file exported from the price sheet, and the page shows the import date. The model inside QuoteDesk cannot use the connector from Class 2; it reads this table.
- Name the one capability that matters most to your user (5 min). Name its pattern: classification, extraction, summarization or assistant. If you cannot name it, split the idea until you can. Write one sentence: "When the user does X, the app sends Y to the model and shows Z."
- Connect the model the right way (8 min). The key is already on your hosting platform as an environment variable, a setting stored on the server, outside the code (setup guide, "Before session 3"). Ask the assistant to call the provider from the server using that environment variable and to confirm with one test call from the deployed app. Check that your spending limit of USD 10 a month is set.
- Write the instructions and the output shape (10 min). Use the second prompt below. Keep the instructions under 200 words. Ask for structured output with a confidence field on every item and an explicit rule not to invent.
- Build the feature in the smallest step that works (10 min). One screen, one call, the result shown next to the original input so that the user can compare. Save a checkpoint, wait for the public address to update, and try it there with a realistic message, with names, phone numbers and addresses changed. If it fails, fix it or roll back.
- Break (10 min). Stand up. The test set is next, and it needs a clear head.
- Load your 20 to 30 examples as a test set (10 min). Use the third prompt below. Each example needs the input and the expected answer. The assistant builds a page that runs all of them and reports pass or fail for each. Save a checkpoint so that the page is at the public address.
- Run it at the public address and write down the count (8 min). Read every failure. Group them: abbreviations, missing information, wrong quantity, invented items. Count the invented items separately.
- Add one guardrail (10 min). The common ones: flag items below a confidence threshold for a person; refuse items that are not in the products table; never let the model set a price or a discount. Pick the one that addresses your largest failure group, and save a checkpoint.
- Run the test set again at the public address (7 min). Record three numbers: how many right, how many invented items, and how many examples are now flagged. These are what you present in the critique.
- Add one step that acts: choose A or B (15 min). A, an agentic step with approval: use the fourth prompt; give the model the five tools, let the app hold the rules, save a checkpoint, and open the step log for one message at the public address. In the lab
send_quotesends nothing; it shows the message it would have sent. B, the morning digest: ask the building assistant for a manager-only "Export pending requests" button (customer, time received, rep; no prices, no phone numbers). Save the exported file by hand into the shared folder your price-list connector already reads, then give the fifth prompt to your team's assistant and run the task once by hand. A real deployment needs a view that refreshes by itself and a second alert channel; note both as open items in your risk memo. The option you do not choose is homework for M3. - Save the last checkpoint, check the public address, and write the build log entry (7 min): what the model got wrong, what you decided about the threshold, which action you kept behind approval and why, and what the assistant did that you did not expect.
Optional, and only if your product answers from documents: add retrieval as homework. Ask the assistant to split two or three documents into chunks, store them, attach the three closest chunks to each question, and show citations in the answer. Add five document questions to the test set. If the documents are short, attach them whole instead.
Weak
"Add AI to the quote page so it understands the customer messages."
The assistant will build a chat box. Nobody said what goes in, what comes out, or what happens with the result.
Strong
"When the rep pastes a message and clicks Read, call the model with these instructions and the product list, expect this table, show it under the message with low-confidence rows in amber, and save only after the rep confirms."
Pattern named, output shape fixed, a person in the loop, nothing left to guess.
That last question is yours to answer, not the assistant’s. A list of abbreviations costs tokens on every call and fixes one case. A higher threshold costs checking time and catches cases you have not seen yet. Neither fixes the invented product; a rule that refuses anything not in the products table does. Decide, write the reason in the build log, and run again.
- QuoteDesk has its own products table, imported from the price sheet, and the page shows the import date.
- The capability is named with its pattern and one sentence: when the user does X, the app sends Y and shows Z.
- The model key is only on the hosting platform's environment variables page, and your spending limit of USD 10 a month is set in the provider's console.
- Instructions are under 200 words, ask for structured output with a confidence field, and forbid inventing items.
- The feature works end to end at the public address on one realistic message, and the user can edit the result before anything is saved.
- The test set has at least 20 examples with expected answers, and no real names, phone numbers or addresses.
- First run: how many right and how many invented items are in the build log.
- One guardrail is added, and the reason for choosing it is written down.
- Second run: right, invented and flagged counts are recorded next to the first run.
- Option A: nothing is really sent in the lab, no action runs without approval, and the step log shows what the model asked, what the app allowed and who approved.
- Option B: the digest has a named owner, a failure notification, a retry limit and the log of one run started by hand; the missing refresh and second alert channel are noted for the risk memo.
- Last checkpoint saved and visible at the public address, build log entry written by each member.
Critique and reflection
Two teams present for five minutes each: the feature working on one realistic message, the evaluation page with the counts from the first run and from the run after the guardrail, and the log of the step that acts (the agentic step or the automation run). The class scores with the rubric. The criterion in focus is AI quality and safety: is the capability useful to the named user, is it evaluated with examples that look like real ones, and is there a person or a guardrail wherever a wrong answer would reach a customer?
Questions the class should ask the presenting teams:
- Where did the test messages come from, and how were they de-identified?
- Which failure group is the largest, and did the guardrail address it?
- How many examples are now flagged for a person, and who is that person in the real workflow?
- Did the model ever invent something? What stopped it, or what will?
- Which action can your product take on its own, and what in the log convinced you?
Build-log reflection for everyone, written before leaving: What did you decide after you saw the first count? Was there a moment when the assistant proposed a fix and you had to say no?
Before next session
Milestone M3 (team, 25%, due before session 5):
- the AI feature, deployed;
- the test set with its results before and after the guardrail;
- one agentic step with approval and one scheduled automation, each with its log. You built one in class; the other is homework;
- a baseline and one measurement of the metric in your brief, on at least five timed requests. For QuoteDesk: how long five requests take by hand, and how long the same five take with the feature;
- a two-page risk memo, completed after session 4, which covers security, permissions, personal data, cost and maintainability. Start a draft now with today’s numbers.
Pre-work for session 4 (the Class 4 page, about 95 minutes, plus about 45 minutes for the tasks below):
- Run the course security checklist on your own app and bring the results. Expect to find at least one issue; everyone does.
- List every connector, tool and automation your product and your team’s assistant now have, and next to each write what it may read, what it may change, and who approves. You will tighten that list in class.
- Note the spending limits you set today and the cost of your test-set run. You will scale those numbers in class.
- Skim the summary of the OWASP Top 10 for LLM Applications (2025), about 15 minutes. Class 4 maps it to QuoteDesk line by line.
Summary
- A model call is tokens in, tokens out, latency and cost. Your instructions are paid for on every call; keep them short, and let the provider cache the part that repeats.
- Choose model size with the test set: the smallest model that meets a bar you set in advance.
- Four patterns cover most business cases: classification, extraction, summarization, assistant. The pattern decides how you test.
- Structured output turns a chatbot into a feature: fields you can put in a quote and score automatically.
- Short documents are attached, long ones are retrieved, and numbers in a table are looked up with a tool. Retrieval needs chunks, search, citations, and a named person who keeps the documents fresh.
- An agent is a model in a loop with tools the app defines. Choose autonomy per tool, and let the reversible step earn it first.
- An automation starts on a trigger. It needs an owner, a log, an alert on a second channel and a spending limit, because it fails in silence.
- A test set is the difference between a demo and a feature. Report counts, score codes and units, and remember that with 24 examples a difference of one or two is noise.
- A guardrail trades silent errors for checking work, and the threshold is a business decision.