HomeWritingNotesContact
NOTES · CONTENTS

FOUNDATIONS

01LLM fundamentals
  • Tokens and tokenisation
  • Transformers and attention
  • How models are trained
  • Sampling and decoding
  • Reasoning models
  • Capabilities and failure modes
02Prompting and context engineering
  • Prompt design
  • Few-shot examples
  • Structured outputs
  • The context window as a budget
  • Long-context trade-offs
  • Compaction and summarisation
  • Memory
03RAG and retrieval
  • RAG overview
  • Chunking
  • Embeddings and vector search
  • BM25 and sparse retrieval
  • Hybrid search and reranking
  • Query rewriting
  • Agentic RAG
  • Measuring retrieval

BUILDING AGENTS

04Agents
  • What is an agent: the loop
  • Tool calling
  • ReAct and planning
  • Stopping conditions and budgets
  • Levels of autonomy
  • When not to use an agent
05Agentic design patterns
  • Workflows vs agents
  • Reflection
  • Human in the loop
  • Multi-agent systems
  • Error handling and recovery
  • Choosing a pattern
06Harnesses
  • Agent = model + harness
  • The execution loop
  • Tool design and the tool registry
  • Model Context Protocol (MCP)
  • Agent-to-agent protocols (A2A)
  • State and checkpoints
  • Hooks and lifecycle events
  • Subagents and delegation
  • Case study: coding agents
07Frameworks and SDKs
  • Building without a framework
  • Choosing a framework
  • LangGraph
  • OpenAI Agents SDK
  • Claude Agent SDK
  • Google ADK
  • CrewAI
  • Pydantic AI

RUNNING IN PRODUCTION

08Evals and observability
  • Why evals come first
  • Tracing and operational monitoring
  • Building eval sets
  • Evaluators and LLM-as-judge
  • Evaluating routers, tools and skills
  • Trajectories and final outcomes
  • Experiments and eval-driven development
  • Benchmarks and their limits
  • Online evals and A/B tests
09Safety and guardrails
  • Threat model
  • Prompt injection
  • Permissions
  • Sandboxing
  • Input and output guardrails
  • Human approval
  • Red teaming
10Inference and serving
  • Latency and cost
  • The KV cache
  • Batching
  • Quantisation
  • Speculative decoding
  • Mixture of experts
  • Prompt caching
  • Serving stacks
11Fine-tuning and adaptation
  • When to fine-tune
  • Supervised fine-tuning
  • LoRA and QLoRA
  • Preference tuning: RLHF and DPO
  • Distillation
  • Preparing training data

APPLIED AND REFERENCE

12Healthcare AI
  • The healthcare AI landscape
  • Clinical NLP
  • Evidence appraisal
  • Clinical decision support
  • Validation and safety in medicine
  • Privacy and regulation
13Reading list and glossary
  • Foundational papers
  • Reading list: agents
  • Books
  • Glossary
ABOUT · SOURCES & ATTRIBUTION

NOTES / PART 2 · BUILDING AGENTS

05Agentic design patterns

Reusable ways to compose LLM calls and agents.

THIS SECTION COVERS

Workflows vs agents, prompt chaining, routing, parallelisation, orchestrator-workers, evaluator-optimizer, reflection, human-in-the-loop, multi-agent systems, error recovery, choosing a pattern.

Related: Agents · Harnesses

TOPICS · 6/6 WRITTEN

  1. 05.1Workflows vs agentsThe split between fixed LLM pipelines and model-directed agents, and the five workflow patterns that sit between them.
  2. 05.2ReflectionHave the model critique its own output and try again. Self-Refine, Reflexion, and why the critique works best when something outside the model checks the work.
  3. 05.3Human in the loopPausing an agent for a person to approve, edit or reject what it is about to do: where to put the gate, and what has to be saved while it waits.
  4. 05.4Multi-agent systemsWhen several agents beat one, when they do not, and the two main shapes: orchestrator-worker and handoff. With the evidence for and against.
  5. 05.5Error handling and recoveryHow an agent should treat failures: return them as readable results, classify them, retry what is worth retrying, and stop what is not.
  6. 05.6Choosing a patternA decision guide that ties the patterns together: match the shape of the task to the simplest pattern, and move up only when evals say you must.
← PREVIOUS SECTIONAgentsNEXT SECTION →Harnesses