wAIpoint
Italiano

Agent patterns: planning, memory, multi-agent

Level: Advanced

What it is

Agent patterns are recurring ways of organising an agent so that it handles bigger jobs. Planning: write the steps first, then carry them out. Memory: keep notes outside the model's limited context and read them back when relevant, as the generative agents of Park and colleagues did with a stream of remembered experiences. Multi-agent: several agents with different roles that talk to one another.

What it is for

Long tasks where one prompt is not enough, work that benefits from a second opinion (one agent writes, another reviews), and simulations of groups of people. Each extra part adds cost and new ways to fail, so use the simplest pattern that works.

How to do it

The process, step by step. Libraries and tools change; these steps stay.

  1. Start with a single agent and a clear task, and find where it fails: loses the thread, forgets, or makes mistakes nobody checks.
  2. If it loses the thread, add planning: have it write a short plan, then do one step at a time and update the plan.
  3. If it forgets, add memory: save useful facts and decisions in a file or database and let it look them up.
  4. If it needs checking, add a second agent as a reviewer with different instructions, and define what it looks for.
  5. Define how agents hand work to each other (what is passed, in what format) and who decides when the job is finished.
  6. Compare against the single-agent version on your test tasks; keep the added complexity only if the results are clearly better.

Timeline

  1. 2023Generative agents: an LLM-based architecture with memory, reflection and planning for believable behaviour (Park et al.). source

Sources