| name | awesome-agentic-patterns-catalog |
| description | Expert knowledge of agentic AI design patterns for autonomous agent development |
| triggers | ["show me agentic patterns for memory management","what patterns exist for agent orchestration","help me design an autonomous agent workflow","which pattern should I use for tool routing","compare reflection loop and tree of thought patterns","what are best practices for agent feedback loops","show examples of multi-agent coordination patterns","how do I implement context window management"] |
Awesome Agentic Patterns Catalog
Skill by ara.so — AI Agent Skills collection.
This skill provides comprehensive knowledge of agentic AI patterns — production-ready architectural patterns, workflows, and techniques for building autonomous and semi-autonomous AI agents. The Awesome Agentic Patterns catalog curates real-world patterns with traceability to implementations, papers, and production use cases.
What is Awesome Agentic Patterns?
A curated catalogue of repeatable patterns that help AI agents sense, reason, and act effectively in production environments. Each pattern is:
- Repeatable — proven by multiple teams
- Agent-centric — improves agent capabilities
- Traceable — backed by public references (blogs, papers, repos)
Website: https://agentic-patterns.com
Repository: https://github.com/nibzard/awesome-agentic-patterns
Pattern Categories
The catalog organizes patterns into 8 core categories:
- Context & Memory — Managing agent state, memory, and context windows
- Feedback Loops — Self-improvement, reflection, and iterative refinement
- Learning & Adaptation — Skill evolution and reinforcement learning
- Orchestration & Control — Task decomposition, multi-agent coordination
- Reliability & Eval — Testing, monitoring, and fault tolerance
- Security & Safety — Sandboxing, PII protection, guardrails
- Tool Use & Environment — Interacting with shells, browsers, databases
- UX & Collaboration — Human-agent interaction patterns
Installation & Access
Browse Online
The primary way to explore patterns is via the website:
open https://agentic-patterns.com
Features available on the website:
- Pattern Explorer: Filter by category, complexity, status
- Compare Tool: Side-by-side pattern comparison
- Decision Explorer: Interactive pattern selection guide
- Graph Visualization: Pattern relationship mapping
- Pattern Packs: Curated collections for common architectures
Clone Repository
git clone https://github.com/nibzard/awesome-agentic-patterns.git
cd awesome-agentic-patterns
Repository Structure
awesome-agentic-patterns/
├── patterns/ # Individual pattern markdown files
│ ├── context-window-auto-compaction.md
│ ├── reflection.md
│ ├── plan-then-execute-pattern.md
│ └── ...
├── apps/
│ └── web/ # Astro-based website source
├── README.md # Main catalog listing
└── LICENSE
Key Patterns Overview
Context & Memory Patterns
Curated Code Context Window
- Dynamically select relevant code files for LLM context
- Use semantic search or dependency analysis
- Example: Pass only modified files + their direct dependencies
Prompt Caching via Exact Prefix Preservation
- Structure prompts so static context (system, docs) comes first
- Cache LLM processing of unchanged prefix
- Reduces latency and cost for iterative workflows
Episodic Memory Retrieval & Injection
- Store past interactions in vector DB
- Retrieve relevant episodes based on current task
- Inject as context to maintain coherence across sessions
Working Memory via TodoWrite
- Agents maintain explicit TODO lists in files
- Track progress, next steps, and blockers
- Provides persistence across crashes/restarts
Feedback Loop Patterns
Reflection Loop
Coding Agent CI Feedback Loop
Self-Critique Evaluator Loop
- Separate evaluator agent assesses worker agent output
- Worker iterates based on evaluator feedback
- Prevents over-fitting to single perspective
Orchestration & Control Patterns
Plan-Then-Execute Pattern
- Decompose complex task into explicit plan
- Execute steps sequentially with validation
- Update plan based on execution results
def plan_then_execute(task):
plan = planner_llm.generate_plan(task)
results = []
for step in plan.steps:
result = executor.execute(step)
if result.needs_replanning:
plan = planner_llm.replan(task, results, step)
results.append(result)
return synthesize(results)
Sub-Agent Spawning
- Main agent delegates subtasks to specialized sub-agents
- Each sub-agent has focused tools and context
- Results aggregated by parent agent
Dual LLM Pattern
- Use different models for different tasks
- Fast/cheap model for simple decisions
- Powerful model for complex reasoning
- Example: GPT-4o-mini for routing, GPT-4 for generation
Tool Use Patterns
Tool Selection Guide
- Provide LLM with explicit decision tree for tool selection
- Include when to use each tool, expected inputs/outputs
- Reduces tool misuse and hallucination
Tool Selection Guide:
- search_code(query): When user asks "where is X defined"
- run_tests(path): After code changes, before commit
- read_file(path): When context about specific file needed
- edit_file(path, instructions): To modify existing code
Conditional Parallel Tool Execution
- Execute independent tools concurrently
- Reduce latency for multi-step operations
- Example: Search docs + search code + check tests in parallel
Reliability Patterns
Agent Circuit Breaker
- Track failure rate of agent actions
- Open circuit (disable agent) after threshold
- Fallback to human or simpler system
class AgentCircuitBreaker:
def __init__(self, failure_threshold=5):
self.failures = 0
self.threshold = failure_threshold
self.state = "closed"
def call(self, agent_fn, *args):
if self.state == "open":
raise CircuitOpenError("Too many failures")
try:
result = agent_fn(*args)
self.on_success()
return result
except Exception as e:
self.on_failure()
raise
def on_failure(self):
self.failures += 1
if self.failures >= self.threshold:
self.state = "open"
LLM Observability
- Log all prompts, completions, tool calls
- Track latency, token usage, costs
- Essential for debugging and optimization
Using Patterns in Agent Development
Pattern Selection Process
-
Identify your agent's core challenge
- Memory/context limits → Context & Memory patterns
- Quality issues → Feedback Loop patterns
- Complex multi-step tasks → Orchestration patterns
- Reliability concerns → Reliability & Eval patterns
-
Review pattern prerequisites
- Check if pattern requires specific infrastructure
- Assess complexity vs. benefit trade-off
-
Start simple, iterate
- Implement minimal version first
- Add sophistication based on real failures
Example: Building a Code Review Agent
from typing import List, Dict
class CodeReviewAgent:
"""
Combines:
- Curated Code Context Window (Context & Memory)
- Reflection Loop (Feedback)
- Tool Selection Guide (Tool Use)
"""
def __init__(self, llm, code_retriever):
self.llm = llm
self.retriever = code_retriever
self.tool_guide = self._load_tool_guide()
def review_pr(self, pr_diff: str) -> Dict:
context_files = self.retriever.get_relevant_context(
pr_diff,
max_files=10
)
initial_review = self.llm.generate(
prompt=f"""
{self.tool_guide}
Review this PR diff:
{pr_diff}
Context files:
{context_files}
Use available tools to verify claims.
""",
tools=["run_tests", "search_similar_code", "check_style"]
)
critique = self.llm.generate(
prompt=f"""
Review this code review for:
- Are all concerns valid?
- Any false positives?
- Missing critical issues?
Review: {initial_review}
"""
)
final_review = .llm.generate(
prompt=
)
{
: final_review,
: context_files,
: critique
}
() -> :
Example: Multi-Agent Research Assistant
class ResearchOrchestrator:
"""
Patterns:
- Planner-Worker Separation
- Sub-Agent Spawning
- Plan-Then-Execute
"""
def __init__(self, planner_llm, worker_llm):
self.planner = planner_llm
self.worker = worker_llm
async def research(self, query: str) -> Dict:
plan = self.planner.generate(
prompt=f"""
Create research plan for: {query}
Output as JSON with steps:
[
{{"type": "search", "query": "...", "sources": [...]}},
{{"type": "analyze", "focus": "..."}},
{{"type": "synthesize", "format": "..."}}
]
"""
)
search_tasks = [
step for step in plan if step["type"] == "search"
]
search_results = await asyncio.gather(*[
self._spawn_search_agent(task)
for task in search_tasks
])
analysis = self.worker.generate(
prompt=f"""
Analyze these search results for: {query}
Results: {search_results}
Focus: {[s['focus'] s plan s[] == ]}
"""
)
report = .worker.generate(
prompt=
)
{
: report,
: search_results,
: plan
}
():
agent = SearchAgent(.worker, sources=task[])
agent.search(task[])
Common Pattern Combinations
Autonomous Coding Agent Stack
1. Curated Code Context Window (manage context size)
2. Plan-Then-Execute (break down complex changes)
3. Coding Agent CI Feedback Loop (validate changes)
4. Reflection Loop (self-review before commit)
5. Agent Circuit Breaker (prevent infinite loops)
Long-Running Agent Architecture
1. Filesystem-Based Agent State (persist state)
2. Working Memory via TodoWrite (track progress)
3. Planner-Worker Separation (long-term planning)
4. Signal-Driven Agent Activation (efficient wake-up)
5. LLM Observability (monitor over time)
Multi-Agent System
1. Declarative Multi-Agent Topology (define structure)
2. Economic Value Signaling (coordinate via incentives)
3. Sub-Agent Spawning (dynamic creation)
4. Opponent Processor (debate for quality)
5. Cross-Cycle Consensus Relay (agreement protocol)
Troubleshooting & Best Practices
Context Window Issues
Problem: Agent loses track of earlier conversation
Solutions:
- Apply Context Window Auto-Compaction: Summarize old context
- Use Episodic Memory Retrieval: Store + retrieve relevant history
- Implement Progressive Disclosure: Only show needed details
- Try Prompt Caching: Preserve expensive prefix computation
Reliability Issues
Problem: Agent produces inconsistent results
Solutions:
- Add Reflection Loop: Self-review catches errors
- Implement Agent Circuit Breaker: Prevent cascading failures
- Use LLM Observability: Log everything to debug
- Apply Failover-Aware Model Fallback: Backup models
Tool Misuse
Problem: Agent uses wrong tools or hallucinates tool calls
Solutions:
- Provide Tool Selection Guide: Explicit decision rules
- Use Tool Capability Compartmentalization: Limit tool access per task
- Implement Tool Use Incentivization: Reward correct usage
- Apply Conditional Parallel Tool Execution: Validate before executing
Planning Failures
Problem: Agent creates poor plans or gets stuck
Solutions:
- Apply Plan-Then-Execute Pattern: Separate planning from execution
- Use Tree-of-Thought Reasoning: Explore multiple plans
- Implement Explicit Posterior-Sampling Planner: Probabilistic planning
- Try Language Agent Tree Search (LATS): Search plan space
Contributing Patterns
To add a new pattern to the catalog:
- Validate it's repeatable: Used by 2+ teams/projects
- Document traceability: Link to blog, paper, or repo
- Create pattern file:
patterns/your-pattern-name.md
- Follow template structure:
# Pattern Name
## Problem
What challenge does this solve?
## Solution
How does the pattern work?
## Implementation
Code examples, architecture diagrams
## References
- [Source 1](url)
- [Source 2](url)
- Submit PR: https://github.com/nibzard/awesome-agentic-patterns
Resources
Advanced Usage
Pattern Selection Matrix
| Your Challenge | Primary Pattern | Supporting Patterns |
|---|
| Exceeding context limits | Curated Code Context Window | Prompt Caching, Progressive Disclosure |
| Low quality outputs | Reflection Loop | Self-Critique Evaluator, CriticGPT |
| Complex multi-step tasks | Plan-Then-Execute | Sub-Agent Spawning, Tree-of-Thought |
| Unreliable behavior | Agent Circuit Breaker | LLM Observability, Failover Fallback |
| Tool confusion | Tool Selection Guide | Tool Compartmentalization |
| Multi-agent coordination | Declarative Topology | Economic Value Signaling |
Pattern Anti-Patterns
Don't:
- Stack too many patterns initially (start simple)
- Use orchestration patterns for simple tasks (overhead)
- Skip observability (you'll regret it)
- Ignore context window limits (use memory patterns)
- Over-engineer before proving need (iterate)
Do:
- Measure before optimizing (observability first)
- Start with single-agent patterns (orchestrate later)
- Document why you chose each pattern (maintainability)
- Test patterns in isolation (debug complexity)
- Review catalog regularly (patterns evolve)
This skill provides comprehensive knowledge of production-ready agentic patterns. Use the website's interactive tools for pattern discovery and the repository examples for implementation guidance.