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

04Agents

What an agent is: a model choosing its own actions in a loop.

THIS SECTION COVERS

The agent loop, tool calling, ReAct and planning, stopping conditions, levels of autonomy, when not to use an agent.

Related: Agentic design patterns · Harnesses

TOPICS · 6/6 WRITTEN

  1. 04.1What is an agent: the loopAn agent is a model that chooses its own steps, using tools, in a loop. What that means, what it is made of, and how it differs from a fixed workflow.
  2. 04.2Tool callingHow a model asks for an action. The request, the structured call, the result sent back, and where the tool actually runs.
  3. 04.3ReAct and planningTwo ways an agent decides what to do next: interleave a thought with every action (ReAct), or write a plan first and then execute it.
  4. 04.4Stopping conditions and budgetsHow an agent loop ends: the model finishes, or a limit stops it. Stop reasons, turn and budget caps, and detecting loops that go nowhere.
  5. 04.5Levels of autonomyA five-level scale of how much an agent acts without the user, named by the role the user plays, and why autonomy is a design choice rather than a by-product.
  6. 04.6When not to use an agentAgents cost latency, money and predictability. When one call or a fixed workflow is the better answer, and the tests that justify reaching for an agent.
← PREVIOUS SECTIONRAG and retrievalNEXT SECTION →Agentic design patterns