Agent Patterns
13 patterns
Prompt Chaining
Sequence multiple LLM calls with conditional gates and branching paths.
Routing
Classify user input and route it to the right handler or specialist agent.
Parallelization
Fan out tasks to multiple LLM calls simultaneously and aggregate results.
Orchestrator Workers
Delegate subtasks from an orchestrator to specialized worker agents.
Evaluator Optimizer
Loop between generator and evaluator LLMs (including self-critique) to iteratively improve outputs against quality criteria.
Autonomous Agent
Build an agent with a ReAct loop: think, act, observe, and plan.
Tool Calling
Enable LLMs to call external APIs, databases, and functions via structured interfaces.
Retrieval-Augmented Generation
Retrieve relevant context from your data sources using vector search and hybrid retrieval to ground LLM responses with citations.
Planner Executor Verifier
One stage plans the work, another executes it, and a verifier checks completion before the system advances.
Approval-Gated Actions
Let the model decide what action is needed, but require human or policy approval before side effects happen.
Model Cascade Routing
Start with a cheaper or faster model, escalate to a stronger model only when confidence or complexity requires it.
Memory Tiering
Split state into working memory, session memory, and long-term memory with explicit write/read rules.
Trace and Eval Flywheel
Capture traces, grade them, turn failures into datasets, and iteratively improve prompts, tools, and routes.
Prompt Patterns
11 patterns
Chain of Thought
Prompt step-by-step reasoning before the final answer for complex problems.
Few-Shot
Provide example input-output pairs for in-context learning.
Instruction Hierarchy
Structure prompts with prioritized instruction levels to manage conflicts.
Structured Output
Constrain LLM outputs to valid JSON matching a schema.
Self-Consistency
Generate multiple reasoning paths and aggregate via majority voting.
Context Engineering
Curate the smallest high-signal context set for each turn instead of stuffing everything into the prompt.
Tool Use Policy
Tell the model when to call tools, when not to, and how to behave when tools fail or conflict.
Quote-Then-Answer Grounding
Ask the model to extract or cite relevant evidence first, then answer from those grounded snippets.
Prompt Caching-Aware Layout
Put static instructions, tools, and examples first; put variable user data last so repeated prefixes are cacheable.
Prompt Versioning and Evals
Treat prompts like production assets with versions, regression tests, and measurable pass criteria.
State Handoff and Memory
Persist task state outside the active prompt and rehydrate only what is needed for the next turn or session.