Agent Architecture
All agent patterns in one place: single-agent (ReAct, Reflection), multi-agent (Supervisor, Swarm, A2A), workflow (Router, Orchestrator-Worker), plus system design, memory, and frontend.
The decision framework for choosing between chains, single agents, and multi-agent systems — and how to scope your first agent correctly.
The Reason-Act loop that powers every LangGraph agent: think, pick a tool, observe the result, repeat until done.
How to add a self-critique step so the agent evaluates its own output, catches mistakes, and iterates before responding.
Two patterns for complex agents: upfront planning that decomposes tasks into steps, and routing that dispatches to specialized sub-agents.
Sequential LLM calls with gate functions for conditional flows — each step transforms data for the next, with optional quality gates between steps.
One LLM generates, another evaluates — loop until quality threshold met. The Evaluator-Optimizer pattern creates self-improving agents that refine outputs iteratively.
The Router pattern classifies input in a single step and dispatches to specialized handlers — a stateless, fast alternative to supervisor-based orchestration.
The Orchestrator-Worker pattern breaks complex tasks into subtasks, delegates to specialized workers via the Send API, and synthesizes results — ideal for parallel, multi-step work.
Multiple LLMs work simultaneously on the same input, with results aggregated via voting, merging, or selection — for speed or confidence.
The Skills pattern loads specialized prompts and knowledge on-demand via progressive disclosure — the agent stays in control while skills inject expertise only when relevant.
When and how to split work across multiple agents: architecture patterns, communication protocols, and shared state strategies.
A central supervisor agent that routes tasks to specialized worker agents, aggregates results, and manages the overall workflow.
Peer-to-peer agent handoffs where each agent decides who to pass control to next, inspired by OpenAI's Swarm pattern.
Launch background subagents that run concurrently while the supervisor continues chatting — with start, check, update, cancel, and list lifecycle management.
Google's Agent-to-Agent protocol for inter-agent communication. Integration with LangGraph Agent Server. When to use A2A vs direct handoffs.
Short-term, long-term, and episodic memory for agents — how to make your agent remember context across conversations and learn from experience.
The LangMem SDK for automatic memory extraction and the LangGraph Store API for persistent cross-thread storage.
How agent system prompts differ from chatbot prompts: structuring instructions, defining tool use policies, controlling chain-of-thought, and setting behavioral boundaries.
The art of tool descriptions: how the LLM reads them, what makes a description effective, and patterns for reducing tool selection errors.
Using few-shot examples to teach agents complex behaviors: example trajectories, tool call demonstrations, and dynamic example selection.
Managing prompts as code: version control, A/B testing frameworks, rollback strategies, and measuring prompt performance in production.
How to map business processes onto LangGraph workflows: identifying nodes, edges, state, and human checkpoints.
Advanced state management: reducers, private vs public state, state channels, and handling state in long-running workflows.
Building agents that degrade gracefully: circuit breakers, fallback chains, timeout handling, and recovery strategies.
Token budgets, message trimming, compression strategies, and sliding window patterns to keep your agent within context limits.
Monorepo patterns, project organization for LangGraph apps, and separation of graph definition vs node logic vs tools.
Intent-based routing, semantic routing, multi-level classification, and fallback strategies for directing queries to specialized handlers with confidence thresholds.
Building resilient agents with fallback chains, circuit breakers, stale cache serving, and feature degradation under load — so your agent always returns something useful.
Building dynamic frontend components driven by agent output. Streaming UI updates, tool result rendering, and real-time state visualization.
The useStream React hook renders LangGraph agent output in real-time — per-node status indicators, streaming tokens, and custom events from tools. Works with StateGraph, create_agent, and create_deep_agent.
Using OpenAI's native function calling and Assistants API directly — no framework required. Function definitions, parallel tool calls, structured outputs, and when to skip the LangChain wrapper.
Claude's native tool use API: tool definitions, tool_choice modes, extended thinking for complex reasoning, computer use for desktop automation, and streaming with tool calls.
Building AI-powered applications with the Vercel AI SDK: streaming by default, React hooks for chat UIs, server-side text generation, and tool integration with Zod schemas.
Comparing LangGraph, CrewAI, AutoGen, and Mastra: features, trade-offs, learning curves, and a decision framework for choosing the right tool for your agent project.
Building production-ready agents with just the LLM API and a while loop. When frameworks add overhead without value, and how to write a complete agent in about 100 lines of code.
Architecting agents that run for hours or days: durable execution, checkpointing strategies, progress reporting, and timeout/budget management to prevent runaway costs.
Building AI agents that navigate and interact with websites: Playwright + LLM for web tasks, page understanding strategies, action spaces, and error recovery patterns.
Building agents that interact with desktop applications using Anthropic's Computer Use: the screenshot-analyze-act loop, safety boundaries, sandboxing, and practical use cases like legacy app automation.
Building agents that generate, execute, and iterate on code: the REPL pattern, sandboxing with Docker and E2B, validation through type checking and tests, and data analysis agents.
Building supervision layers for autonomous agents: kill switches, permission systems, human approval gates, monitoring dashboards, and complete audit logging for post-mortem analysis.
End-to-end walkthrough: build a multi-source research agent with planning, parallel web search, subagent delegation, filesystem persistence, and report synthesis using Deep Agents.
End-to-end walkthrough: build a customer support agent with query routing, RAG knowledge base, tool-calling for account actions, human-in-the-loop escalation, and multi-tenant auth.
End-to-end walkthrough: build a production RAG system with ingestion pipeline, hybrid search, self-corrective retrieval, answer validation, and continuous evaluation.
End-to-end walkthrough: build a code review agent with Deep Agents + sandbox for safe code analysis, project-specific skills, parallel file review, and GitHub integration.
How to build production agents for contract analysis, compliance checking, legal research, and document review — with the guardrails that regulated environments demand.
Building production agents for financial research, risk assessment, portfolio analysis, and report generation — with the numerical accuracy, audit trails, and regulatory compliance that finance demands.
Building production agents for clinical decision support, patient documentation, and medical Q&A — with HIPAA compliance, safety guardrails, and the principle that AI assists clinicians but never replaces clinical judgment.
Design patterns for production customer support agents: multi-tier routing, RAG knowledge bases, account action tools, HITL escalation, session memory, and satisfaction tracking.