EVERYTHING AIAI engineering, made visual
Phase 14Complete55 hPrereq · Phase 11 LLM Engineering and Phase 13 Tools and Protocols.

Agent Engineering

The core of modern AI engineering. Build agents from first principles.

54 lessons · 0 visual stories

0/54 complete · 0%
#LessonTypeLanguagesTimeOpen
01The Agent Loop: Observe, Think, ActEvery agent in 2026 is a variant of the ReAct loop from 2022 — Claude Code, Cursor, Devin, Operator included. Reasoning tokens interleave with tool calls and observations until a stop condition fires. Learn this loop cold before touching any framework.Build60 min↗ Official lesson02ReWOO and Plan-and-Execute: Decoupled PlanningReAct interleaves thought and action in one stream. ReWOO separates them: one big plan up front, then execute. 5x fewer tokens, +4% accuracy on HotpotQA, and you can distill the planner into a 7B model. Plan-and-Execute generalized it; Plan-and-Act scaled it to web navigation.Build60 min↗ Official lesson03Reflexion: Verbal Reinforcement LearningGradient-based RL needs thousands of trials and a GPU cluster to fix a failure mode. Reflexion (Shinn et al., NeurIPS 2023) does it in natural language: after each failed trial, the agent writes a reflection, stores it in episodic memory, and conditions the next trial on that memory. This is the pattern behind Letta's sleep-time compute, Claude Code's CLAUDE.md learnings, and pro-workflow's learn-rule.Build60 min↗ Official lesson04Tree of Thoughts and LATS: Deliberate SearchA single chain-of-thought trajectory has no room to backtrack. ToT (Yao et al., 2023) turns reasoning into a tree with self-evaluation on each node. LATS (Zhou et al., 2024) unifies ToT with ReAct and Reflexion under Monte Carlo Tree Search. Game of 24 goes from 4% (CoT) to 74% (ToT); LATS hits 92.7% pass@1 on HumanEval.Build75 min↗ Official lesson05Self-Refine and CRITIC: Iterative Output ImprovementSelf-Refine (Madaan et al., 2023) uses one LLM in three roles — generate, feedback, refine — in a loop. Average gain: +20 absolute on 7 tasks. CRITIC (Gou et al., 2023) hardens the feedback step by routing verification through external tools. In 2026 this pattern ships in every framework as "evaluator-optimizer" (Anthropic) or a guardrail loop (OpenAI Agents SDK).Build60 min↗ Official lesson06Tool Use and Function CallingToolformer (Schick et al., 2023) started self-supervised tool annotation. Berkeley Function Calling Leaderboard V4 (Patil et al., 2025) sets the 2026 bar: 40% agentic, 30% multi-turn, 10% live, 10% non-live, 10% hallucination. Single-turn is solved. Memory, dynamic decision-making, and long-horizon tool chains are not.Build60 min↗ Official lesson07Agent Memory — Virtual Context and Memory PagingContext windows are finite. Conversations, documents, and tool traces are not. The fix is OS virtual memory restated — main context is RAM, external store is disk, the agent pages between them. MemGPT (Packer et al., 2023) named the pattern; many production memory systems build on it.Build75 min↗ Official lesson08Memory Blocks and Sleep-Time ComputeDiscrete functional memory blocks the model can edit directly, and a sleep-time agent that consolidates memory asynchronously while the primary agent is idle. These two ideas are how you scale memory beyond one conversation.Build75 min↗ Official lesson09Hybrid Memory: Vector + Graph + KVHybrid memory runs three stores in parallel — vector for semantic similarity, KV for fast fact lookup, graph for entity-relationship reasoning — with a scoring layer that fuses them on retrieval. This is a widely used production pattern for external memory; Mem0 (Chhikara et al., 2025) is one reference implementation.Build75 min↗ Official lesson10Skill Libraries and Lifelong Learning (Voyager)Voyager (Wang et al., TMLR 2024) treats executable code as a skill. Skills are named, retrievable, composable, and refined by environment feedback. This is the reference architecture for Claude Agent SDK skills, skillkit, and the 2026 skill-library pattern.Build75 min↗ Official lesson11Planning with HTN and Evolutionary SearchSymbolic planning handles the cases where the plan is provably correct. Evolutionary code search handles the cases where the fitness function is machine-checkable. ChatHTN (2025) and AlphaEvolve (2025) show what each unlocks when paired with an LLM.Build75 min↗ Official lesson12Anthropic's Workflow Patterns: Simple Over ComplexSchluntz and Zhang (Anthropic, Dec 2024) distinguish workflows (predefined paths) from agents (dynamic tool-use). Five workflow patterns cover most cases. Start with direct API calls. Add agents only when steps cannot be predicted.Learn + Build60 min↗ Official lesson13Stateful Graph Orchestration — Durable Execution and CheckpointsAgent is a state machine; nodes are functions; edges are transitions; state is checkpointed after each node. Resume from any failure at the last successful checkpoint. LangGraph is the 2026 reference for this model of low-level stateful orchestration.Learn + Build75 min↗ Official lesson14The Actor Model for Agents — Async Messages and Typed RuntimesAgents as actors: async message exchange, event-driven handlers, fault isolation, natural concurrency. AutoGen v0.4 (Microsoft Research, Jan 2025) redesigned agent orchestration around this model; the framework is now in maintenance mode, with Microsoft Agent Framework (public preview Oct 2025) as its production successor.Learn + Build75 min↗ Official lesson15Role-Based Agent Teams — Roles, Tasks, ProcessesFour primitives: Agent, Task, Crew, Process. Two top-level shapes: Crews (autonomous, role-based collaboration) and Flows (event-driven, deterministic). CrewAI is the 2026 reference implementation, and its docs are blunt: "for any production-ready application, start with a Flow."Learn + Build60 min↗ Official lesson16OpenAI Agents SDK: Handoffs, Guardrails, TracingOpenAI Agents SDK is the lightweight multi-agent framework built on the Responses API. Five primitives: Agent, Handoff, Guardrail, Session, Tracing. Handoffs are tools named `transfer_to_<agent>`. Guardrails trip on input or output. Tracing is on by default.Learn + Build75 min↗ Official lesson17The Harness as a Library — Subagents and Session StoreA harness you can import: built-in tools, subagents for context isolation, hooks, W3C trace propagation, session persistence. The Claude Agent SDK is the reference example — the library form of the Claude Code harness — and Claude Managed Agents is the hosted alternative for long-running async work.Learn + Build75 min↗ Official lesson18Production Agent Runtimes — Fast Instantiation and Typed WorkflowsA production agent runtime optimizes what prototyping frameworks ignore: instantiation cost, typed workflow surfaces, and a serving-ready backend. The 2026 pairing: Agno (Python) aims at microsecond agent instantiation and stateless FastAPI backends. Mastra ships agents, tools, workflows, unified model routing, and composite storage on the Vercel AI SDK substrate.LearnPython, TypeScript45 min↗ Official lesson19Benchmarks: SWE-bench, GAIA, AgentBenchThree benchmarks anchor agent evaluation in 2026. SWE-bench tests code patching. GAIA tests generalist tool use. AgentBench tests multi-environment reasoning. Know their composition, their contamination story, and what they do not measure.Learn60 min↗ Official lesson20Benchmarks: WebArena and OSWorldWebArena tests web-agent capability across four self-hosted apps. OSWorld tests desktop-agent capability across Ubuntu, Windows, macOS. At release (2023–2024) both showed a big gap between best-in-class agents and humans. The gap is narrowing; the failure modes haven't changed.Learn60 min↗ Official lesson21Computer Use: Claude, OpenAI CUA, GeminiThree production computer-use models in 2026. All three are vision-based. All three treat screenshots, DOM text, and tool outputs as untrusted input. Only direct user instructions count as permission. Per-step safety services are the norm.Learn60 min↗ Official lesson22Voice Agents: Pipecat and LiveKitVoice agents are a first-class production category in 2026. Pipecat gives you a Python frame-based pipeline (VAD → STT → LLM → TTS → transport). LiveKit Agents bridges AI models to users over WebRTC. Production latency targets land at 450–600ms end-to-end for premium stacks.Learn60 min↗ Official lesson23OpenTelemetry GenAI Semantic ConventionsOpenTelemetry's GenAI SIG (launched April 2024) defines the standard schema for agent telemetry. Span names, attributes, and content-capture rules converge across vendors so agent traces mean the same thing in Datadog, Grafana, Jaeger, and Honeycomb.Learn + Build60 min↗ Official lesson24Agent Observability: Langfuse, Phoenix, OpikThree open-source agent observability platforms dominate 2026. Langfuse (MIT) — 6M+ installs/month, tracing + prompt management + evals + session replay. Arize Phoenix (Elastic 2.0) — deep agent-specific evals, RAG relevancy, OpenInference auto-instrumentation. Comet Opik (Apache 2.0) — automated prompt optimization, guardrails, LLM-judge hallucination detection.Learn45 min↗ Official lesson25Multi-Agent Debate and CollaborationDu et al. (ICML 2024, "Society of Minds") run N model instances that independently propose answers, then iteratively critique each other over R rounds to converge. Improves factuality, rule-following, reasoning. Sparse topology beats full mesh on token cost.Learn + Build60 min↗ Official lesson26Failure Modes: Why Agents BreakMASFT (Berkeley, 2025) catalogs 14 multi-agent failure modes in 3 categories. Microsoft's Taxonomy documents how existing AI failures amplify in agentic settings. Industry field data converges on five recurring modes: hallucinated actions, scope creep, cascading errors, context loss, tool misuse.Learn + Build60 min↗ Official lesson27Prompt Injection and the PVE DefenseGreshake et al. (AISec 2023) established indirect prompt injection as the defining agent security problem. Attacker plants instructions in data the agent retrieves; on ingest, those instructions override the developer prompt. Treat all retrieved content as arbitrary code execution on the tool-use surface.Build75 min↗ Official lesson28Orchestration Patterns: Supervisor, Swarm, HierarchicalFour orchestration patterns recur across 2026 frameworks: supervisor-worker, swarm / peer-to-peer, hierarchical, debate. Anthropic's guidance: "It's about building the right system for your needs." Start simple; add topology only when a single agent plus five workflow patterns is insufficient.Learn + Build60 min↗ Official lesson29Production Runtimes: Queue, Event, CronProduction agents run on six runtime shapes: request-response, streaming, durable execution, queue-based background, event-driven, and scheduled. Pick the shape before you pick the framework. Observability is load-bearing at every shape.Learn60 min↗ Official lesson30Eval-Driven Agent DevelopmentAnthropic's guidance: "start with simple prompts, optimize them with comprehensive evaluation, and add multi-step agentic systems only when needed." Evaluation is not the last step. It's the outer loop that drives every other choice in Phase 14.Learn + Build60 min↗ Official lesson31Agent Workbench Engineering: Why Capable Models Still FailA capable model is not enough. Reliable agents need a workbench: instructions, state, scope, feedback, verification, review, and handoff. Strip those away and even a frontier model produces work that is unsafe to ship.Learn + Build45 min↗ Official lesson32The Minimal Agent WorkbenchThe smallest useful workbench is three files: a root instructions router, a state file, and a task board. Everything else is layered on top. If a repo cannot carry these three, no model will save it.Build45 min↗ Official lesson33Agent Instructions as Executable ConstraintsInstructions written as prose are wishes. Instructions written as constraints are tests. The workbench turns each rule into something an agent can check at runtime and a reviewer can verify after the fact.Build50 min↗ Official lesson34Repo Memory and Durable StateChat history is volatile. The repo is durable. The workbench stores agent state in versioned files so the next session, the next agent, and the next reviewer all read from the same source of truth.Build60 min↗ Official lesson35Initialization Scripts for AgentsEvery session that starts cold pays a tax. The agent reads the same files, retries the same probes, and rediscovers the same paths. An init script pays the tax once and writes the answers into state.Build45 min↗ Official lesson36Scope Contracts and Task BoundariesThe model does not know where the work ends. A scope contract is a per-task file that says where the work begins, where it ends, and how to roll back if it spills. The contract turns "stay in scope" from a wish into a check.Build50 min↗ Official lesson37Runtime Feedback LoopsAgents that do not see real command output guess. A feedback runner captures stdout, stderr, exit code, and timing into a structured record the next turn can read. Then the agent reacts to facts instead of to its own prediction of facts.Build50 min↗ Official lesson38Verification GatesThe agent does not get to mark its own work as done. A verification gate reads the scope contract, the feedback log, the rule report, and the diff, and answers a single question: is this task actually complete? If the gate says no, the task is not done, no matter what the chat says.Build55 min↗ Official lesson39Reviewer Agent: Separate Builder from MarkerThe agent that wrote the code cannot grade it. A reviewer is a second loop with a different system prompt, a different goal, and read-only access to everything the builder produced. The gap between builder and reviewer is where most reliability lives.Build55 min↗ Official lesson40Multi-Session HandoffThe session is going to end. The work is not. The handoff packet is the artifact that turns "the agent worked for an hour" into "the next session is productive in the first minute." Build it on purpose, not as an afterthought.Build50 min↗ Official lesson41The Workbench on a Real RepoEleven lessons of surfaces are worth nothing if they do not survive contact with a real codebase. This lesson runs the same task twice on a small sample app: prompt-only versus workbench-guided. The numbers do the arguing.Build60 min↗ Official lesson42Capstone: Ship a Reusable Agent Workbench PackThe mini-track ends with a pack you drop into any repo. Eleven lessons of surfaces compressed into a directory you can `cp -r` and have an agent working reliably the next morning. The capstone is the artifact this curriculum trades on.Build75 min↗ Official lesson43Frame the Task Before the Agent Writes CodeA coding agent can implement a clear task quickly. It can also implement an unclear task quickly. The speed is the same. The cost is not.Learn + Build60 min↗ Official lesson44Build an Evidence-Backed Execution PlanA plan is not a prettier to-do list. It is a dependency graph in which every change has a reason and every terminal node has proof.Learn + Build65 min↗ Official lesson45Delegate Agent Work with Isolation and Merge ContractsParallel agents save wall time only when the work is independent. Otherwise they convert one clear task into a coordination problem with a faster failure rate.Learn + Build70 min↗ Official lesson46Turn Every Agent Correction into a System ImprovementA correction that lives only in chat fixes one run. A correction promoted into a test, boundary, example, or tool improves every later run.Learn + Build65 min↗ Official lesson47Define the Outcome Before You Choose the OutputFast implementation increases the penalty for choosing the wrong problem. Shape the outcome first so speed points in the right direction.Learn + Build60 min↗ Official lesson48Discover the Workflow People Actually PerformRequirements are not waiting in a meeting to be collected. They are scattered across actions, workarounds, records, and disagreements.Learn + Build70 min↗ Official lesson49Map Assumptions and Resolve the Riskiest One FirstA roadmap hides uncertainty inside features. An assumption map exposes what must be true before those features deserve to exist.Learn + Build65 min↗ Official lesson50Choose the Smallest Slice That Can Change the DecisionSmall is useful only when it proves something important. A tiny build that cannot change the next decision is merely incomplete.Learn + Build65 min↗ Official lesson51Write Specifications That Preserve JudgmentA useful specification fixes invariants and evidence while leaving reversible implementation choices open. It is a decision boundary, not a screenplay.Learn + Build75 min↗ Official lesson52Design Success Metrics Before the Result ExistsMeasurement should answer a decision, not decorate a dashboard. Start with the goal, derive questions, then choose the smallest metrics that answer them.Learn + Build70 min↗ Official lesson53Choose Prototype, Pilot, or Production DeliberatelyThese are different learning environments, not levels of polish. Choose the stage that answers the current unknown with the least unnecessary consequence.Learn + Build70 min↗ Official lesson54Build a Feedback Ratchet with Ownership and RetirementShipping closes one build loop and opens the learning loop. Evidence must change the system or it becomes telemetry nobody owns.Learn + Build75 min↗ Official lesson
← Phase 13: Tools & ProtocolsPhase 15: Autonomous Systems