AI Engineering
How AI products really work, from a single model call to a production agent that listens, looks, acts and remembers.
- stories
- 45
- parts
- 9
- to watch
- 9 h
One call
What a model is from the outside, and everything inside a single request.
Hello
HM Nayem asks a shop's chat a simple question. Follow the message to the AI and watch the reply come back one piece at a time.
The shop gives it a voice
The same question gets a useless answer, then a great one. The model did not change. See what did.
It forgot my name
HM Nayem says hello, and one message later the assistant has forgotten the name. Find out where a chatbot's memory really lives.
Fill in the form
HM Nayem writes one friendly sentence asking to return a jacket. Watch it become a form that software can act on.
Giving it knowledge
How an assistant answers from documents its model never read.
It made that up
The assistant confidently quotes a returns policy the shop never had. See why a model invents things, and what stops it.
Finding the right page
The shop has two thousand help pages and HM Nayem has one question. Watch the right three paragraphs get found, by meaning, in a blink.
When search misses
The answer is in the help pages, but the search brings back the wrong ones. Follow the three fixes that find it.
Train it, or tell it?
The shop's owner wants a model trained on the shop's own data. See the three ways to change what a model does, and why training is usually the last one to reach for.
Giving it hands
How a model that can only write text gets real things done.
Where is my order?
HM Nayem asks about a parcel. The answer is in no help page and the model cannot know it. Watch how it gets it anyway.
Plugging in the world
One question needs the orders system, the store calendar and the courier. See how the assistant reaches all three without custom wiring for each.
Let it run the numbers
HM Nayem uploads a year of orders and asks for the total spent on boots. The model is bad at arithmetic, so it does something smarter.
Letting it work alone
What an agent is, and what keeps a long job on track.
Fix the failing test
HM Nayem tells a coding agent one sentence: the checkout test is failing, fix it. Watch it look, read, change, check and try again, on its own.
The window fills up
Forty rounds into a big job, the agent has read more than it can hold. See how it keeps going without losing the thread.
It remembers me
HM Nayem comes back a week later and the assistant still knows the right boot size. The model remembers nothing. So who does?
Crash at step 40
An agent is emailing 200 club members when its server restarts. Watch it pick up exactly where it stopped, without emailing anyone twice.
A team of agents
One agent splits a research job between three helpers. See what that buys, what it costs, and what gets lost on the way.
Inside the harness
What the code around a model is made of, and how it decides what the model sees.
What the model actually sees
A customer gets a perfect answer. Open up the single block of text the model read to write it, and see why each part is there and in that order.
The anatomy of a harness
One sentence goes in and twelve emails go out. Slow the harness right down and name its ten parts, one at a time.
Designing a tool
The model keeps choosing the wrong tool. It is not being stupid. See what it was given to go on, and fix the tools instead of the model.
Trusting it
How teams measure quality and contain what can go wrong.
One line of the prompt changes
HM Nayem adds a single sentence to an assistant's instructions. It looks better. Follow the check that shows it quietly got worse.
Grading an agent
An agent says the refund is done. Was it? Follow how an agent is tested on what it did, step by step, and not on what it said.
The poisoned web page
HM Nayem asks an assistant to summarise a web page. The page has other plans. Watch the attack work, then watch three layers stop it.
What it shouldn't see
HM Nayem pastes a card number into the shop's chat. Follow it, and see every place it is kept out of.
Guards at both doors
Abuse comes in and a made-up promise goes out. Watch the checks on each side of the model, what they catch, and what they cost.
Beyond text
Photos, voices and screens.
A receipt becomes a row
HM Nayem photographs a crumpled receipt for the hiking club's accounts. See how a picture turns into clean numbers in a spreadsheet.
The voice on the phone
HM Nayem calls the shop and a voice answers. Follow the words as they become text, an answer, and speech again in under a second.
Clicking for you
A campsite booking site has buttons for people and nothing for software. So HM Nayem's assistant uses it the way a person would.
Running it for real
Cost, failure, and finding out what happened.
The bill arrives
One reply to HM Nayem costs about a cent. The shop sends a million a month. See where the money goes, and four moves that cut the bill to a fifth.
Never work it out twice
Four hundred people a day ask the shop when it opens, and each answer is paid for. See four places an answer can be kept, and how each one goes wrong.
Which model for which job
The shop sends every message to its biggest model. Most of them are easy. Watch a router send each one to the smallest model that can handle it.
Launch day
The shop's biggest sale begins, traffic jumps tenfold and the model provider stumbles. Watch HM Nayem's message survive it.
Why did it say that?
HM Nayem is told something that is not true. Trace the reply back through every step to find the one that went wrong. It is not the one you expect.
A new model arrives
The provider releases a better model and will switch the old one off. HM Nayem swaps it in, and three things quietly break.
Rolling it out
A better prompt is ready. Follow it from HM Nayem's laptop to every customer, a few at a time, with a switch that takes it back in seconds.
The whole machine
HM Nayem calls about a damaged parcel, sends a photo and gets a refund. Every idea so far, in one request, and nothing in it is new to you.
Build one yourself
Ten real products, built the way they are built in production, one part at a time. Each build goes deeper than the last, from 28 steps to 50.
Build: ask the handbook
HM Nayem's hiking club has 400 files and the same ten questions every week. Build the page that answers them, one part at a time, and watch each version fail in a new way.
Build: a support assistant
The shop wants an assistant that can find an order and refund it. Build it from a bare chat to one that knows when to stop and fetch a person.
Build: ask the database
The shop's manager wants to ask the sales data a question in plain words and trust the number that comes back. Build it, and meet every way a correct-looking query can be wrong.
Build: a pull-request reviewer
Nobody chats with this one. A change is pushed, and comments appear on it. Build the reviewer that wakes up, reads the change and says only what matters.
Build: a document pipeline
Ten thousand supplier invoices arrive every month and nobody chats with any of them. Build the line that reads, checks and files them overnight, and knows which ones need a person.
Build: a coding agent
Start with a model that can only talk about code. Add one tool at a time until it can read, edit, run and check its own work.
Build: a research assistant
HM Nayem asks one hard question about tents. Build the assistant that plans, searches, reads thirty pages and writes a report with every claim sourced.
Build: a personal assistant
It reads HM Nayem's inbox every morning, drafts the replies and remembers what matters. Build it so that one hostile email cannot turn it against its owner.
Build: a voice assistant
A caller wants an appointment, and will not wait three seconds in silence. Build the assistant that listens, books and speaks inside a strict time budget.
Build: a browser agent
The site has no way in for software, only buttons for people. Build the agent that looks, clicks, checks and recovers, and stops before it pays.
That is the whole book. Every idea in it has its own page in the AI Engineering glossary.