Awesome Agentic Patterns

A curated catalogue of agentic AI patterns — real‑world tricks, workflows, and mini‑architectures that help autonomous or semi‑autonomous AI agents get useful work done in production.
Why? Tutorials show toy demos. Real products hide the messy bits. This list surfaces the repeatable patterns that bridge the gap so we can all ship smarter, faster agents.
What counts as a pattern?
- Repeatable – more than one team is using it.
- Agent‑centric – improves how an AI agent senses, reasons, or acts.
- Traceable – backed by a public reference: blog post, talk, repo, or paper.
If your link ticks those boxes, it belongs here.
Quick Tour of Categories
| Category | What you'll find |
|---|---|
| Context & Memory | Sliding‑window curation, vector cache, episodic memory |
| Feedback Loops | Compilers, CI, human review, self‑healing retries |
| Learning & Adaptation | Agent RFT, skill libraries, variance‑based RL |
| Orchestration & Control | Task decomposition, sub‑agent spawning, tool routing |
| Reliability & Eval | Guardrails, eval harnesses, logging, reproducibility |
| Security & Safety | Isolated VMs, PII tokenization, security scanning |
| Tool Use & Environment | Shell, browser, DB, Playwright, sandbox tricks |
| UX & Collaboration | Prompt hand‑offs, staged commits, async background agents |
Categories are fluid — open a PR if you see a better slice!
The tables below are auto‑generated from the patterns/ folder.
Context & Memory
- Agent-Powered Codebase Q&A / Onboarding
- Context Window Anxiety Management
- Context Window Auto-Compaction NEW
- Context-Minimization Pattern
- Curated Code Context Window
- Curated File Context Window
- Dynamic Context Injection
- Episodic Memory Retrieval & Injection
- Filesystem-Based Agent State
- Layered Configuration Context
- Memory Synthesis from Execution Logs
- Proactive Agent State Externalization
- Progressive Disclosure for Large Files UPDATED
- Prompt Caching via Exact Prefix Preservation NEW
- Self-Identity Accumulation NEW
- Semantic Context Filtering Pattern UPDATED
Feedback Loops
- AI-Assisted Code Review / Verification
- Background Agent with CI Feedback
- Coding Agent CI Feedback Loop
- Dogfooding with Rapid Iteration for Agent Improvement
- Graph of Thoughts (GoT)
- Inference-Healed Code Review Reward
- Iterative Prompt & Skill Refinement UPDATED
- Reflection Loop
- Rich Feedback Loops > Perfect Prompts
- Self-Critique Evaluator Loop
- Self-Discover: LLM Self-Composed Reasoning Structures
- Spec-As-Test Feedback Loop
- Tool Use Incentivization via Reward Shaping
Learning & Adaptation
- Agent Reinforcement Fine-Tuning (Agent RFT)
- Compounding Engineering Pattern
- Memory Reinforcement Learning (MemRL) UPDATED
- Skill Library Evolution UPDATED
- Variance-Based RL Sample Selection
Orchestration & Control
- Action-Selector Pattern
- Agent-Driven Research
- Autonomous Workflow Agent Architecture
- Conditional Parallel Tool Execution UPDATED
- Continuous Autonomous Task Loop Pattern
- Custom Sandboxed Background Agent NEW
- Discrete Phase Separation UPDATED
- Disposable Scaffolding Over Durable Features
- Distributed Execution with Cloud Workers
- Dual LLM Pattern
- Explicit Posterior-Sampling Planner
- Feature List as Immutable Contract
- Hybrid LLM/Code Workflow Coordinator UPDATED
- Inference-Time Scaling
- Initializer-Maintainer Dual Agent Architecture
- Inversion of Control
- Iterative Multi-Agent Brainstorming
- Lane-Based Execution Queueing NEW
- Language Agent Tree Search (LATS)
- LLM Map-Reduce Pattern
- Multi-Model Orchestration for Complex Edits
- Opponent Processor / Multi-Agent Debate Pattern
- Oracle and Worker Multi-Model Approach
- Parallel Tool Call Learning
- Plan-Then-Execute Pattern
- Planner-Worker Separation for Long-Running Agents NEW
- Progressive Autonomy with Model Evolution
- Progressive Complexity Escalation
- Recursive Best-of-N Delegation
- Self-Rewriting Meta-Prompt Loop
- Specification-Driven Agent Development
- Stop Hook Auto-Continue Pattern
- Sub-Agent Spawning UPDATED
- Swarm Migration Pattern
- Three-Stage Perception Architecture
- Tool Capability Compartmentalization
- Tree-of-Thought Reasoning
Reliability & Eval
- Action Caching & Replay Pattern UPDATED
- Adaptive Sandbox Fan-Out Controller
- Anti-Reward-Hacking Grader Design
- Asynchronous Coding Agent Pipeline
- CriticGPT-Style Code Review
- Extended Coherence Work Sessions
- Failover-Aware Model Fallback NEW
- Lethal Trifecta Threat Model
- LLM Observability UPDATED
- Merged Code + Language Skill Model
- No-Token-Limit Magic
- RLAIF (Reinforcement Learning from AI Feedback)
- Schema Validation Retry with Cross-Step Learning UPDATED
- Structured Output Specification
- Versioned Constitution Governance
- Workflow Evals with Mocked Tools UPDATED
Security & Safety
- Deterministic Security Scanning Build Loop
- External Credential Sync NEW
- Isolated VM per RL Rollout
- PII Tokenization
- Sandboxed Tool Authorization NEW
Tool Use & Environment
- Agent SDK for Programmatic Control
- Agent-First Tooling and Logging
- Agentic Search Over Vector Embeddings
- AI Web Search Agent Loop UPDATED
- CLI-First Skill Design
- CLI-Native Agent Orchestration
- Code Mode MCP Tool Interface Improvement Pattern
- Code-Over-API Pattern
- Code-Then-Execute Pattern
- Dual-Use Tool Design
- Dynamic Code Injection (On-Demand File Fetch)
- Egress Lockdown (No-Exfiltration Channel)
- Intelligent Bash Tool Execution NEW
- LLM-Friendly API Design
- Multi-Platform Communication Aggregation
- Multi-Platform Webhook Triggers UPDATED
- Patch Steering via Prompted Tool Selection
- Progressive Tool Discovery
- Shell Command Contextualization
- Subagent Compilation Checker
- Tool Use Steering via Prompting
- Virtual Machine Operator Agent
- Visual AI Multimodal Integration
UX & Collaboration
- Abstracted Code Representation for Review
- Agent-Assisted Scaffolding
- Agent-Friendly Workflow Design
- AI-Accelerated Learning and Skill Development
- Chain-of-Thought Monitoring & Interruption
- Democratization of Tooling via Agents
- Human-in-the-Loop Approval Framework
- Latent Demand Product Discovery
- Proactive Trigger Vocabulary
- Seamless Background-to-Foreground Handoff
- Spectrum of Control / Blended Initiative
- Team-Shared Agent Configuration as Code
- Verbose Reasoning Transparency
Contributing in 3 steps
- Fork & branch →
git checkout -b add-my-pattern - Add a pattern file under
patterns/using the template above. - Open a PR titled
Add: my-pattern-name— the README & site will regenerate automatically.
See CONTRIBUTING.md for the fine print.
Inspiration
This project started after the write‑up "What Sourcegraph learned building AI coding agents" (28 May 2025) and the ongoing Raising an Agent video diary. Many first patterns come straight from those lessons — thanks to everyone sharing their journey in the open!
License
Apache‑2.0. See LICENSE.