Edition 1 · November 2026
AI Systems Engineering
A visual desk reference
LLMs, RAG, agents, and LLMOps. One diagram per page, and only what you need to recall how it works.
- 42 pages
- 28 one-page diagrams
- 2 reference architectures
- 20 formulas
- 236-term glossary
PDF · 42 pages · A4 · 1.3 MB

Build · Evaluate · Deploy · Monitor
Free to share unchanged, with credit to razajahangir.dev. Not for resale.
Inside the book
How today’s transformer models work, how to fine-tune them, and how to build RAG and agent systems on top. It is not a course in the deeper ML maths and science.
The diagram
One concept, drawn so you can recall how it works at a glance. Read it before the text.
In production
What changes once real users arrive: the limits, defaults, and failure modes worth knowing.
Web-dev lens
The idea mapped to something a backend or web developer already knows.
Contents
Each topic opens the PDF at its page, in browsers that support it.
Part 1 · Foundations
- How an LLM generates textA decoder-only transformer, one token at a time.3
- Attention, up closeEvery token looks at every earlier token and takes a weighted mix.4
- Embeddings & vector searchText becomes a point; similar meaning means a nearby point.5
- Inference: prefill, decode, KV cacheWhy the first token is slow and the rest are fast.6
- How models are trainedFour stages make a model. One simple loop drives all of them.7
- Fine-tuning with LoRAChange behaviour by training a small add-on, not the model.8
- Choosing a modelFour questions narrow down the options.9
Part 2 · RAG
Part 3 · Agents
- The ReAct agent loopThink, act, observe. Repeat until done.14
- LangGraph in one pageAn agent is a graph: state flows through nodes along edges.15
- Workflows vs agentsFive patterns. Most production work is a workflow.16
- Subagents, handoffs, skills, routerThe four multi-agent building blocks.17
- How agents act and planFour ways an agent turns a decision into action.18
- Memory & MCPWhat an agent remembers, and how it reaches the outside world.19
- Context engineeringDecide what the model sees at each step. Nothing else reaches it.20
Part 4 · LLMOps
- The LLMOps lifecycleBuild, evaluate, deploy, monitor. Then loop.21
- Structured outputGet data your code can trust, not text you have to parse.22
- Tracing & evalsSee what happened. Prove it still works.23
- Guardrails & privacyCheck what goes in. Check what comes out.24
- Cost & latencyTwo formulas explain almost every bill and every wait.25
Part 5 · Decide & design
- Decision treesThree yes/no questions that settle most design arguments.26
- Numbers to knowTypical values, so you can tell normal from broken at a glance.27
- Anti-patternsCommon mistakes, and what to do instead.28
- Reference: enterprise RAG chatbotEvery piece from Parts 2 and 4, wired into one system.29
- Reference: private AI stackA self-hosted setup where sensitive data never leaves the network.30





