Why agentic patterns

1 min read
On trails:AGENTSstep 1/9

Prompt engineering is a tactic, and a fragile one. Change the wording, the model or the input, and the behavior moves. An agentic architecture is the strategy: a small set of named patterns that decide how the model, its tools and its memory fit together.

Why a tactic is not enough

One prompt that carries every job (instructions, picking tools, planning, checking its own work) fails in ways nobody can locate. A pattern splits those jobs into parts that can be built, tested and swapped one at a time. See prompt engineeringPrompt engineeringEngineering the instruction given to the model.Opens in a new tab for what a prompt can still do well, and flow engineeringFlow engineeringDesign the task as a flow of steps: a model where judgement is needed, plain code everywhere else.Opens in a new tab for moving the steps out of the prompt and into code.

The patterns are not a reason to reach for them early. Anthropic’s advice is to start with simple prompts and add multi-step structure only when it demonstrably improves the outcome.

The map

  • Foundation: the core agent. LLM versus agentLLM versus agentA model predicts text. An agent wraps that model in a loop with a goal.Opens in a new tab, state graphsState graphsAn agent drawn as nodes that read and write one shared state, joined by edges that say what runs next.Opens in a new tab and memoryAgent memoryWhat an agent remembers: the thread it is in, and what it keeps across threads.Opens in a new tab.
  • Design principles: goal-directed, reactive, stateful, autonomousAgent design principlesFour properties that make a loop an agent: goal-directed, reactive, stateful, autonomous.Opens in a new tab.
  • Single-agent patterns: tool useTool useFunction calling gives the model hands: it asks, and code does the work.Opens in a new tab, planningPlanningBreak a high-level goal into steps, store the plan, and work through it.Opens in a new tab, reflectionReflectionCritique the output before finalizing it: one agent does, another reflects.Opens in a new tab and ReActReActReason, act, observe, repeat: planning, tool use and a loop in one pattern.Opens in a new tab.
  • Multi-agent patterns: routerRouter patternA manager that only decides which specialist handles the request.Opens in a new tab, handoffHandoff patternAgents in a fixed sequence, each passing its output to the next.Opens in a new tab, group chatGroup chat patternAgents that talk to each other in one thread, with a manager keeping order.Opens in a new tab and swarmSwarm and map-reduceA queen agent spawns a worker per task, then collects the results.Opens in a new tab.
  • Control and safety patterns: human in the loopHuman in the loopA pause in the agent's decision, where a person approves before a high-risk action runs.Opens in a new tab and ejection logicEjection logicCustom code that stops the agent, or hands over to a person, when a condition is met.Opens in a new tab.

Underneath all of them sits one question: what goes into the context window on each step. That is context engineeringContext engineeringDeciding what the model sees on every call, because the window is finite.Opens in a new tab.


Sources