An assistant produces a smooth answer and cites a policy. The citation exists, but the policy doesn’t support the claim. The response looks finished while the engineering problem remains unresolved.
These chapters treat the model as one part of an application. You’ll define what it should do, decide which evidence it may use, choose how work proceeds, and build checks that expose failures rather than hide them.
Define the job and its boundaries
Start with a small task: answer a policy question from supplied documents. Decide what a supported answer looks like, when the system should say it lacks evidence, and which actions remain under application control.
What you’ll learn
Begin with context, output contracts and validation. Follow evidence through retrieval and chunking, compare workflows with agent loops, and define the permissions of their tools. Finish with evaluations and request budgets. Exercises and the policy-assistant project connect these sections.
- Context and output contracts for AI features
- Structured outputs and validation
- Retrieval, evidence and source citations
- Chunking and retrieval quality
- Choosing between workflows and agents
- Tool permissions and side effects
- Building useful AI evaluations
- AI request budgets and graceful failure
Before you begin
Basic application development and JSON. The guides are provider-neutral. The exercises can be completed with authored fixtures; no paid model subscription is required.
You can read everything for free. Worked examples, practice questions and relevant interactive exercises are included in the chapter where you need them.
How to practise
Keep a few concrete cases beside your implementation: the source answers the question, the source is missing, two versions conflict, and a retrieved passage contains an instruction. Record the expected behaviour before changing the prompt.
Try each exercise before opening its explanation. If an update surprises you, trace a smaller example. The goal is to make the reasoning your own.