Agent Patterns and Frameworks
Official scope (Exam Guide v1.0): tool-use loops, sub-agents, memory, context-window management, and the frameworks Strands, LangGraph and PydanticAI.
Five workflow patterns (verified: "Building effective agents")
| Pattern | Shape | Use when |
|---|---|---|
| Prompt chaining | Fixed sequence; each call uses the last output; programmatic checks ("gates") between | Task splits cleanly into steps; trade latency for accuracy |
| Routing | Classify the input, send to a specialised path | Distinct categories, reliable classification; includes easy→small model, hard→large model |
| Parallelization | Sectioning (independent subtasks at once) or voting (several attempts for confidence) | Speed, or more certainty |
| Orchestrator-workers | A central model decides subtasks at run time, delegates, combines | Subtasks cannot be predicted in advance |
| Evaluator-optimizer | One call generates, another critiques; loop until good | Clear criteria and iteration measurably helps |
Orchestrator-workers varies which work is done; evaluator-optimizer repeats the same work until it passes.
Sub-agents
Own context window, own prompt and tools, returns only a final summary. Main benefit: context isolation; also tool restriction and cheaper models. Use for parallel, isolated, independent work; avoid for simple, sequential or tightly coupled tasks.
Memory and context (verified mechanics, design guidance on choice)
- Short-term: what is in the context window (history, tool results).
- Long-term: an external store the agent reads and writes (for example the memory tool, files, a database), or Claude Code's CLAUDE.md and auto memory.
- Manage the window with compaction, clearing old tool results and subagent isolation (6.2).
Named frameworks (verified from each project's own docs, 2026-10-16)
| Framework | From | Core idea | Fit |
|---|---|---|---|
| Strands Agents | Open source (Apache-2.0), released by AWS | Model-driven: you give a model, system prompt and tools; the model plans and picks tools in its loop. Python and TypeScript. Multi-agent: agents-as-tools, swarm, graph, workflow, A2A | Low ceremony; AWS-centric stacks; Claude via Anthropic API or Bedrock |
| LangGraph | LangChain Inc | Low-level graph orchestration: StateGraph with nodes and edges; mix deterministic and LLM steps. Durable execution, streaming, human-in-the-loop, persistence, short- and long-term memory | Long-running, stateful workflows that need explicit control over steps and branching |
| PydanticAI | The Pydantic team | Type-safe Python agents: outputs validated against Pydantic models, type-safe dependency injection, tool schemas from function signatures. Logfire/OpenTelemetry observability; Pydantic Graph for workflows | Python teams that want validated, typed outputs with little ceremony |
All three are provider-agnostic and support Claude.
Rule of thumb (design guidance): model-driven (Strands) for simplicity; graph-based (LangGraph) for tight control; typed (PydanticAI) when validated structure matters most. If you need Claude Code's own tools and permissions, the Agent SDK is the Anthropic option.
Exam traps
- Orchestrator-workers for a fixed pipeline (that is chaining).
- Picking an agent framework before deciding the pattern.
- "LangGraph is model-driven." It is explicit graph control.
- Sub-agents for a tightly coupled, sequential task.
References
- Building effective agents — checked Oct 16, 2026
- Subagents in the SDK — checked Oct 16, 2026
- Memory tool — checked Oct 16, 2026
- Strands Agents — checked Oct 16, 2026
- AWS blog: Strands Agents SDK deep dive — checked Oct 16, 2026
- LangGraph overview — checked Oct 16, 2026
- Pydantic AI — checked Oct 16, 2026
Check your understanding
Outline → validate → draft, always. Pattern?Show answerHide answer
Answer
Prompt chaining.Files to change are only known after reading the repo. Pattern?Show answerHide answer
Answer
Orchestrator-workers.Three reviewers check one change; answers merged for confidence. Pattern?Show answerHide answer
Answer
Parallelization (voting).Explicit branching, checkpoints and human approval steps in a long workflow. Framework?Show answerHide answer
Answer
LangGraph.