Sub topic 1
Start with the user problem and the scope of the AI feature
Prerequisites
This chapter assumes you know basic product requirements or user stories, have a general idea of what a large language model does, and can read short Python and JSON snippets.
Start with the user problem
Write the user problem before you write the feature. A problem statement names the user, the task they try to finish, and the point where the current process fails. For example: "Support agents spend ten minutes finding the refund policy for each customer question."
Then define the scope. The scope lists what the AI feature does and what it does not do. A common error is to write "answer any customer question." That scope is too broad to test. A narrower scope reads: "answer refund policy questions using only the policy document, and route everything else to a human."
Why AI features need different requirements
A normal function returns the same output for the same input. An AI feature does not. The same question can produce different wording, and sometimes a different answer. A requirement such as "the output equals X" cannot be met. Instead, describe a distribution of behavior, such as "at least 95% of refund answers are supported by the policy text."
Choose the quality dimensions that matter
A quality dimension is one property you measure, such as groundedness, accuracy, or refusal quality. Pick only the dimensions that affect the user problem. Three to five is typical. Give each one a name and a way to measure it.
| Dimension | Question it answers | Typical measure |
|---|---|---|
| Groundedness | Is every claim supported by the source text? | Share of supported answers |
| Accuracy | Are amounts and deadlines correct? | Share of correct answers |
| Refusal quality | Does it decline out-of-scope questions? | Share of correct declines |
List failure modes and rank their severity
A failure mode is a specific way the feature can go wrong. Assign each one a severity: critical, major, or minor. Rank by harm to the user, not by how often the failure happens. A wrong refund deadline is critical even if it occurs in one answer out of a thousand.
- Critical: states a refund amount that contradicts the policy.
- Major: omits the deadline the user asked about.
- Minor: uses an overly formal tone.
Exercise
Write one failure mode for a refund assistant and assign it a severity.
Show answer
"The assistant promises a refund for an item bought 90 days ago, when the policy allows 30 days. Severity: critical, because the user is misled about money."