A pattern language for working with agents

Each pattern is named, numbered and quoted from the people who published it or run it.

subtask, resultTaskOrchestratorWorkerWorkerWorker6Orchestrator and workers

People and agents

  1. 1Plan before codingHave the agent research and write a plan you approve before it edits anything.
  2. 2Human approvalA person approves sensitive or irreversible actions before the agent takes them.

Systems of agents

  1. 5ParallelizationRun independent subtasks or repeated attempts at once, then combine the results.
  2. 6Orchestrator and workersContestedA lead model splits a task as it goes, hands the parts to workers and combines their results.
  3. 8AdvisorA fast, cheap model does the work and asks a stronger model for guidance at hard moments.

One agent

  1. 10Agent loopA model uses tools in a loop, deciding each next step from what the last one returned.
  2. 11ReflectionContestedThe agent critiques its own output or past attempts, then tries again.
  3. 12CompactionWhen the context window fills, summarize the conversation and continue from the summary.