Shelves / Applied AI Systems
Software Engineering · Volume 14B
Applied AI Systems
Part XIV of the Software Engineering roadmap, second half, written out as a textbook for beginners and experienced engineers alike. Building production systems on top of models: embeddings and vector databases, retrieval-augmented generation and how to evaluate it, fine-tuning, preference optimisation, quantization, how inference servers really work, structured outputs, tool calling, agents with memory and orchestration, the Model Context Protocol, multimodal and generative media, evaluation, security, observability, MLOps, serving and a reference production architecture. Start with the Start Here chapter (a question-answering system built step by step, from a model that invents an answer to one that cites its source and knows when to say "I don't know"). Every chapter opens with a plain-language on-ramp, a check-yourself quiz and a six-level "how deep to go" ladder, and closes with a lab of real measurements (search indexes timed, chunking strategies compared, a tiny GPT fine-tuned, preference-tuned, quantised and served, a diffusion model trained, a workflow crashed 200 times, an MCP server probed, traces mined for bugs, a model released through MLflow) and a one-page revision sheet. Where a capable model was needed and unavailable, the labs say so and use honest substitutes. A projects chapter turns it all into a portfolio. Examples come in Python plus Java, TypeScript, Go, Rust and C++.
Two ways to read this book
Every chapter has the same shape: Start here (first principles, plain language, small verified examples) → How deep to go (what each mastery level needs) → full-depth sections → Lab (experiments with real measured output) → Revision sheet (key ideas, numbers to remember, pitfalls, glossary, quiz).
How to use this book
- Read one topic at a time. Each topic heading has a Done tick. Tick it only when you can explain the idea aloud without looking, which is roughly mastery level L2–L3 below.
- Run the code. Every comparison block has tabs for each language; type the example out in at least two of them.
- Take the chapter quiz at the end. A score of 80% or more counts as passed. Wrong answers show the explanation, so re-read that topic and untick it if needed.
- Revisit after a delay. The roadmap's loop applies: recall, explain, implement without notes, break it, measure it.
Mastery levels
Languages used throughout
Status as of October 2026: the Model Context Protocol published its 2026-07-28 specification (stateless requests, sessions removed, Tasks moved to an extension); Spring AI 2.0 reached GA in June 2026; LangGraph has been 1.x since October 2025; Microsoft Agent Framework succeeded Semantic Kernel and AutoGen; vLLM and SGLang lead open-source serving. The MCP Python SDK 2.x renamed FastMCP to MCPServer, and MLflow 3.x saves scikit-learn models with skops instead of pickle; the code here uses the current APIs and was run where libraries were available. Product names and versions change monthly in this field, so the book teaches the mechanisms first and the tools second.
Contents
- SC·00Start Here: From a Model to a SystemFor 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…5 min
- SC·159EmbeddingsRepresenting meaning as geometry: from one-hot vectors to dense embeddings, the distributional hypothesis and word2vec, contextual and sentence…19 min
- SC·160Vector DatabasesStoring and searching millions to billions of embeddings fast: why exact search stops scaling, approximate nearest-neighbour search and the…20 min
- SC·161Retrieval-Augmented GenerationGrounding LLM answers in your own data, stage by stage: why RAG beats stuffing or fine-tuning for knowledge, document parsing (HTML, PDF, tables…22 min
- SC·162RAG EvaluationMeasuring a RAG system part by part so you know what to fix: why end-to-end impressions mislead, building a golden dataset (real queries, reference…16 min
- SC·163Fine-TuningAdapting a pre-trained model's weights to your task, and knowing when not to: what fine-tuning changes well (format, style, narrow skills…19 min
- SC·164Preference Optimisation and AlignmentTeaching models what "better" means when good behaviour is easier to judge than to write: what alignment aims for (helpful, honest, harmless) and why…18 min
- SC·165QuantizationMaking models smaller and faster by using fewer bits, and knowing what it costs: how floating-point formats work (sign, exponent, mantissa) for FP32…17 min
- SC·166LLM InferenceHow LLMs are served efficiently, from one token to millions of users: prefill and decode as compute-bound and memory-bound phases with roofline…18 min
- SC·167Structured OutputsGetting machine-readable, type-safe results from a model that produces text: why free text breaks integrations, JSON and its pitfalls, JSON Schema…18 min
- SC·168Tool CallingLetting a model act through your code safely: how tool (function) calling works as a message protocol, writing function schemas models use well…22 min
- SC·169AgentsSystems where a model decides what to do next: the spectrum from deterministic workflows through LLM workflows to autonomous agents and how to choose…16 min
- SC·170Agent MemoryWhat an AI system remembers, where, and for how long: six distinct stores (context window, working memory, session state, long-term memory, external…16 min
- SC·171Agent OrchestrationRunning multi-step AI workflows reliably, like any other distributed workflow: orchestration as an explicit state machine or graph, sequential…20 min
- SC·172Tool and Context ProtocolsStandard ways for AI applications to discover and use tools and context, centred on the Model Context Protocol: why a protocol (the N×M integration…18 min
- SC·173Multimodal AIModels that see, hear and watch, and how to engineer with them: images as tensors and patches, vision Transformers and image-token arithmetic, image…20 min
- SC·174Generative MediaHow images, video and audio are generated and controlled: generative modelling recap (GANs, VAEs, autoregressive, diffusion, flow matching)…19 min
- SC·175AI EvaluationTreating evaluation as the core engineering discipline of AI systems: why evals are the specification, public benchmarks and what they can and can't…18 min
- SC·176AI SecuritySecuring systems where untrusted text can steer a model that holds tools and data: the threat model and trust boundaries of LLM applications, direct…18 min
- SC·177AI ObservabilitySeeing inside AI systems in production: why AI needs more than classic metrics, logs and traces, the four layers the roadmap lists (model: model and…17 min
- SC·178AI MLOpsThe operational lifecycle that keeps models and AI features correct after launch: the loop of data, training, evaluation, registry, deployment…15 min
- SC·179AI Serving and InfrastructurePutting models behind reliable, efficient interfaces: API styles (REST, gRPC, SSE, WebSockets, WebRTC) and when each fits, streaming tokens end to…19 min
- SC·180AI Production ArchitecturePutting every part of this volume together into systems that work in production: the roadmap's reference architecture layer by layer (user and UI…18 min
- SC·181Applied AI Systems ProjectsEight build-it-yourself projects that turn this volume into working systems: an embedding and vector-search lab on your own documents, a cited RAG…7 min