Skip to content

choutos/multi-agent-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Multi-Agent Patterns

Production-tested patterns for running multiple AI agents. Framework-agnostic.

These patterns emerged from operating 9 AI agents in daily production since February 2026. Each pattern describes a problem, a solution, trade-offs, and implementation notes. They work with OpenClaw, LangGraph, CrewAI, AutoGen, or custom orchestration.

Patterns

Structural Patterns

Pattern Problem Solution
Isolated Workspaces Agents contaminate each other's context Separate filesystem, memory, and credentials per agent
Identity as Architecture Generic agents produce generic output Structured identity files shape agent behavior and quality
Skill-Based Knowledge System prompts don't scale Modular knowledge packages loaded on demand

Operational Patterns

Pattern Problem Solution
Heartbeat Monitoring Agents are purely reactive Periodic self-check enables proactive behavior
Cascading Fallback Single model dependency is fragile Chain of models from premium to local
Memory Consolidation Agents forget everything between sessions Two-layer memory: daily logs + curated long-term

Reliability Patterns

Pattern Problem Solution
Skill-Based Recovery Agents reinvent fixes for known issues Codified procedures for recurring problems
Graceful Degradation System fails completely when one component is down Agents continue with reduced capability
External Action Gates Agents take harmful actions autonomously Approval gates for actions that leave the system

How to Use This

  1. Browse the table above for your problem
  2. Read the pattern for the solution and trade-offs
  3. Adapt the implementation to your framework and stack

Each pattern follows the same structure:

  • Problem: what goes wrong without this pattern
  • Solution: how to fix it
  • Implementation: concrete steps
  • Trade-offs: what you give up
  • When to skip: situations where this pattern is overkill

Anti-Patterns

Things that seemed like good ideas but failed in practice:

❌ Shared Memory Space

Giving multiple agents write access to the same memory files. Results in conflicts, duplicated entries, and confused context. Instead: Each agent has its own memory; a coordinator consolidates.

❌ Agent-to-Agent Debates

Having two agents discuss a technical decision in conversation. Produces more token waste than insight. Instead: Each agent provides an independent recommendation; a human or coordinator synthesizes.

❌ One Agent Per Client

Assigning a single agent to each client account. A client's needs span engineering, operations, and research. Instead: Specialized agents serve multiple clients, with context isolation per client.

❌ Autonomous External Actions

Letting agents send emails, post to services, or modify production systems without approval. Instead: Internal actions (read, analyze, organize) can be autonomous. External actions require human confirmation.

Contributing

If you're running multi-agent systems in production, your patterns belong here.

  1. Fork this repo
  2. Add your pattern following the template in PATTERN-TEMPLATE.md
  3. Open a PR describing the pattern and how it was tested

License

MIT

Origin

From Running 9 AI Agents in Production by Vítor Andrade / Wanderclan OÜ.

About

Production-tested patterns for running multiple AI agents. Framework-agnostic. From 9 agents in daily production.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors