Agentic AI — Course

lecture + exercises + lab + tutorials

Agentic AI systems combine language models with tools, memory, and autonomous loops. This course builds them from first principles — foregrounding the mathematics and algorithms / data structures — before any framework. But in the lab: pydantic-ai.

Prerequisites: Mathematics (probability and linear algebra), plus prior courses in data science and machine learning.

Contents (preliminary syllabus)

Status: Alpha - Work in progress

Part I — Foundations

Lecture Topic Slides Exercises Lab
1 L-Intro Introduction to Agents & the Training Ladder lecture exercises lab
2 L-ReAct The ReAct Loop & Tool Use lecture exercises lab

Part II — Reasoning & Planning

Lecture Topic Slides Exercises Lab
3 L-Decomp Task Decomposition & Planning lecture exercises lab
4 L-ToT Tree-of-Thoughts & Search lecture

Part III — Model & Data

Lecture Topic Slides Exercises Lab
5 L-Att Inside the Model: Tokenization, Attention & Context Window lecture
6 L-Embed Embeddings & Vector Arithmetic lecture
7 L-RAG Vector Databases & (Agentic) RAG lecture
8 L-Memory Sessions, Memory & Compaction lecture

Part IV — Evaluation & Systems

Lecture Topic Slides Exercises Lab
9 L-Orch State Machines & Workflow Orchestration lecture
10 L-Eval Observability & Evaluation
11 L-MAS Multi-Agent Systems: Organization & Coordination

Part V — Safety & Wrap-up

Lecture Topic Slides Exercises Lab
12 L-Gateway Gateway, Security & Guardrails
13 L-Practice Agents in Practice (Production)
14 L-Outlook Outlook & Ethics

Extended Course (optional)

Lecture Topic Slides Exercises Lab
15 L-MDP Agents as Markov Decision Processes lecture
16 L-Game Game Theory for Multi-Agent Systems
17 L-Collective Collective Decisions & Agent Populations

Fundamentals

A fundamentals notebook recaps the mathematics the lectures needed. It carries no exercises; the exercises on the material are part of the lectures that use it.

Topic Content Used in Notes
Probability sample space, random variables, joint, marginal and conditional distributions, conditional independence L-Intro, L-Att notes
Statistics standard error of a success rate, 95 % interval, Wald test for two success rates L-Eval notes
Linear Algebra vectors, dot product, norms, angle between two vectors L-Embed, L-RAG notes

Tutorials

A tutorial is a self-contained jupyter notebook.

Tutorial Content Requires Notebook
Building a SWE Agent from Scratch a software-engineering agent in plain Python — model call, action parsing, a sandboxed shell and the loop — extended step by step into mini-swe-agent Ollama, podman notebook

Python Basics

A Python basics notebook explains one Python construct that the exercises, labs and tutorials use without explaining it. No notebook needs a language model or a network connection; each ends with tasks and their solutions. The numbers give a reading order in which each notebook uses only constructs of earlier ones. Requirements: Python ≥ 3.12.

Topic Content Requires Notebook
Functions as Values first-class functions, lambda, closures and late binding, factory functions, *args / **kwargs, the tool registry — notebook
Decorators @dec as f = dec(f), wrapper functions, decorators with arguments, registration decorators, registration by a call — notebook
Dataclasses generated methods, mutable defaults, derived and frozen fields, asdict, NamedTuple, choice of record type —
Type Hints built-in generic types, X \| None, Literal, Callable, TypedDict, Annotated, annotations read at run time —
Pydantic Models validation at the boundary, Field constraints, validators, nested models, JSON Schema, structured output with retry pydantic
Generics type variables, generic functions and classes, bounded type variables, generic pydantic models; reading guide for PydanticAI pydantic
JSON and Tool Schemas JSON and JSON Lines, tool schema from a function, extraction of JSON from a reply, argument check, substitution with re.sub, arithmetic expressions without eval —
Coroutines and asyncio async / await, the event loop, gather, asynchronous context managers and iterators, manual iteration with anext — notebook
Tasks, Cancellation and Concurrency Limits tasks, cancellation, TaskGroup, time limits, blocking calls and to_thread, the event loop of a thread, semaphores —
Exceptions, Retries and Context Managers the exception hierarchy, errors as observations, user-defined exceptions, retry with exponential backoff, the with statement —
Processes and Threads subprocess.run with exit status and time limit, threads and shared state, the global interpreter lock, choice of mechanism —
NumPy for the Course arrays, matrix products, axes and reductions, cosine similarity, broadcasting, top-$k$, softmax, powers of a transition matrix numpy

Literature & further reading

Agentic patterns & engineering

  • Gulli, A. (2025). Agentic Design Patterns. Springer.
  • Lakshmanan, V.; Hapke, H. (2025). Generative AI Design Patterns: Solutions to Common Challenges When Building GenAI Agents and Applications. O'Reilly.
  • Huyen, C. (2025). AI Engineering: Building Applications with Foundation Models. O'Reilly.
  • Albada, M. (2025). Building Applications with AI Agents: Designing and Implementing Multiagent Systems. O'Reilly — German ed.: KI-Agenten entwickeln: Entwurf, Implementierung, Monitoring (transl. F. Langenau, dpunkt.verlag, 2026).
  • Ryan R. (2026), The Agentic AI book: From Language Models to Intelligent Agents

Multi-agent, protocols & MCP

  • Dibia, V. (2025). Designing Multi-Agent Systems: Principles, Patterns, and Implementation for AI Agents. Self-published — multiagentbook.com.
  • Lanham, M. (2026). AI Agents in Action (2nd ed.). Manning — MCP & A2A protocols.
  • Shoham, Y.; Leyton-Brown, K. (2009). Multiagent Systems: Algorithmic, Game-Theoretic, and Logical Foundations. Cambridge University Press — the standard MAS textbook; full text free at masfoundations.org (L-MAS, L-Game).
  • Arsanjani, A.; Bustos, J. P. (2026). Agentic Architectural Patterns for Building Multi-Agent Systems. Packt — agentic patterns, RAG, LLMOps, enterprise-scale systems (L-RAG, L-MAS, L-Practice).

Foundations & "inside the LLM"

  • Russell, S.; Norvig, P. (2021). Artificial Intelligence: A Modern Approach (4th ed.). Pearson — classical-AI foundations: intelligent agents, search ($A^*$, L-Decomp, L-ToT), sequential decisions / MDPs (L-MDP), and Multiagent Decision Making (Ch. 18; Ch. 17 in the Global Edition — game theory; L-Game).
  • Sutton, R. S.; Barto, A. G. (2018). Reinforcement Learning: An Introduction (2nd ed.). MIT Press — finite MDPs, returns & value functions, Bellman equations (L-MDP).
  • Raschka, S. (2024). Build a Large Language Model (From Scratch). Manning — attention, tokenization, KV-cache (L-Att).
  • Alammar, J.; Grootendorst, M. (2024). Hands-On Large Language Models: Language Understanding and Generation. O'Reilly — vector spaces & embeddings (L-Embed).

Frameworks & agentic software engineering

  • Oshin, M.; Campos, N. (2025). Learning LangChain: Building AI and LLM Applications with LangChain and LangGraph. O'Reilly — graph-based state machines (L-Orch).
  • Hassan, A. E., et al. (2025). Agentic Software Engineering: Foundational Pillars and a Research Roadmap. arXiv:2509.06216 — the SASE framework (capstone, L-ASE).
  • Hassan, A. E., et al. (2026). Agentic Software Engineering (book) — companion to the SASE paper (capstone, L-ASE).