Skip to content

Agents, Deep Dive

A complete, working reference on LLM agents — from the workflow-vs-agent distinction up through tool use, context and memory, multi-agent systems, production engineering, security and governance, and training agents with reinforcement learning — plus real case studies and end-to-end tutorials. A companion to RAG, Deep Dive.

Every page follows the same standard: real, tested code where a technique can be demoed (not pseudocode), current research rather than recycled tutorial content, and an honest report of what actually happened when the code ran — including the times it surfaced something genuinely surprising, or didn't work at all. Where a claim is measured, the numbers on the page are from a real run, not an estimate. Fast-moving claims (a library version, a protocol spec, a benchmark score) are stamped with the date they were checked, because this field moves within months.

How to use this site

Each page is self-contained: problem it solves → mechanism → worked example → trade-offs → an interview-ready one-liner. Most pages end with a scenario-based quiz to check whether the concept actually stuck, and an interview angle naming what a weak versus strong answer looks like. New here? Start with What Is an Agent?. Prepping for an interview? Jump straight to the Revision page — every page's TL;DR, quiz, and flashcards in one place. Every page also links to a real, runnable recipe in the companion cookbook.

Foundations

  • What Is an Agent? — the workflow-vs-agent distinction, worked through a real example, with contested definitions named rather than papered over.
  • The Agent Loop From Scratch — tool-calling mechanics, stop conditions, and a provider-neutral loop, built by hand.
  • Workflow Patterns — chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer.
  • Reasoning Paradigms — ReAct, Reflexion, Plan-and-Solve, ReWOO, LLM Compiler, ToT and LATS.
  • Choosing a Framework — LangChain/LangGraph, OpenAI Agents SDK, Pydantic AI, Claude Agent SDK, and the own-the-loop debate.

Tools and Context

  • Tool Design — schema as prompt, errors as observations, the agent-computer interface.
  • Context Engineering — write, select, compress, isolate; context rot and the four context failures.
  • Tools at Scale — tool retrieval, programmatic tool calling, code execution over MCP.
  • MCP Deep Dive — the current spec, transports, auth, security, servers and clients.
  • MCP and Tool Ecosystem — registries, gateways, remote servers, browser infrastructure, tool platforms.
  • Skills, A2A and Other Protocols — Agent Skills and progressive disclosure, A2A, AG-UI, ACP, AGENTS.md.
  • KV-Cache Economics — cache-stable prompts, tool masking versus removal.
  • Memory Architectures — the four-type taxonomy, MemGPT, Mem0, graph memory, memory poisoning.
  • Models for Agents — frontier, small and local models, tool-calling reliability, routing.

Systems

Production

Training

Case Studies

  • Case Studies — real, primary-sourced stories of agents in production and in incidents: a database deleted despite explicit instructions not to, a self-improving agent editing its own resource limit, a real 560,000-resolution-a-month support deployment, and more.

Tutorials & Code

  • Tutorials & Code — end-to-end builds combining several pages into one real, production-shaped project, starting with a support agent that ties together tool design, memory, and risk-tiered guardrails.

Interview prep

  • Interview Playbook — an evidence-graded synthesis of real interview reports, company-published process changes, and job-description data, not a recycled question list.
  • Revision — every page's TL;DR, quiz, and flashcards, merged into one page for a fast pass before an interview.