agent-architecture-patterns

AI Agent architecture patterns library with 10 patterns for single and multi-agent systems

3,891 stars

Best use case

agent-architecture-patterns is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

AI Agent architecture patterns library with 10 patterns for single and multi-agent systems

Teams using agent-architecture-patterns should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/agent-architecture-patterns/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/banxian87/agent-architecture-patterns/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/agent-architecture-patterns/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How agent-architecture-patterns Compares

Feature / Agentagent-architecture-patternsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

AI Agent architecture patterns library with 10 patterns for single and multi-agent systems

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Agent Architecture Patterns

This skill provides a comprehensive library of AI Agent architecture patterns to help developers:
- Design single-agent architectures (ReAct, Reflection, Self-Critique, Plan-and-Solve, Tree of Thoughts)
- Design multi-agent collaboration systems (Manager-Worker, Peer-to-Peer, Hierarchical, Market-Based, Pipeline)
- Apply system design principles (separation of concerns, fault tolerance, scalability)
- Implement best practices based on OpenClaw

---

## Patterns

### Single-Agent Patterns (5)

1. **ReAct** - Reasoning + Acting alternation
2. **Reflection** - Self-reflection and iterative improvement
3. **Self-Critique** - Self-criticism and error correction
4. **Plan-and-Solve** - Plan first, then execute
5. **Tree of Thoughts** - Multi-path exploration

### Multi-Agent Patterns (5)

1. **Manager-Worker** - 1 manager coordinates multiple workers
2. **Peer-to-Peer** - Equal agents collaborate
3. **Hierarchical** - Multi-level management structure
4. **Market-Based** - Task bidding and allocation
5. **Pipeline** - Sequential multi-stage processing

---

## Usage

### Option 1: Consult AI-Agent

Ask questions like:
- "Design a multi-agent code review system"
- "How to implement ReAct pattern?"
- "Which agent collaboration pattern should I use?"

### Option 2: Reference Documentation

Browse `patterns/` directory for detailed pattern docs.

### Option 3: Use Code Examples

Run example code from `examples/` directory.

---

## Examples

### ReAct Pattern Example

```javascript
const agent = new ReActAgent({
  tools: [search, calculate],
  maxSteps: 10
});

const answer = await agent.execute("What's the temperature in Beijing today?");
```

### Manager-Worker Pattern Example

```javascript
const workers = [
  new WorkerAgent('worker-1', ['javascript'], { codeReview: true }),
  new WorkerAgent('worker-2', ['python'], { dataAnalysis: true })
];

const manager = new ManagerAgent(workers);
const result = await manager.coordinate("Review this codebase");
```

---

## Installation

```bash
clawhub install agent-architecture-patterns
```

---

## Testing

```bash
npm test
# Runs 30 test cases for ReAct and Manager-Worker implementations
```

---

## License

MIT

---

## Author

AI-Agent

Related Skills

Agent Memory Architecture

3891
from openclaw/skills

Complete zero-dependency memory system for AI agents — file-based architecture, daily notes, long-term curation, context management, heartbeat integration, and memory hygiene. No APIs, no databases, no external tools. Works with any agent framework.

architecture-paradigm-event-driven

3891
from openclaw/skills

Apply event-driven async messaging to decouple producers and consumers. Use for real-time processing

architecture-paradigm-cqrs-es

3891
from openclaw/skills

Apply CQRS and Event Sourcing for read/write separation and audit trails

architecture-paradigm-client-server

3891
from openclaw/skills

Client-server architecture for web/mobile apps with centralized services and API design

shared-patterns

3891
from openclaw/skills

Reference reusable patterns for validation, error handling, and test scaffolding

CLI-Agent Architecture Skill

3891
from openclaw/skills

> A single `run(command="...")` tool with Unix CLI commands outperforms typed function calls.

langgraph-architecture

3891
from openclaw/skills

Guides architectural decisions for LangGraph applications. Use when deciding between LangGraph vs alternatives, choosing state management strategies, designing multi-agent systems, or selecting persistence and streaming approaches.

deepagents-architecture

3891
from openclaw/skills

Guides architectural decisions for Deep Agents applications. Use when deciding between Deep Agents vs alternatives, choosing backend strategies, designing subagent systems, or selecting middleware approaches.

agent-architecture-analysis

3891
from openclaw/skills

Perform 12-Factor Agents compliance analysis on any codebase. Use when evaluating agent architecture, reviewing LLM-powered systems, or auditing agentic applications against the 12-Factor methodology.

vercel-composition-patterns

3891
from openclaw/skills

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

terraform-patterns

3891
from openclaw/skills

Terraform infrastructure-as-code agent skill and plugin for Claude Code, Codex, Gemini CLI, Cursor, OpenClaw. Covers module design patterns, state management strategies, provider configuration, security hardening, policy-as-code with Sentinel/OPA, and CI/CD plan/apply workflows. Use when: user wants to design Terraform modules, manage state backends, review Terraform security, implement multi-region deployments, or follow IaC best practices.

site-architecture

3891
from openclaw/skills

When the user wants to audit, redesign, or plan their website's structure, URL hierarchy, navigation design, or internal linking strategy. Use when the user mentions 'site architecture,' 'URL structure,' 'internal links,' 'site navigation,' 'breadcrumbs,' 'topic clusters,' 'hub pages,' 'orphan pages,' 'silo structure,' 'information architecture,' or 'website reorganization.' Also use when someone has SEO problems and the root cause is structural (not content or schema). NOT for content strategy decisions about what to write (use content-strategy) or for schema markup (use schema-markup).