Agentic Software Engineering

Agentic software engineering is the craft of building reliable software around large language models that plan, call tools and act, and of using such agents to build software. This site shares the slides, notes and labs I teach in Building Usable Software (BUS), a University of Birmingham module offered in the January term, with anyone who wants to learn.

BUS students

The same slides and labs are on Canvas, together with quizzes and assessment details, which are not published here.

Everyone else

The topics build on each other, so start from the top if the subject is new to you. Basic Python is enough; no machine-learning background is assumed.

Contents

Topics are linked as the slides are finalised during the term. "Soon" marks material not yet published.

Show columns:
#TopicSub-topicsSlidesNotes
Part I · Foundations
1Introduction to agentic engineeringFrom vibe coding to agentic engineering · from a model to a system · the parts of an agent · workflows vs agents · the capability–reliability gap · the running example
2Large language models for engineersTokens and generation · sampling · the Transformer and attention · the context window · training: pretraining to assistant, reasoning and tool use · inference cost and the KV cache · reasoning models · large and small models · hallucination
3APIs for software and agentsClients, servers and resources · HTTP · REST principles · methods and idempotency · status codes · authentication · designing REST APIs · OpenAPI · the model as a web API · stateless conversations
4Prompt engineeringInstructions, roles and system prompts · zero-shot and few-shot · chain of thought and its cost · self-consistency and self-checking · decomposition and chaining · prompt optimisation and DSPy · background context · structured output and constrained decoding
LabLab: Setting up Ollama and prompt engineeringRunning a small open model with Ollama in Colab · prompt engineering in practice
5Retrieval-augmented generationWhy retrieval · chunking · embeddings and similarity · storing and searching · grounded prompts · tracing failures · hit rate · keyword and hybrid search · re-ranking and filters · limits and security
LabLab: Retrieval-augmented generationBuilding a RAG pipeline over TuneFinder's song notes · measuring retrieval
Part II · Building agents
6Complex tasksWhat makes a task complex · limits of one prompt · accuracy as tasks grow · splitting into subtasks
7Workflow patternsSystems as graphs: state and transitions · prompt chaining · routing · parallelisation · orchestrator–workers · evaluator–optimiser · plan-and-execute · choosing a pattern
8Tools, the agent loop and MCPWhy tools · function calling step by step · how models choose tools · small models and tools · the agent loop and ReAct · designing robust tools · errors, retries and fallbacks · the Model Context Protocol · MCP security
9Workflows or agents?The agent loop as a graph · planning first vs step by step · when to use each · token cost and autonomy · token-budget-aware development
LabLab: AgentsBuilding and running an agent with tools
Part III · Running agentic systems
10Context engineering and memoryWhere tokens go · prompt caching · compaction · agentic RAG · Agent Skills and progressive disclosure · short- and long-term memory · writing, reading and forgetting · memory vs RAG
11Multiple agents and A2AOne agent or several · evidence for and against · topologies · how multi-agent systems fail · design rules · the Agent-to-Agent protocol: agent cards, tasks, risks · MCP vs A2A
12Observability and human oversightTraces and spans · OpenTelemetry · failure signatures · replay · metrics across traces · privacy of traces · where to place a person · pausing and resuming · the cost of asking
13Building a harnessWhat a harness is · the agent–computer interface · a minimal coding-agent harness · tool and context layers · memory across sessions · permissions and sandboxes · checks the harness runs
Part IV · Building software with agents
14Coding agentsMeasuring coding agents · localise, edit, verify · agent or fixed workflow · context quality · plan before code · instruction files · checks that steer the agent · reviewable pull requests
15The life cycle and specificationsThe life cycle with agents · what the evidence says · why specs · user stories, EARS, Given/When/Then, ADRs · spec to plan to tasks · spec to tests
16Designing maintainable softwareMaintainability of agent-written code · design patterns: Singleton, Adapter, Decorator, Observer, publish–subscribe · patterns in the spec · limits
17Safety and guardrailsWhat can go wrong · threat models · prompt injection and the lethal trifecta · limiting what agents can do · guardrail layers · testing safety
Part V · Quality assurance
18Software testingSoftware quality · test scenarios and cases · levels and types · equivalence partitioning and boundary values · coverage · test plans · automation with pytest · test doubles
LabLab: Testing with pytestWriting and running tests with pytest
19Testing agentic systemsWhy classic tests break · testing the code around the model · golden sets and graders · LLM judges · trajectory evaluation and pass^k · adversarial evaluation · evals in CI
20Testing with agentsAgents that write tests · agents as fuzzers · reviewing AI-written tests · mutation and property-based testing
Planned
—Responsible AIAccountability for agent-written code · over-reliance · licence and provenance · regulation
—Case study: computer-use agentsAgents that operate graphical interfaces

The running example

Most topics return to TuneFinder, a music assistant that turns a request such as "something upbeat from the eighties" into a song search and plays the result. It grows from a single model call into a system with retrieval, tools, several agents, monitoring and tests.

Labs and tools

Labs run in Google Colab with small open models (1 billion parameters or fewer) served by Ollama, so no paid API key is needed; the same code runs against hosted models. Libraries include LangChain, LangGraph, Chroma, FastMCP and pytest.

Updates

Get involved

If you are interested in these topics, feel free to contact me. I am always looking for collaborators who can contribute, suggest new topics and edit the materials.