AS·00
Start Here: From a Model to a System
For engineers who have used an LLM but never built an application around one: why a model alone isn't a product, one small question-answering system built step by step (a model that invents an answer, retrieval that finds the real one, a grounded reply with its source, and an honest "I don't know"), the parts every AI system adds around the model, the vocabulary of the volume, and how to study it.
Start here: how to use this volume
Two reading paths
This volume is about building systems around models: embeddings and vector search, retrieval-augmented generation and its evaluation, fine-tuning and preference optimisation, quantization and inference, structured outputs and tool calling, agents, memory and orchestration, the Model Context Protocol, multimodal and generative media, and then the engineering disciplines that make AI production-grade: evaluation, security, observability, MLOps, serving and architecture. Every chapter has the same shape: a plain-language Start here section with small, verified examples; a How deep to go ladder; the full-depth sections; a Lab of real measurements; and a Revision sheet.
- New to AI systems? Read Volume 14's Start Here and chapters 154–158 first if you haven't, then this chapter and the chapters in order.
- Experienced? Skip this chapter. In each chapter read the revision sheet first, take its quiz, then use How deep to go to choose the sections and lab experiments to study.
A note on the labs: the lab machine can't download pretrained models or call hosted model APIs. The labs therefore use real libraries and protocols (FAISS, hnswlib, BM25, the MCP SDK, FastAPI, MLflow, OpenTelemetry) with the small GPT trained from scratch in Volume 14, classical embeddings, and, where a capable model is essential to the experiment, a clearly labelled scripted stand-in. Each chapter says which.
Mastery levels
Every chapter uses the same six levels:
| Level | Name | You can… | Example for RAG |
|---|---|---|---|
| L1 | Recognition | define it and spot it | "that answer came from the documents, not the model's memory" |
| L2 | Working | build it | index documents and answer questions with sources |
| L3 | Internals | explain why it works | explain chunking, embeddings, hybrid search and reranking |
| L4 | Debugging | find and fix problems | trace a wrong answer to a missed retrieval or a bad chunk |
| L5 | Design | shape a whole system | design ingestion, retrieval, evaluation and access control for a product |
| L6 | Production | run it at scale | run RAG platforms for many teams with SLOs and cost controls |
Why a model alone isn't a product
A language model predicts likely text. It doesn't know your company's facts, it can't tell you where an answer came from, and it will produce a confident sentence even when it has nothing to go on. An AI system wraps the model with the parts that make it useful and safe: retrieval of the right information, structured inputs and outputs, tools, checks, evaluation, and monitoring.
Step 1: ask the model alone
The tiffin centre's customers ask about refunds. The small GPT from Volume 14 (trained on this textbook, not on the tiffin centre's policies) was asked directly:
Question: How long do refunds take to reach me?
Answer: - Atree: a newest-s, a newest-s, a newest-s, a newest-checked, and a newest-s,
A tiny model produces nonsense; a large one would produce a fluent, plausible and probably wrong policy, which is worse, because people would believe it. Either way, the model has no way to know the real policy.
Step 2: retrieve the relevant text
The FAQ has five paragraphs. A keyword-based ranking (BM25, chapter 161) scored each against the question:
Refunds 1.65 Spice levels 0.34 Subscriptions 0.33 Delivery hours 0.24 Allergies 0.00
Step 3: answer from the source, and cite it
Refunds go back to the original payment method within 5 working days. [source: FAQ, 'Refunds']
Do you deliver on Sunday? → There is no delivery on Sundays.
The answer came from the policy itself, with a pointer to where it came from, so it can be checked. In a real system a capable model writes the reply from the retrieved text; here a simple rule picked the best-matching sentence. That pattern, retrieval-augmented generation (RAG), is the most common architecture in applied AI.
Step 4: know when you don't know
Can I pay with cryptocurrency? best retrieval score 0.24 (below the threshold of 1.0)
→ "I don't know; the FAQ doesn't cover that."
When nothing relevant is found, the honest answer is to say so (or hand over to a person). Deciding the threshold is an evaluation problem (chapters 162 and 175), not a guess.
The parts every AI system adds
| Part | Job | Chapters |
|---|---|---|
| embeddings and search | find relevant information | 159–162 |
| model adaptation | change behaviour, size and cost | 163–166 |
| structure and tools | machine-readable output, safe actions | 167–168 |
| agents, memory, orchestration | multi-step work | 169–172 |
| other media | images, audio, video | 173–174 |
| evaluation, security, observability, operations | trust, safety, reliability | 175–180 |
How to study applied AI systems
A routine that works
- Build the smallest end-to-end version first (retrieve, answer, cite), then improve the weakest part.
- Evaluate every part separately (retrieval, generation, tools), with a fixed set of test questions.
- Treat model output as untrusted input: validate, constrain and log it.
- Measure cost and latency from day one: tokens, calls and cache hit rates.
- Write down what the system must never do, then test for it.
Warm-up exercises
- Write ten questions customers might ask about a product you know, and mark which a FAQ answers.
- Put the tiffin FAQ through any LLM you can access with and without the FAQ in the prompt; compare answers.
- List the actions an AI assistant at your workplace would need, and which should require human approval.
- Estimate the tokens and cost of answering 10,000 questions a day with a 2,000-token context.
Glossary
- AI system / application: a model plus retrieval, tools, checks and operations around it.
- Grounding: basing an answer on supplied sources.
- RAG: retrieval-augmented generation.
- Embedding: a vector representing meaning, used for search.
- Tool calling: a model requesting that code run with given arguments.
- Agent: a system where a model decides the next step in a loop.
- Eval: a repeatable test of an AI system's behaviour.