AI engineering: 26 hands-on labs
The code around a language model, one small function at a time: similarity, chunking, retrieval, context budgets, cited sources, tool policies, retries, the agent loop, permissions, checkpoints, evaluation and cost. No lab calls a model or needs an API key.
Model foundations
The numbers under a language model: vectors, similarity and probabilities, and how to check what a model sends back.
- Vector dot productA model cannot read words.
- Embedding similarityAn embedding is a vector that stands for the meaning of a piece of text.
- Stable token probabilitiesA language model does not pick the next word directly.
- Validate structured outputWhen your program asks a model for data, the reply is text.
Retrieval & context
How a document assistant finds the right text, fits it into a prompt, and keeps its sources honest.
These lessons come with a year of Algo150, $29 or ₾49. What a year includes
- Overlapping document chunksA model can only read a limited amount of text at once, and a search works better on small pieces than on whole…
- Rank a retrieval baselineRetrieval means finding the few documents that can answer a question, out of many.
- Fit a context windowA model reads everything you send it in one piece, called the context window, and that window has a fixed size…
- Check cited sourcesA document assistant answers from retrieved documents and names its sources.
- Build a prompt from partsA model answers from the text that it gets.
- Answer only from the sourcesA model can always write an answer, also when it has no evidence.
Safe tool use
What your own code must decide when a model asks to act: what may run, and how to retry without doing harm.
These lessons come with a year of Algo150, $29 or ₾49. What a year includes
- Gate tool executionA model can ask your program to run a tool, such as searching documents or sending an email.
- Bound retry delaysCalls to a model or a tool sometimes fail for a moment: the service is busy, or the network drops.
Agents
A model in a loop. Your code runs each tool that the model requests, stops the loop, keeps notes and decides when to search again.
These lessons come with a year of Algo150, $29 or ₾49. What a year includes
- The agent loopA model alone can only write text.
- Call a tool by its nameA model writes a tool call as text: a name and some arguments.
- Stop a loopAn agent decides its own next step, so it can make the same step again and again.
- Keep notes on the taskDuring a long task, an agent learns facts that it needs later.
- Search againA simple RAG system searches one time and uses what it finds.
- Answer from two documentsSome questions have no answer in one document.
Harness
The program around an agent. It decides what the agent can do without a question, reverts bad changes, and records, tests and limits each run.
These lessons come with a year of Algo150, $29 or ₾49. What a year includes
- PermissionsAn agent can read files, change them and run commands.
- CheckpointsAn agent changes files, and some changes are wrong.
- Compact the contextA long task fills the context window.
- Trace a runA run of an agent has many steps: calls to the model, searches, tools.
- Test an agentYou change a prompt, and the agent does one task better.
- Limits for a runAn agent decides its own steps, so nobody knows before the run how long it takes or what it costs.
Evaluation & shipping
Numbers that tell you whether a change helped, and what a request costs.
These lessons come with a year of Algo150, $29 or ₾49. What a year includes
- Measure retrieval recallAfter changing a search, how do you know it got better?
- Measure token costA model that a company runs for you, a hosted model, is paid for by the token.